Skip to content

Inter Variable rendering incorrectly #369

@sowa705

Description

@sowa705

Hi, i'm trying to render text with the https://rsms.me/inter/ font but the result is not correct.

var fontFamily = fontCollection.Get("Inter Variable");
var font = fontFamily.CreateFont(96, FontStyle.Regular);

var img = new Image<Rgba32>(1960, 180, Rgba32.ParseHex("#FF0000FF"));
img.Mutate(g => {
    var textFont = font;
    var paths = TextBuilder.GenerateGlyphs("Inter variable", new TextOptions(textFont) {
        Origin = new Vector2(980, 90),
        VerticalAlignment = VerticalAlignment.Center,
        HorizontalAlignment = HorizontalAlignment.Center,
        TextAlignment = TextAlignment.Center,
        Font = textFont
    });
    g.Fill(Color.Black, paths);
});

img.Save("test.png");

Resulting image

test

Test environment

SixLabors.Fonts Version="2.0.1"
SixLabors.ImageSharp Version="3.1.1"
SixLabors.ImageSharp.Drawing Version="2.1.0"
OS: Windows 11 x64
Runtime: .NET 8.0.100

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