Skip to content

Kerning #807

@benoitwimart

Description

@benoitwimart

I try to set a kerning between a A and a V, is it possible ?

    const notdefGlyph = new opentype.Glyph({
            name: '.notdef',
            unicode: 0,
            advanceWidth: 650,
            path: new opentype.Path()
        });

        const pathA = new opentype.Path();
        pathA.moveTo(50, 500); pathA.lineTo(250, 0); pathA.lineTo(450, 500); pathA.moveTo(150, 250); pathA.lineTo(350, 250);
        const glyphA = new opentype.Glyph({ name: 'A', unicode: 'A'.charCodeAt(0), advanceWidth: 500, path: pathA });

        const pathV = new opentype.Path();
        pathV.moveTo(50, 0); pathV.lineTo(250, 500); pathV.lineTo(450, 0);
        const glyphV = new opentype.Glyph({ name: 'V', unicode: 'V'.charCodeAt(0), advanceWidth: 500, path: pathV });

        // and
        const font = new opentype.Font({
            familyName: 'AVFontKerning',
            styleName: 'Regular',
            unitsPerEm: 1000,
            ascender: 800,
            descender: -200,
            glyphs: [notdefGlyph, glyphA, glyphV]
        });

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