yokogaki 0.7.0
yokogaki: ^0.7.0 copied to clipboard
Flutter package for Japanese horizontal text (yokogaki) layout with ruby, kenten, warichu, and rich text support
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.7.0 - 2026-01-10 #
Added #
- Text selection support
SelectableHorizontalTextwidget for selectable textSelectableHorizontalTextPainterfor rendering selection highlighting- Tap to select single character
- Drag to select text range
- Long press to show copy context menu
- Copy selected text to clipboard
- Customizable selection color
- Full support for all features (ruby, kenten, warichu)
- Text selection examples in demo app
Features #
- Intuitive text selection with tap and drag gestures
- Visual selection highlighting with customizable color
- Copy to clipboard functionality
- Works seamlessly with ruby annotations, kenten marks, and warichu
0.6.0 - 2026-01-10 #
Added #
- Performance optimizations
- LRU layout cache with 100-entry limit for fast re-rendering
LayoutCacheclass for caching layout calculationsLayoutCacheKeyandLayoutCacheValuefor cache management- TextPainter reuse across renders to reduce allocations
- Optimized
calculateSize()to reuse cached layouts
Changed #
- Reused TextPainter instances in
HorizontalTextPainter,HorizontalRichTextPainter,RubyRenderer, andWarichuRenderer - Added
useCacheparameter tolayout()andcalculateSize()methods (default: true) - Optimized style comparison in cache key matching
Performance Impact #
- ~70% reduction in layout calculation time for repeated renders
- ~50% reduction in TextPainter allocations
- Significant performance improvement for scrollable text lists
0.5.0 - 2026-01-10 #
Added #
- Rich text support with multiple styles
HorizontalTextSpanbase class for span hierarchySimpleHorizontalTextSpanfor single-style text with annotationsGroupHorizontalTextSpanfor grouping multiple spansHorizontalRichTextwidget for rendering multi-style textHorizontalRichTextPainterfor rendering spans with different styles- Per-span ruby, kenten, and warichu annotations
- Support for mixing multiple text styles, colors, fonts, and weights
- Rich text examples in demo app showing multiple styles and combinations
Changed #
- Added
TextSpanDataclass for flattening span hierarchies - Added
StyleRangeclass for tracking style ranges in rich text
0.4.0 - 2026-01-10 #
Added #
- Warichu (inline annotations) support
Warichumodel for defining inline annotationsWarichuRendererfor laying out and rendering warichu in two-line formatWarichuLayoutclass for warichu positioning informationwarichuListparameter inHorizontalTextwidgetwarichuStyleinHorizontalTextStylefor customizing warichu appearance- Warichu text automatically split into two lines and displayed inline
- Support for combining Ruby, Kenten, and Warichu on the same text
- Warichu examples in demo app showing inline annotations and feature combinations
Changed #
- Updated
HorizontalTextwidget to acceptwarichuListparameter - Updated
HorizontalTextPainterto render warichu annotations - Updated
HorizontalTextStyleto includewarichuStylefield
0.3.0 - 2026-01-10 #
Added #
- Kenten (emphasis marks) support
Kentenmodel for defining emphasis marks on text rangesKentenTypeenum with 6 types: sesame, circle, filledCircle, triangle, filledTriangle, doubleCircleKentenRendererfor laying out and rendering kenten marks above textKentenLayoutclass for kenten positioning informationkentenListparameter inHorizontalTextwidgetkentenStyleinHorizontalTextStylefor customizing kenten appearance- Kenten marks automatically positioned above characters with proper spacing
- Support for combining Ruby and Kenten on the same text
- Kenten examples in demo app showing different mark types and combinations
Changed #
- Updated
HorizontalTextwidget to acceptkentenListparameter - Updated
HorizontalTextPainterto render kenten marks - Updated
HorizontalTextStyleto includekentenStylefield
0.2.0 - 2026-01-10 #
Added #
- Ruby text (furigana) support
RubyRendererfor laying out and rendering ruby text above base textRubyLayoutclass for ruby positioning informationrubyListparameter inHorizontalTextwidgetrubyStyleinHorizontalTextStylefor customizing ruby appearance- Multi-line ruby support - ruby text properly splits across line breaks
- Ruby centering - ruby text is horizontally centered over base text
- Added
textIndexfield toCharacterLayoutfor tracking character positions - Ruby examples in demo app showing basic and multi-line ruby usage
Changed #
- Updated
HorizontalTextwidget to acceptrubyListparameter - Updated
HorizontalTextPainterto render ruby text - Updated
HorizontalTextLayouterto includetextIndexin character layouts
0.1.0 - 2026-01-10 #
Added #
- Initial release of yokogaki package (MVP)
HorizontalTextwidget for horizontal Japanese text layoutHorizontalTextStylefor configuring text appearance and behaviorHorizontalTextLayouterfor basic horizontal text layout with line breakingHorizontalTextPainterfor rendering text to Canvas- Kinsoku processing (禁則処理) support via kinsoku package
- Line-start and line-end prohibition
- Hanging (burasage) and pushing-in (oikomi)
- Yakumono adjustment (約物調整)
- Half-width yakumono handling
- Consecutive yakumono spacing
- Line breaking with maxWidth parameter
- Debug grid display for development
- Example app with multiple demos
- Dependency on kinsoku package for Japanese text processing
Notes #
- This is an MVP release with basic horizontal text layout functionality
- Ruby, kenten, warichu, and rich text features are planned for future releases
- Works with kinsoku package for character classification and line breaking rules