Xteink-X4-crosspoint-reader/lib/EpdFont
Eunchurn Park dc7544d944
Optimize glyph lookup with binary search (#125)
Replace linear O(n) search with binary search O(log n) for unicode
interval lookup. Korean fonts have many intervals (~30,000+ glyphs), so
this improves text rendering performance during page navigation.

## Summary

* **What is the goal of this PR?** (e.g., Fixes a bug in the user
authentication module, Implements the new feature for
  file uploading.)

Replace linear `O(n)` glyph lookup with binary search `O(log n)` to
improve text rendering performance during page navigation.

* **What changes are included?**

- Modified `EpdFont::getGlyph()` to use binary search instead of linear
search for unicode interval lookup
- Added early return for empty interval count

## Additional Context

* Add any other information that might be helpful for the reviewer
(e.g., performance implications, potential risks, specific areas to
focus on).

- Performance implications: Fonts with many unicode intervals benefit
the most. Korean fonts have ~30,000+ glyphs across multiple intervals,
but any font with significant glyph coverage (CJK, extended Latin,
emoji, etc.) will see improvement.
- Complexity: from `O(n)` to `O(log n)` where n = number of unicode
intervals. For fonts with 10+ intervals, this reduces lookup iterations
significantly.
- Risk: Low - the binary search logic is straightforward and the
intervals are already sorted by unicode codepoint (required for the
original early-exit optimization).
2025-12-26 11:46:17 +11:00
..
builtinFonts Fix: restores cyrillic glyphs to Pixel Arial font (#70) 2025-12-21 19:01:11 +11:00
scripts Fix font readability by expanding blacks and trimming whites (#55) 2025-12-18 21:39:13 +11:00
EpdFont.cpp Optimize glyph lookup with binary search (#125) 2025-12-26 11:46:17 +11:00
EpdFont.h More pass by reference changes 2025-12-06 15:56:00 +11:00
EpdFontData.h Move to SDK EInkDisplay and enable anti-aliased 2-bit text (#5) 2025-12-08 19:48:49 +11:00
EpdFontFamily.cpp Wrap up multiple font styles into EpdFontFamily 2025-12-06 01:44:14 +11:00
EpdFontFamily.h Wrap up multiple font styles into EpdFontFamily 2025-12-06 01:44:14 +11:00