Skip to content

Uppercase strings rather than chars for small-caps #25106

Closed
@SimonSapin

Description

@SimonSapin

Currently, font-variant: small-caps is implemented with synthesized small caps: transform the text to upper case and use a smaller font size. gfx::font::glyph_index contains code like codepoint.to_uppercase().next().unwrap() to find the upper case of a single code point. .next().unwrap() takes the first char in the iterator returned by char::to_uppercase and drops the rest.

This is OK at the moment since the iterator always of length 1. But in the future, it will do complex case mapping and may yield more than one char, and the rest should not be dropped. See #23126

The small-caps implementation should probably use str::to_uppercase earlier in the code, before considering individual chars.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions