[MPEG-OTSPEC] monochrome compositing via COLR w/o CPAL

Peter Constable pconstable at microsoft.com
Fri Dec 22 00:10:37 CET 2023


During the AHG meeting there was mention of the idea of supporting additional compositing modes than 'glyf' currently supports by using a COLR table. The suggestion was that, if there is a COLR table but no CPAL table, then that would be an indication for a rasterizer that it should use the COLR table to get composite glyph descriptions.

It was mentioned that, without a CPAL, there couldn't be an colour references (COLR doesn't have any default colours). That means that various Paint table formats can't be used: Paint(Var)Solid, Paint(Var)LinearGradient, Paint(Var)RadialGradient, and Paint(Var)SweepGradient.

But that leaves several other formats to be supported. It's worth calling out that there's a fair amount more functionality - hence complexity - than 'glyf' composites:


  *   PaintComposite has several compositing modes - the benefit that is the motivation behind this proposal. But note that it also supports several colour blending modes that involve more than Boolean operations on pixel values.
  *   Twenty transform formats (granted, most of these are storage optimizations of a matrix, but they are distinct formats to be parsed)
     *   Paint(Var)Transform, Paint(Var)Translate, Paint(Var)Scale, Paint(Var)ScaleAroundCenter, Paint(Var)ScaleUniform, Paint(Var)ScaleUniformAroundCenter, Paint(Var)Rotate, Paint(Var)RotateAroundCenter, Paint(Var)Skew, Paint(Var)SkewAroundCenter
  *   Layers (PaintColrLayers)
  *   Embedding of glyph descriptions via PaintColrGlyph

Even without colour references a COLR glyph description is still an acyclic directed graph that needs to be walked, with all the available types of operation to be executed.

My initial reaction to the COLR w/o CPAL idea is that there's a fair amount more complexity to be added to monochrome glyph rasterization that might not be desirable for all rasterizer implementations.


After the AHG meeting, it also occurred to me that this proposal would build in a significant limitation for many _colour_ fonts! I think it's fair to assume that most colour fonts are intended to also provide legible monochrome display - i.e., most colour fonts are colour/monochrome hybrids. But in that case, there is a CPAL table present, and so COLR could not be used to provide additional compositing modes for monochrome rendering. IMO, that's a pretty significant limitation that we shouldn't settle for.


Peter


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.aau.at/pipermail/mpeg-otspec/attachments/20231221/1c9c66d6/attachment.html>


More information about the mpeg-otspec mailing list