Skip to content

Add Thai notification rendering with GPOS anchors - #1937

Open
ninefyi wants to merge 4 commits into
coredevices:mainfrom
ninefyi:add-thai-locale-th-TH
Open

Add Thai notification rendering with GPOS anchors#1937
ninefyi wants to merge 4 commits into
coredevices:mainfrom
ninefyi:add-thai-locale-th-TH

Conversation

@ninefyi

@ninefyi ninefyi commented Aug 26, 2026

Copy link
Copy Markdown

Summary

Adds Thai locale resources and GPOS-based combining-mark positioning for Sarabun bitmap fonts in notifications.

The implementation stores sparse GPOS anchor metadata in PBF font resources, scales font-unit offsets at runtime, and preserves fallback behavior for fonts or anchors without metadata.

Validation

  • Focused ./pbl test -M test_text_render passes.
  • Thai language-pack generation passes.
  • qemu_emery firmware build passes.
  • obelix@pvt slot 0 and slot 1 firmware builds pass.
  • Thai glyph coverage, general readability for other tested sequences, mixed Thai/Latin rendering, and watch stability pass on physical PT2.

Known limitation

The sequences กี่ and สี่เหลี่ยม still show tone-mark overlap on physical PT2. This PR does not claim complete Thai mark positioning for every combining-mark sequence.

Scope

This change is focused on Thai notification rendering and locale resources. Generated firmware bundles, local planning files, backups, and month-resource experiments are excluded.

Contributor checks

  • Sarabun license and attribution reviewed.
  • Generated code manually reviewed.
  • DCO sign-off present.
  • AI assistance disclosed.

@ninefyi
ninefyi force-pushed the add-thai-locale-th-TH branch 3 times, most recently from 6f39461 to fc6cdb1 Compare August 26, 2026 23:27
ninefyi and others added 4 commits August 29, 2026 08:18
Add font and codepoint resources for a new Thai (th_TH) locale,
following the existing ar_SA/he_IL pattern:

- thai_codepoints.json: the 87 assigned Thai Unicode codepoints
  (U+0E01-U+0E3A, U+0E3F-U+0E5B). Thai-only, no Latin/ASCII, matching
  arabic_codepoints.json's precedent -- mixed-script text falls back
  to the system Latin font via the existing depth-1 fallback chain in
  text_resources.c.
- lang_map.json: GOTHIC_14/18/24/28/36 (+ bold) EXTENDED font entries
  at the same pixel heights as ar_SA, built from Sarabun. BITHAM/
  ROBOTO/DROID_SERIF display fonts left empty, unchanged from base,
  same as other non-Latin locales.
- Sarabun-Regular.ttf / Sarabun-Bold.ttf (SIL OFL 1.1, see LICENSE):
  static per-weight files, needed because Noto Sans Thai on Google
  Fonts ships only as a variable-weight font incompatible with this
  pipeline's per-weight static file expectation.

Verified via `./pbl pack_lang --lang=th_TH`: all 10 font resources
build cleanly with zero glyph errors across the full codepoint set.

Strings (tintin.po) intentionally not included -- translation is
planned to go through Crowdin per CONTRIBUTING.md, not this PR.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Piti Champeethong <piti_fee@hotmail.com>
Add Thai combining-mark classification, GPOS anchor extraction, PBF tooling,

runtime positioning, and focused tests.

Document the font-unit payload contract and add the Thai translation source

and Sarabun font configuration.

Physical PT2 validation remains partial.

The sequences กี่ and สี่เหลี่ยม still show tone-mark overlap.

Co-Authored-By: GitHub Copilot <noreply@github.com>
Signed-off-by: Piti Champeethong <piti_fee@hotmail.com>
Enable Thai locale strings and GPOS anchor extraction for Sarabun

notification fonts.

Keep month-specific resources outside this notification-focused change.

Co-Authored-By: GitHub Copilot <noreply@github.com>
Signed-off-by: Piti Champeethong <piti_fee@hotmail.com>
Apply Ruff formatting to the Thai GPOS font generator and PBF extractor.

Co-Authored-By: GitHub Copilot <noreply@github.com>
Signed-off-by: Piti Champeethong <piti_fee@hotmail.com>
@ninefyi
ninefyi force-pushed the add-thai-locale-th-TH branch from ae28efc to 96701f9 Compare August 29, 2026 00:20
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