Skip to content

Commit 8eb9984

Browse files
committed
In the readiness check also check that cmap supports each codepoint.
1 parent 59f68c2 commit 8eb9984

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

Overview.bs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ def supported_spans(shaping_unit, ift_font):
600600
shaping_unit.features_at(i),
601601
shaping_unit.design_space_point_at(i))
602602

603-
if not has_unapplied_patches(ift_font, current_subset_def):
603+
if supports_subset_def(ift_font, current_subset_def):
604604
i += 1
605605
continue
606606

@@ -616,12 +616,12 @@ def supported_spans(shaping_unit, ift_font):
616616
return supported_spans
617617

618618

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

627627
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

Overview.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,7 +1318,7 @@ <h3 class="heading settled" data-level="4.5" id="ift-font-coverage"><span class=
13181318
<c- n>shaping_unit</c-><c- o>.</c-><c- n>features_at</c-><c- p>(</c-><c- n>i</c-><c- p>),</c->
13191319
<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->
13201320

1321-
<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->
1321+
<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->
13221322
<c- n>i</c-> <c- o>+=</c-> <c- mi>1</c->
13231323
<c- k>continue</c->
13241324

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

13361336

1337-
<c- c1># Returns true if ift_font has at least one unapplied patch which matches</c->
1338-
<c- c1># subset_def.</c->
1339-
<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->
1340-
<c- c1># Implementation: execute the "Extend an Incremental Font Subset" algorithm</c->
1341-
<c- c1># stopping at step 6. If the entry list is not empty then return true.</c->
1342-
<c- c1># Otherwise returns false.</c->
1337+
<c- c1># Returns true if ift_font has support for rendering content covered by subset_def.</c->
1338+
<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->
1339+
<c- c1># Return true only if both of the following two checks are true:</c->
1340+
<c- c1># - Each code point in subset_def is mapped to a glyph id other than '0' by ift_font’s cmap table.</c->
1341+
<c- c1># - After executing the "Extend an Incremental Font Subset" algorithm on ift_font with subset_def and stopping at step 6 the</c->
1342+
<c- c1># entry list is empty.</c->
13431343
</pre>
13441344
<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
13451345
be rendered with a fallback font. Each span should be shaped in isolation (ie. each span becomes a new shaping unit).

0 commit comments

Comments
 (0)