fix: hangul filler not working on OTF

This commit is contained in:
minjaesong
2026-03-02 14:12:43 +09:00
parent c299aa8d50
commit c8b197ec01
4 changed files with 12 additions and 1 deletions

1
.gitignore vendored
View File

@@ -20,3 +20,4 @@ OTFbuild/*.otf
OTFbuild/*.woff OTFbuild/*.woff
OTFbuild/*.woff2 OTFbuild/*.woff2
*.fea *.fea
*.xdp-*

Binary file not shown.

View File

@@ -124,6 +124,16 @@ def compose_hangul(assets_dir) -> Dict[int, ExtractedGlyph]:
result[pua] = ExtractedGlyph(pua, GlyphProps(width=w), bm) result[pua] = ExtractedGlyph(pua, GlyphProps(width=w), bm)
variant_count += 1 variant_count += 1
# Ensure jungseong filler PUA variants exist (col=0, rows 15-16).
# The filler has an empty bitmap so extract_hangul_jamo_variants skips
# it, but the vjmo GSUB lookup needs a PUA target to substitute to.
empty_bm = [[0] * cell_w for _ in range(cell_h)]
for row in [15, 16]:
pua = _pua_for_jamo_variant(0, row)
if pua not in result:
result[pua] = ExtractedGlyph(pua, GlyphProps(width=0), empty_bm)
variant_count += 1
print(f" Stored {variant_count} jamo variant glyphs in PUA (0x{HANGUL_PUA_BASE:05X}+)") print(f" Stored {variant_count} jamo variant glyphs in PUA (0x{HANGUL_PUA_BASE:05X}+)")
print(f" Total Hangul glyphs: {len(result)}") print(f" Total Hangul glyphs: {len(result)}")
return result return result

View File

@@ -153,7 +153,7 @@ def _generate_hangul_gsub(glyphs, has, jamo_data):
# Build codepoint lists (standard + extended jamo ranges) # Build codepoint lists (standard + extended jamo ranges)
cho_ranges = list(range(0x1100, 0x115F)) + list(range(0xA960, 0xA97C)) cho_ranges = list(range(0x1100, 0x115F)) + list(range(0xA960, 0xA97C))
jung_ranges = list(range(0x1161, 0x11A8)) + list(range(0xD7B0, 0xD7C7)) jung_ranges = list(range(0x1160, 0x11A8)) + list(range(0xD7B0, 0xD7C7))
jong_ranges = list(range(0x11A8, 0x1200)) + list(range(0xD7CB, 0xD7FC)) jong_ranges = list(range(0x11A8, 0x1200)) + list(range(0xD7CB, 0xD7FC))
cho_cps = [cp for cp in cho_ranges if has(cp)] cho_cps = [cp for cp in cho_ranges if has(cp)]