Skip to content

Map Korean glyphs syllables-first, and stop RenderText throwing on Hangul - #23

Open
baughj wants to merge 2 commits into
mainfrom
fix/korean-glyph-order
Open

baughj wants to merge 2 commits into
mainfrom
fix/korean-glyph-order

Conversation

@baughj

@baughj baughj commented Sep 19, 2026

Copy link
Copy Markdown
Member
  • Glyph order (d62a5b3): han*.fnt holds the 2,350 syllables at 0–2349 and the 51 jamo at 2350–2400. GetGlyphIndex had them swapped, so syllables drew 51 glyphs late.
  • Exception on Hangul: Encoding.GetEncoding(949) threw NotSupportedException unless the host registered code pages. It now uses CodePagesEncodingProvider.Instance, as MetaFile does.
  • RenderTextKoreanTests reads glyph indexes back from rendered pixels; all five cases fail without both fixes.

Also carries 2bbe155 (2026-08-15): the NuGet package now ships the root README instead of a stale duplicate.

Same order fix as dalib-ts 3.2.0.

🐙 Generated via Imbas imbas@eris.co

baughj and others added 2 commits August 15, 2026 00:19
- DALib/README.md had drifted badly from the root one it duplicated,
  still advertising .NET 8 and a feature list years out of date, and it
  is the file nuget.org renders. Point PackageReadmeFile at the root and
  delete the copy so there is only one to maintain.

Co-Authored-By: Imbas <imbas@eris.co>
…ing on Hangul

Two defects in Graphics.GetGlyphIndex, both reached through RenderText.

The shipped han*.fnt face holds the 2,350 Wansung syllables at glyphs
0-2349 and the 51 Jamo at 2350-2400. The mapping had the blocks the other
way round, so every syllable was drawn 51 glyphs late (한 is glyph 2210 and
came from 2261), and nothing threw, because the wrong mapping covers the
same 2,401 indexes. The indexes were read off the retail face by rendering
it.

Before that could matter, Encoding.GetEncoding(949) threw
NotSupportedException for any Korean character unless the host had
registered the code-pages provider. It now asks
CodePagesEncodingProvider.Instance directly, as MetaFile already does.

RenderTextKoreanTests renders through a synthetic 2,401-glyph face in which
every glyph draws its own index, and reads the index back from the pixels.
Without either fix all five cases fail: first with the exception, then 51
or 2,350 glyphs off.

dalib-ts carries the same order fix in its 3.2.0 release.

Co-Authored-By: Imbas <imbas@eris.co>

This branch was successfully deployed

1 active deployment
deploy — d62a5b37 Deployed Sep 19, 2026 by baughj via build (10.0.x) #79
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