Skip to content

font cleanup#29198

Merged
chrisnojima merged 27 commits intonojima/HOTPOT-next-670-clean-2from
nojima/HOTPOT-font-cleanup
May 7, 2026
Merged

font cleanup#29198
chrisnojima merged 27 commits intonojima/HOTPOT-next-670-clean-2from
nojima/HOTPOT-font-cleanup

Conversation

@chrisnojima
Copy link
Copy Markdown
Contributor

@chrisnojima chrisnojima commented May 6, 2026

Replaces the old fontforge + webfonts-generator pipeline with a pure-Python font_tool.py that builds kb.ttf directly from SVGs using fonttools.

  • font_tool.py (shared/tools/fonts/): new build tool — parses SVG paths, assembles glyph outlines, sets OS/2 and GASP metrics, and writes platform-specific TTF outputs (root, ios/, electron/, android/) from fonts/manifest.json
  • Manifest/metrics (fonts/manifest.json, fonts/metrics.json): declarative config for text fonts and icon font, plus snapshotted metrics for regression checking
  • Font outputs reorganized into fonts/ios/, fonts/electron/, fonts/android/ subdirs; Xcode and webpack updated to point at new paths
  • Removed: fonts/android/fixes.py (fontforge underline-pos fix, now handled via androidPatches in manifest), update-icon-font / update-web-font yarn scripts, all fontforge/webfonts-generator code from desktop/yarn-helper/font.mts
  • Dev screen: icon browser added under Settings (dev-only) to visually verify font output

navigation: {canGoBack: () => boolean}
}): NativeStackNavigationOptions => ({
...Common.defaultNavigationOptions,
...(Platform.OS === 'ios' ? {contentStyle: {backgroundColor: Kb.Styles.globalColors.whiteOrBlack}} : {}),
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong bg color

… parser

Two bugs in _build_icon_glyph / _draw_svg_path:

1. Transform accumulation walked ancestor <g> elements but ignored
   transform= on the <path> element itself. Unhide and coin-flip SVGs
   carry translate(-1) / translate(-3 -2) on their <path>, not on <g>,
   so the translate was silently skipped, placing those glyphs 1-3px
   right of their intended position and extending past the advance width.
   Fix: start the ancestor walk at elem itself, not its parent.

2. Implicit command repetition in the C/c branch tried to parse
   a command letter as a float when fewer than 6 numbers remained
   before the next command (e.g. "c ... .06 -.119 .109 -.456 s ...").
   The has_nums(n) guard now stops the implicit repeat at command letters.
Some SVGs have content that extends slightly beyond their stated viewBox
(e.g. unhide extends 1px on each side). Scale such glyphs down uniformly
around the horizontal center so they fit cleanly within [0, advance_width].
@chrisnojima chrisnojima merged commit aa96cc1 into nojima/HOTPOT-next-670-clean-2 May 7, 2026
1 check was pending
@chrisnojima chrisnojima deleted the nojima/HOTPOT-font-cleanup branch May 7, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant