Skip to content

norad should not reorder layers #343

@anthrotype

Description

@anthrotype

when norad parses the UFO layers, it reorders them such that the first one is always the default:

norad/src/layer.rs

Lines 88 to 93 in 0b9e433

// move the default layer to the front
let default_idx = layers
.iter()
.position(|l| l.path.to_str() == Some(DEFAULT_GLYPHS_DIRNAME))
.ok_or(FontLoadError::MissingDefaultLayer)?;
layers.rotate_left(default_idx);

However this is incorrect or unwarranted, because the UFO spec never says the default layer should be the first. Font editors may rely on the specific ordering of layers in layercontents.plist (which is deliberately typed as an array and not a dict) for various purposes.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions