Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 1.48 KB

README.md

File metadata and controls

31 lines (22 loc) · 1.48 KB

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.