Open vv-monsalve opened 3 years ago
Not sure exactly what you mean. Would we expect that the placement of all diacritics have approximately the same height for all glyphs? If so, I think it sounds like an arbitrary restriction. Is that a common practice?
And how would that be detected? Based on the coordinates of the anchor points perhaps?
Please provide more details.
Would we expect that the placement of all diacritics have approximately the same height for all glyphs? If so, I think it sounds like an arbitrary restriction. Is that a common practice?
Yes it is a common practice for all the diacritics in a font to be placed at a similar height, in a range of vertical space above the base letters (e.g. the red guides in the image, the marks above o
are falling from there)
And how would that be detected? Based on the coordinates of the anchor points perhaps?
Usually, this depends on the anchor's position. But, to achieve good diacritics at least three conditions are required:
Having 1 and 2 is necessary but not enough. If the compound glyphs are not created using the components but using different outlines so the position would not be respected.
In the example above the combining marks exist in the file, but they don't have the needed anchors and the letters with diacritics are not using the comb marks.
The tricky thing is that anchors can be placed differently thoughout the set of diacritics, or set of letters, but the accent could be still aligned in the composite. I would say it would necessitate to check the average middle coordinate of the first diacritic in the composites itself, and compare it to the other composites of the same letter. This coordinate could vary in a definite range.
The other tricky thing is that; in the case of a handwriting font, different heights of accents is okay, it gives an irregular feeling proper to handwriting style. So it wouldn't apply all the time.
In the example of Viviana, there is clearly something wrong, but it is difficult to explain because of the irregular essence of the font itself.
ALTHOUGH for more orthogonal fonts, this misalignment should be fixed.
Imo this is one of those checks that needs a human eye. Once computer vision can drive a car autonomously, I guess we can think about it. My worry with implementing this check is all the edge cases as Rosa has pointed out.
Perhaps this could be a proofing doc for gftools gen-html
?
I made a template for my own use to check diacritics, I'll PR to gftools.
Having thought on all of the considerations mentioned by @RosaWagner before is what had prevented me from proposing this check in the past, and I've been human-eye checking it.
However, I still think any of these factors could be considered as something to check from FB in the fonts as (a) they're important things to address in a font, (b) having it checked from the first assessment with FB will prevent to 'finish' a font with this issues, and (c) the users tend to give a good deal of attention to any Fail or Warn reported by FB.
The misalignment diacritics would be a Fail in the more orthogonal fonts and a Warn for handwriting ones. Perhaps it could have a Fail
status with a note in the rationale for handwriting cases or a general Warn
log level result.
AFAIK Fontmake uses glyph anchors to classify whether a glyph is a base glyph or mark glyph, so a font with glyphs not having anchors or not having combining marks should be a Fail
.
It would be helpful that FB could catch this as part of the QA process
Except the condition is not relevant for all scripts. Latin / Greek / Cyrillic maybe -- but not for lots of others.
Reviving this conversation since I am cleaning up the diacritic check summary.
Still agreeing with @vv-monsalve that this could be checked by fontbakery to some extent, in Google Fonts Profile for now. I am sure if other users find a use to it, they would try to find ways to make it more universal.
So for now I would reduce the field of search to GF related stuff, and to most cases we QA:
I would see something like that:
INFO: number of anchors considered to be aligned. Aligned means: >80% of same anchor indexes are sharing the same Y-coordinates (more or less 5 units) in a different glyph categories (Mark, Uppercase, Lowercase, Small Caps).
SKIP if no anchors are considered to be aligned. It means the design is voluntarily irregular.
PASS if all anchors considered to be aligned are all aligned.
WARN Condition: for anchor indexes considered to be aligned. For glyphs in GF Latin sets, WARN if glyph has anchors not aligned. (should report marks and letters)
FAIL For any anchors in font, FAIL if an anchor is completely out of place. For example: in this font family, most anchors are contained in certains ranges, and only 2 are far out of these ranges. No idea what should be threshold here.
Among many of the diacritics requirements, marks are expected to share a position in the Y dimension in a Latin script font, and although especially for orthogonal fonts, this applies even for many script fonts where the x-height is uniform. So each design specifies a region where the marks live.
Currently, the com.google.fonts/check/outline_alignment_miss
check seems to be measuring many Y-coordinates to estimate if some on-curve points are in the expected positions.
This check heuristically looks for on-curve points which are close to, but do not sit on, significant boundary coordinates. For example, a point which has a Y-coordinate of 1 or -1 might be a misplaced baseline point. As well as the baseline, here we also check for points near the x-height (but only for lowercase Latin letters), cap-height, ascender and descender Y coordinates.
And even has the capability of provide detailed information for each case detected
at (U+0040): X=1391.0,Y=2.0 (should be at baseline 0?) Q (U+0051): X=1035.5,Y=1.5 (should be at baseline 0?) f (U+0066): X=541.0,Y=1399.5 (should be at cap-height 1400?) s (U+0073): X=327.5,Y=959.5 (should be at x-height 960?)
Couldn't this be achieved similarly? using the marks-Y-min and marks-Y-top coordinates.
mark glyph
classification of the GDEF
table to check for marks
Observed behaviour
Typically, the diacritic marks in a font should be vertically aligned. When assessing some new fonts to be added, many of them didn't meet this condition.
Expected behaviour
It would be helpful that FB could catch this as part of the QA process
Resources and exact process needed to replicate
Two cases as examples: Alex Brush at commit bd8116b Allison at commit 947e656
Allison pic: