Skip to content

haawa799/KanjiBezierPaths

Repository files navigation

Build Status Swift version Platforms codecov Carthage compatible

KanjiBezierPaths

Small realm database with wrapper. Contains ~6k different kanji and radicals vector data. Stored as BezierPath arrays, each beziar path represent one kanji stroke.

Dependency

  • Realm

Usage

do {
    let provider = try KanjiProvider()
    let bezierPaths: [UIBezierPath]? = provider.pathesForKanji("")
} catch {
    debugPrint(error)
}

You can then use the array of bezierPaths to draw kanji or to do whatever you like with it.

Origin

All data comes from this repo https://github.com/KanjiVG/kanjivg. Long ago I extracted strokes info from svgs inside this repo, and stored them as binary files with array of UIBezierPath encoded to blob. Then I wrote a small python script which stored all this data into small sqlite database. And now since I use Realm in projects which potentially will use this framework, I generated Realm database from that old sqlite db.