[206_19]: Fix Latin Modern Math cannot input "h" in math mode#2865
Merged
da-liii merged 1 commit intoMoganLab:mainfrom Feb 26, 2026
Merged
[206_19]: Fix Latin Modern Math cannot input "h" in math mode#2865da-liii merged 1 commit intoMoganLab:mainfrom
da-liii merged 1 commit intoMoganLab:mainfrom
Conversation
Map lowercase 'h' to U+210E (PLANCK CONSTANT) instead of the unassigned U+1D455 in smart_font_rep::advance(). Add corresponding reverse mapping in init_unicode_substitution(). Fixes MoganLab#2742
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes math-mode input/rendering of lowercase h when using OpenType math fonts like Latin Modern Math by mapping the character to the correct Unicode code point (U+210E) and ensuring reverse substitution remains consistent.
Changes:
- Add a Unicode substitution mapping for U+210E (ℎ) →
'h'underitalic-math. - Special-case
smart_font_rep::advance()to map math italic'h'to U+210E instead of the unassigned U+1D455. - Add a developer note documenting the issue, root cause, and manual test steps.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Graphics/Fonts/smart_font.cpp | Implements the forward mapping (h → U+210E) and adds reverse substitution for U+210E in the Unicode substitution table. |
| devel/206_19.md | Documents the bug, rationale (U+1D455 unassigned), and verification steps. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes #2742
Problem
When the math mode font is set to Latin Modern Math, typing "h" in math mode produces no output.
Root Cause
In
smart_font_rep::advance(), lowercase letters are mapped to Unicode Mathematical Italic codepoints via a simple offset:0x1D44E + (s[0] - 'a'). For 'h', this computes U+1D455 — but U+1D455 is intentionally unassigned in the Unicode standard. The correct math italic small h is at U+210E (PLANCK CONSTANT) in the Letterlike Symbols block. Since Latin Modern Math (and all conforming OpenType Math fonts) has no glyph at U+1D455, the character fails to render.Fix
smart_font_rep::advance()to map 'h' → U+210E instead of the unassigned U+1D455U+210E → 'h'ininit_unicode_substitution()for consistencyHow to Test
Developer document:
devel/206_19.md