Skip to content

Character tracking (i.e. letter spacing) is fixed and cannot be adjusted #87

@gabrielsoule

Description

@gabrielsoule

Right now there's no way to add extra space between characters in a string. This is a nice-to-have feature for text rendering: some fonts have weird default letter spacing, and title bars (for example) often look better with extra letter spacing.

JUCE implements this with an withExtraKerningFactor function (which is a little misleading, since it's really doing tracking, but whatever). We should have something similar in Visage.

I have a fix in my own Visage fork that essentially adds a letterSpacing(float spacing) function to the Font object. Then, there's a a few lines of code that inject this extra spacing into the glyph layout logic. It's a very, very simple patch (but as you probably know, text rendering is one of those things that seems simple at from the outside then quickly becomes maddeningly complex).

Anyway, just wondering if you have a long-term plan for more comprehensive text rendering, or if you'd be open to this quick fix... I can submit a PR immediately if you'd be stoked on this fix or I can wait for a later update.

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