Fontbakery: review deprecated check "unique unicode codepoints"

Created on 8 Feb 2019  Â·  9Comments  Â·  Source: googlefonts/fontbakery

com.google.fonts/check/076 was deprecated at https://github.com/googlefonts/fontbakery/commit/56d98a5aa0dbd6faa86eeefb4dd41cd7b63132e9 because it was effectively impossible to FAIL.

I'd like to understand if that was merely an implementation bug and if there is indeed a real world problem that needs that checking routine (thus requiring it to be brought back and bug-fixed).

The check was meant to emit a FAIL in cases where a font had more than one glyph assigned the same unicode codepoint. In a quick chat with Dave it was mentioned that this is indeed something relatively common, but it is not a problem (which makes me believe we don't need a check for that).

P2 Important

Most helpful comment

OT cmap tables can only assign Unicode values to one glyph at a time, but multiple Unicode values can be assigned to the same glyph.

It is common to have multiple Unicode values assigned to one glyph, for example both 0020 and 00A0 assigned to space, but it’s impossible in OTFs to have multiple glyphs assigned the same Unicode value, for example 0020 assigned to space and to nbspace.

In source files, the format may allow multiple glyphs to be assigned the same Unicode value.

All 9 comments

OT cmap tables can only assign Unicode values to one glyph at a time, but multiple Unicode values can be assigned to the same glyph.

It is common to have multiple Unicode values assigned to one glyph, for example both 0020 and 00A0 assigned to space, but it’s impossible in OTFs to have multiple glyphs assigned the same Unicode value, for example 0020 assigned to space and to nbspace.

In source files, the format may allow multiple glyphs to be assigned the same Unicode value.

...yep, but as we're not serving OTFs, it's not really relevant for FB to check, I think.

it’s impossible in OTFs to have multiple glyphs assigned the same Unicode value

How does this work for stylistic alternatives; ie multiple glyph representations for the same Unicode codepoint?

...yep, but as we're not serving OTFs, it's not really relevant for FB to check, I think.

By OTFs I mean TTF/OTFs, their OT cmap is the same.

How does this work for stylistic alternatives; ie multiple glyph representations for the same Unicode codepoint?

The cmap is a Unicode-value keyed dictionary mapping to glyph IDs. Font shapers will request a glyph by Unicode value, then apply substitution to that glyph.

The only problem with multiple encodings was copying/extracting text out of a PDF, which in most cases involves reverse-engineering the characters from _embedded glyph names_ (no kidding). we used to even have identical A.c2sc and a.smcp in fonts to make it work better (no kidding). But extracting text out of PDFs never really worked well anywhere. So, personally, I have given up on that because recreating text from a PDF is broken on so many levels that the ‘fixes’ we can offer inside a font are like fixing a screw on the sinking Titanic.

So, no real problems with double encodings.

thanks, @mekkablue!

We do need to be able to check cff Fonts. GF does serve them, eg for Noto
CJK

@mekkablue said at https://github.com/mekkablue/Glyphs-Scripts/issues/155#issuecomment-462791278: "The script is terribly outdated and should not be used as a reference anymore. I am thinking of pulling it altogether. If someone wants to take it over into their repo and update it, feel free."

Was this page helpful?
0 / 5 - 0 ratings