Skip to content

Commit

Permalink
In the readiness check also check that cmap supports each codepoint.
Browse files Browse the repository at this point in the history
  • Loading branch information
garretrieger committed Oct 31, 2024
1 parent 59f68c2 commit 8eb9984
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ def supported_spans(shaping_unit, ift_font):
shaping_unit.features_at(i),
shaping_unit.design_space_point_at(i))

if not has_unapplied_patches(ift_font, current_subset_def):
if supports_subset_def(ift_font, current_subset_def):
i += 1
continue

Expand All @@ -616,12 +616,12 @@ def supported_spans(shaping_unit, ift_font):
return supported_spans


# Returns true if ift_font has at least one unapplied patch which matches
# subset_def.
def has_unapplied_patches(ift_font, subset_def):
# Implementation: execute the "Extend an Incremental Font Subset" algorithm
# stopping at step 6. If the entry list is not empty then return true.
# Otherwise returns false.
# Returns true if ift_font has support for rendering content covered by subset_def.
def supports_subset_def(ift_font, subset_def):
# Return true only if both of the following two checks are true:
# - Each code point in subset_def is mapped to a glyph id other than '0' by ift_font's cmap table.
# - After executing the "Extend an Incremental Font Subset" algorithm on ift_font with subset_def and stopping at step 6 the
# entry list is empty.
</pre>

Any text from the shaping unit which is not covered by one of the returned spans is not supported by the incremental font and should
Expand Down
14 changes: 7 additions & 7 deletions Overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,7 @@ <h3 class="heading settled" data-level="4.5" id="ift-font-coverage"><span class=
<c- n>shaping_unit</c-><c- o>.</c-><c- n>features_at</c-><c- p>(</c-><c- n>i</c-><c- p>),</c->
<c- n>shaping_unit</c-><c- o>.</c-><c- n>design_space_point_at</c-><c- p>(</c-><c- n>i</c-><c- p>))</c->

<c- k>if</c-> <c- ow>not</c-> <c- n>has_unapplied_patches</c-><c- p>(</c-><c- n>ift_font</c-><c- p>,</c-> <c- n>current_subset_def</c-><c- p>):</c->
<c- k>if</c-> <c- n>supports_subset_def</c-><c- p>(</c-><c- n>ift_font</c-><c- p>,</c-> <c- n>current_subset_def</c-><c- p>):</c->
<c- n>i</c-> <c- o>+=</c-> <c- mi>1</c->
<c- k>continue</c->

Expand All @@ -1334,12 +1334,12 @@ <h3 class="heading settled" data-level="4.5" id="ift-font-coverage"><span class=
<c- k>return</c-> <c- n>supported_spans</c->


<c- c1># Returns true if ift_font has at least one unapplied patch which matches</c->
<c- c1># subset_def.</c->
<c- k>def</c-> <c- nf>has_unapplied_patches</c-><c- p>(</c-><c- n>ift_font</c-><c- p>,</c-> <c- n>subset_def</c-><c- p>):</c->
<c- c1># Implementation: execute the "Extend an Incremental Font Subset" algorithm</c->
<c- c1># stopping at step 6. If the entry list is not empty then return true.</c->
<c- c1># Otherwise returns false.</c->
<c- c1># Returns true if ift_font has support for rendering content covered by subset_def.</c->
<c- k>def</c-> <c- nf>supports_subset_def</c-><c- p>(</c-><c- n>ift_font</c-><c- p>,</c-> <c- n>subset_def</c-><c- p>):</c->
<c- c1># Return true only if both of the following two checks are true:</c->
<c- c1># - Each code point in subset_def is mapped to a glyph id other than '0' by ift_font’s cmap table.</c->
<c- c1># - After executing the "Extend an Incremental Font Subset" algorithm on ift_font with subset_def and stopping at step 6 the</c->
<c- c1># entry list is empty.</c->
</pre>
<p>Any text from the shaping unit which is not covered by one of the returned spans is not supported by the incremental font and should
be rendered with a fallback font. Each span should be shaped in isolation (ie. each span becomes a new shaping unit).
Expand Down

0 comments on commit 8eb9984

Please sign in to comment.