Skip to content

font_resources: Gracefully handle styled Latin codepoints. - #1855

Open
agausmann wants to merge 1 commit into
coredevices:mainfrom
agausmann:styled-codepoints
Open

agausmann wants to merge 1 commit into
coredevices:mainfrom
agausmann:styled-codepoints

Conversation

@agausmann

@agausmann agausmann commented Aug 12, 2026

Copy link
Copy Markdown

Motivated by poor readability of notifications that contain Latin characters from the Unicode blocks "Mathematical Alphanumeric Symbols," "Letterlike Symbols," and "Halfwidth and Fullwidth Forms." These characters are sometimes used as a stylistic choice in user display names and channel names on messaging platforms like Discord, but they do not have glyphs assigned to them.

Before this change, these codepoints would render as the block fallback, making them unreadable. This change handles these codepoints by mapping them to corresponding Latin codepoints if the glyph lookup fails for the original codepoint. By using the plain Latin glyphs, they are at least rendered in a readable way.

One possible alternative is embedding this mapping inside the font data, so that these codepoints map directly to the same glyphs as the plain Latin codepoints. That may be a better solution if possible; I was just more familiar with this part of the code.

This is also not a complete list of "styled" codepoints as I call them. These are just the ones I've encountered myself, but there are others for other languages/scripts, and there may also be some Latin ones that I missed. This system can be extended to handle those in the future, if desired.

@github-actions

Copy link
Copy Markdown

This pull request has been marked as stale because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 7 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions Bot added the stale label Sep 18, 2026
Motivated by poor readability of notifications containing Latin
characters from the blocks "Mathematical Alphanumeric Symbols,"
"Letterlike Symbols," and "Halfwidth and Fullwidth Forms."
These characters are sometimes used as a stylistic choice in user
display names and channel names on messaging platforms like Discord,
but they do not have glyphs assigned to them.

Before this change, these codepoints would render as the block fallback,
making them unreadable. This change handles these codepoints by mapping
them to corresponding Latin codepoints if the glyph lookup fails for the
original codepoint. By using the plain Latin glyphs, they are at least
rendered in a readable way.

One possible alternative is embedding this mapping inside the font data,
so that these codepoints map directly to the same glyphs as the plain
Latin codepoints. That may be a better solution if possible; I was just
more familiar with this part of the code.

This is also not a complete list of "styled" codepoints as I call them.
These are just the ones I've encountered myself, but there are others
for other languages/scripts, and there may also be some Latin ones that
I missed. In my opinion this can be extended to handle those in the
future, if desired.

Signed-off-by: Adam Gausmann <adam@gaussian.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant