harfbuzz / boring-expansion-spec

Better-Engineered Font Formats; Part 1. Boring Expansion
79 stars 8 forks source link

[`CFF2`] Deprecate `FontMatrix` #156

Open behdad opened 4 days ago

behdad commented 4 days ago

According to the spec, FontMatrix operand be the identity matrix divided by font UPEM:

FontMatrix uses the reciprocal of unitsPerEm in a specific sequence of operands. For example, if unitsPerEm is 2000, having reciprocal 1/2000 = 0.0005, then FontMatrix must be set to 0.0005 0 0 0.0005 0 0. If unitsPerEm is equal to 1000, then the FontMatrix key may be omitted from the TopDICT.

It is redundant and useless. Just deprecate it. CFF2 is not a standalone font format.

skef commented 4 days ago

I'm not sure what relation this has to VARC purposes, given the almost-always-sufficient default value. The CFF2 FontMatrix is much more restrictive than the CFF FontMatrix, which suggests that someone thought about it and backed off to the current specification (from OpenType): "In the CFF2 table, however, only matrices with uniform horizontal and vertical scaling without translation are permitted, hence the requirement that the 1st and 4th operands be identical and the remaining operands be zero."

Rather than revisiting this could we maybe just require that it be the default when using CFF2 with VARC? (Otherwise I'd have to do some research to figure out why we ended up with this requirement.)

behdad commented 4 days ago

Humm. I'm not sure what this has to do with VARC. The spec makes the value of CFF2 FontMatrix is fully determined from the head.UnitesPerEM.

skef commented 4 days ago

OK, so I guess the question is what the concern is. I could try to track down why things wound up this way in the spec, but (naively) it seems like any font designer can get the result you want by not using the operator. What are you worried about?

behdad commented 4 days ago

but (naively) it seems like any font designer can get the result you want by not using the operator.

I think the spec implies that if upem!=1000, then FontMatrix operator must be present. I like to remove that requirement. No strong opinion here though. I'm happy to close as well.

skef commented 4 days ago

I see, you would prefer to unlink those two parameters.

behdad commented 4 days ago

I see, you would prefer to unlink those two parameters.

Yes, but also make sure there is wording that FontMatrix is ignored and UPEM used to scale glyphs.