Skip to content

Select bold and italic LocalTypefaces for text styles #142

Open

Description

@charlesroddie

When TextPainter.LocalTypefaces contains regular, bold, and italic faces from the same family, \textbf{...} and \textit{...} do not select those faces. The renderer currently changes ordinary Latin letters to Unicode Mathematical Alphanumeric Symbols, so it often falls through to a math font instead of selecting the matching local face.

Implement style-aware local typeface selection before the Mathematical Alphanumeric Symbols fallback.

Acceptance criteria:

  • LocalTypefaces can identify or map regular, bold, italic, and bold-italic faces in a family.
  • \textbf and \textit select the matching local face when it contains the requested glyph.
  • Mathematical Alphanumeric Symbols remain a fallback for math fonts and for families without a requested style.
  • Mixed regular/bold/italic text preserves expected advances and baseline alignment.
  • Tests use redistributable font fixtures and cover missing-style fallback.

The separate inter-glyph spacing/italic-correction problem from the original report is tracked by #32.

Activity

  1. added
    Type/Enhancement
    on Jun 26, 2020
  2. Happypig375 commented on Jun 26, 2020

    @Happypig375
    Collaborator

    The bold and italic fonts do not get used

    The bold and italic glyphs used are in the Unicode range https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols. Fonts should provide glyphs for characters in this range instead of the ASCII range.

  3. added
    Type/Bug
    and removed
    Type/Enhancement
    on Jun 26, 2020
  4. Happypig375 commented on Jun 26, 2020

    @Happypig375
    Collaborator

    Spacing is too large

    Looks like a bug.

  5. Happypig375 commented on Jul 16, 2020

    @Happypig375
    Collaborator

    I assume the FontStyles branch is linked to this bug. Assigned to @charlesroddie.

  6. Happypig375 commented on Feb 13, 2026

    @Happypig375
    Collaborator

    The right solution would be to refactor FontChanger to only use Mathematical Alphanumeric Symbols as a fallback after a reading LocalTypefaces for font styles. Perhaps add an extension point for custom FontStyle to LaTeX command as well.

  7. changed the title [-]Bold and Italic fonts[/-] [+]Bold and italic overrides for LocalTypefaces[/+] on Feb 13, 2026
  8. changed the title [-]Bold and italic overrides for LocalTypefaces[/-] [+]Select bold and italic LocalTypefaces for text styles[/+] on Aug 30, 2026
  9. added
    Type/Enhancement
    and removed
    Type/Bug
    on Aug 30, 2026
  10. Happypig375 commented on Aug 30, 2026

    @Happypig375
    Collaborator

    Triage update: the current implementation confirms this is style-aware font fallback work, not a parser defect. I narrowed the issue to selecting bold/italic LocalTypefaces, changed it to an enhancement, and moved the separate spacing/italic-correction concern to #32.

  11. added
    Area/Rendering
    on Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Area/RenderingType/Enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions