googlefonts / googlefonts/fontations

`AdjustedMetrics` from `OutlineGlyph::draw` returns 0 adjusted metrics for contourless glyph

Open
#905 2 comments 0 reactions 1 assignee Claimed by @dfrg View on GitHub
Dominant language
Rust
Stars
826
Forks
75
Avg merge
22h 33m
Merged PRs (30d)
75

Description

While testing with Skia, and running `SkParagraph_*` and testing with `DroidSerif.ttf`, executing `OutlineGlyph::draw` returns a `Some(AdjustedMetrics)` return value for the space glyph (gid 3) which contains an adjusted advance set to 0.

In the context of using hinted metrics in Skia, this leads to missing space glyphs. I am not quite sure what the right behavior is here, but we need some form of preserving spaces.

I tend to think returning `None` would be the right call here? Can a glyph that has no contour have phantom points?

In other words:
If hinting metrics is requested, we ask the scaler to provide such. I can fall back to using the unhinted value if the hinted value comes back as 0 while the unhinted value is actually a larger number, but perhaps that is less reliable than indicated through a `None` return value that no hinting adjustment was made on this glyph?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.