Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Define handling of COLR when CPAL is missing.
Browse files Browse the repository at this point in the history
rsheeter committed Jan 14, 2021
1 parent 3b8d1e3 commit 0bfb4e4
Showing 1 changed file with 39 additions and 5 deletions.
44 changes: 39 additions & 5 deletions OFF_AMD2_WD.md
Original file line number Diff line number Diff line change
@@ -86,10 +86,10 @@ example, the placement of color stops in a gradient, or the alpha values applied
to colors. The graphic capabilities supported in version 0 and in version 1 are
described in more detail below.

The COLR table is used in combination with the CPAL table (5.7.12): all color
values are specified as entries in color palettes defined in the CPAL table. If
the COLR table is present in a font but no CPAL table exists, then the COLR
table is ignored.
The COLR table can be used in two ways:

1. If a CPAL table (5.7.12) is present the font is a color font whose color values are specified as entries in color palettes defined in the CPAL table.
1. If no CPAL table is present the font is limited to the foreground color. This is ensured by limitations on drawing capability defined in 5.7.11.1.8.3.

**5.7.11.1 Graphic Compositions**

@@ -879,7 +879,7 @@ table would not require the corresponding graph of paint tables to be
re-processed. As a result, using a PaintColrGlyph for re-used graphic components
could provide performance benefits.

**5.7.11.1.8 Glyph metrics and boundedness**
**5.7.11.1.8 Glyph metrics, boundedness, and monochromatic use**

**5.7.11.1.8.1 Metrics for color glyphs using version 0 formats**

@@ -923,6 +923,40 @@ details.
Applications shall confirm that a color glyph definition is bounded, and shall
not render a color glyph if the defining graph is not bounded.

**5.7.11.1.8.3 COLR without CPAL**

If a COLR table is present but there is no CPAL output is limited to
varying the alpha value applied to the foreground color. The following additional limitations shall be imposed:

COLR v0 and v1:

1. The only valid palette index is 0xFFFF (the foreground color)

COLR v1 only:

1. The following composite modes are replaced by COMPOSITE_CLEAR if encountered
* COMPOSITE_SCREEN
* COMPOSITE_OVERLAY
* COMPOSITE_DARKEN
* COMPOSITE_LIGHTEN
* COMPOSITE_COLOR_DODGE
* COMPOSITE_COLOR_BURN
* COMPOSITE_HARD_LIGHT
* COMPOSITE_SOFT_LIGHT
* COMPOSITE_DIFFERENCE
* COMPOSITE_EXCLUSION
* COMPOSITE_MULTIPLY
* COMPOSITE_HSL_HUE
* COMPOSITE_HSL_SATURATION
* COMPOSITE_HSL_COLOR
* COMPOSITE_HSL_LUMINOSITY

This ensures colors other than (foreground + alpha) are unreachable.

NOTE: This is intended to make it possible for a rasterizer that supports
rendering in the foreground color with antialiasing to support COLR without
CPAL even if full color is not supported.

**5.7.11.1.9 Color glyphs as a directed acyclic graph**

When using version 1 formats, a color glyph is defined by a directed, acyclic

0 comments on commit 0bfb4e4

Please sign in to comment.