Last updated:
0 purchases
kanjivg
kanjivg #
kanjivg provides a simple way of interacting with data from the KanjiVG (Kanji Vector Graphics) project. This package is a pure Dart implementation of a parser for SVG files with extensions added by the maintainers of KanjiVG. It provides metadata like stroke count, original radical forms (e.g. 人 for 亻), position of radicals and more.
This package is neither supported nor related to the creators of the KanjiVG project.
Getting started #
Add this package to your dependencies.
dependencies:
kanjivg: latest_version
copied to clipboard
Get the dependencies.
dart pub get
copied to clipboard
Usage #
The library doesn't include kanji data as there are over 10,000 files and it would be quite wasteful if you want to fetch them at runtime.
You can either:
download SVG files from project's GitHub page,
self-host them and get SVG data from your server.
import 'package:kanjivg/kanjivg.dart';
void main() {
const source = '<?xml version="1.0" encoding="UTF-8"?> ... </svg>';
const parser = KanjiParser();
// Returns an instance of `KvgData` with `id`, `character`, `radicals` and `strokes`.
final data = parser.parse(source);
}
copied to clipboard
Additional information #
This package requires at least Dart 3.5 to work.
If there are any issues feel free to go to GitHub Issues and report a bug.
Maintainers #
Nikodem Bernat
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.