Closed drj11 closed 2 months ago
I'm booking a videocall with @tphinney later this week to discuss this check, and also to address issues #2857 and #2831.
For now, I've removed the unreachable code and also made the check not emit any advice when uncertain. This will likely improve with an additional PR after my upcoming conversation with Thomas.
While we're on this topic, can we remove the bad-numberOfHMetrics
check: that numberOfHMetrics == 3
which pretty much only makes sense for Courier circa 1995 (given zerowidth marks)
https://github.com/fonttools/fonttools/issues/3014
Observed behaviour
The
PANOSE_expected()
function in https://github.com/fonttools/fontbakery/blob/main/Lib/fontbakery/checks/opentype/name.py is used to dispense advice in the related PANOSE warning when a font appears to be monospaced but does not have its PANOSE info set correctly (and also various other metadata).But looking at this function, we see:
The problem with this code is that the second
if
will never run. The caseif family_type == PANOSE_Family_Type.LATIN_SYMBOL
has already been handled by the previousif
which flows into areturn
.Expected behaviour
I'm guessing, mostly from the presence of
PANOSE Family Type is set to 4
that the condition in the secondif
should be againstPANOSE_Family_Type.LATIN_DECORATIVE
(note DECORATIVE, not SYMBOL), which does indeed have numeric value 4. (see https://monotype.github.io/panose/pan4.htm)If this is correct and the change is made, the recommendation in the string also needs fixing:
latin symbol
->latin decorative
.Although, as someone who is preparing a font that is likely to be both monospaced and decorative, i'm skeptical that the check that uses this is doing anything useful in this case: it would probably be okay to let
LATIN_DECORATIVE
fonts to beseems_monospaced
without having a monospaced indicator in its PANOSE (in so far as i think PANOSE is useful at all).So maybe we could delete that entire arm that checks the
LATIN_DECORATIVE
case (incorrectly).Resources and steps needed to reproduce
I don't have any fonts or tests or other supporting materials for this yet.