Skip to content

Implement OVERLAP_SIMPLE / OVERLAP_COMPOUND #402

@aaronbell

Description

@aaronbell

I'm not sure if I missed a setting, but it appears that ufo2ft.compileVariableTTF doesn't implement the OVERLAP_SIMPLE / OVERLAP_COMPOUND flag that FreeType relies on to render overlapping paths correctly.

More information on the issue here: microsoft/cascadia-code#350

For Cascadia Code, I adapted this code in my build script to resolve this issue:

def overlapFlag(varFont):
    
    glyf = varFont["glyf"]

    for glyph_name in glyf.keys():
        glyph = glyf[glyph_name]
        # Set OVERLAP_COMPOUND bit for compound glyphs
        if glyph.isComposite():
            glyph.components[0].flags |= 0x400
        # Set OVERLAP_SIMPLE bit for simple glyphs
        elif glyph.numberOfContours > 0:
            glyph.flags[0] |= 0x40
    return varFont

Is this functionality available in ufo2ft? Else, where would be the best place to implement something like this?

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