Skip to content

Represent composable font family, weight, posture, and capitals #306

Open

Description

@Happypig375

The current FontStyle enum conflates font family, weight, and italic state, while \textsc{\textsl{...}} requires small-capital and slanted requests to compose. Introduce a semantic text-style model with independent axes before registering those commands.

Required axes:

  • family: default/roman/sans-serif/monospace and existing math-specific families;
  • weight: regular/bold;
  • posture: upright/italic/slanted;
  • capitals: normal/small capitals.

Acceptance criteria:

  • Nested style commands update only their own axis and restore the enclosing value after the group.
  • Slanted remains distinct from italic; small capitals can combine with upright, italic, or slanted posture and with weight/family changes.
  • Existing FontStyle public behavior is preserved through a compatibility layer or a separately reviewed migration; no silent enum reinterpretation.
  • Math atoms and TextAtom runs carry the same semantic style information without Unicode substitution at parse time.
  • Canonical serialization chooses the corresponding nested LaTeX commands and survives parse → serialize → parse.
  • Existing roman/bold/italic/sans/mono/math-alphabet and nesting suites remain green, with new equality/clone/state-restoration tests.

This is a prerequisite child of #300. Rendering selection is a separate child so the model change can be reviewed independently.

Activity

  1. added
    Type/Enhancement
    Area/Parsing
    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

No one assigned

    Labels

    Area/ParsingArea/RenderingType/Enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions