From 70f92ee885e9033f52ee7c85e5b344ba7d357dec Mon Sep 17 00:00:00 2001 From: Koji Ishii Date: Sun, 2 Jan 2022 14:41:35 +0900 Subject: [PATCH] Support narrow/halfwidth forms as the context This patch includes narrow/halfwidth forms as the context of kerning, as long as the target glyph is fullwidth. Fixes issue #38. --- east_asian_spacing/config.py | 6 ++ east_asian_spacing/spacing.py | 65 ++++++++++++------- .../BIZ-UDGothicR.ttc-0.G_P_O_S_.ttx.diff | 8 ++- references/BIZ-UDGothicR.ttc-glyphs | 6 ++ references/BIZ-UDGothicR.ttc.tables.diff | 6 +- .../NotoSansCJK-Bold.ttc-0.G_P_O_S_.ttx.diff | 6 ++ .../NotoSansCJK-Bold.ttc-1.G_P_O_S_.ttx.diff | 6 ++ .../NotoSansCJK-Bold.ttc-2.G_P_O_S_.ttx.diff | 6 ++ .../NotoSansCJK-Bold.ttc-3.G_P_O_S_.ttx.diff | 6 ++ .../NotoSansCJK-Bold.ttc-4.G_P_O_S_.ttx.diff | 6 ++ references/NotoSansCJK-Bold.ttc-glyphs | 6 ++ references/NotoSansCJK-Bold.ttc.tables.diff | 14 ++-- .../NotoSansCJK-Light.ttc-0.G_P_O_S_.ttx.diff | 6 ++ .../NotoSansCJK-Light.ttc-1.G_P_O_S_.ttx.diff | 6 ++ .../NotoSansCJK-Light.ttc-2.G_P_O_S_.ttx.diff | 6 ++ .../NotoSansCJK-Light.ttc-3.G_P_O_S_.ttx.diff | 6 ++ .../NotoSansCJK-Light.ttc-4.G_P_O_S_.ttx.diff | 6 ++ references/NotoSansCJK-Light.ttc-glyphs | 6 ++ references/NotoSansCJK-Light.ttc.tables.diff | 14 ++-- ...otoSansCJK-Regular.ttc-0.G_P_O_S_.ttx.diff | 6 ++ ...otoSansCJK-Regular.ttc-1.G_P_O_S_.ttx.diff | 6 ++ ...otoSansCJK-Regular.ttc-2.G_P_O_S_.ttx.diff | 6 ++ ...otoSansCJK-Regular.ttc-3.G_P_O_S_.ttx.diff | 6 ++ ...otoSansCJK-Regular.ttc-4.G_P_O_S_.ttx.diff | 6 ++ references/NotoSansCJK-Regular.ttc-glyphs | 6 ++ .../NotoSansCJK-Regular.ttc.tables.diff | 14 ++-- references/NotoSansCJKjp-Regular.otf-glyphs | 6 ++ ...otoSansCJKjp-Regular.otf.G_P_O_S_.ttx.diff | 6 ++ .../NotoSansCJKjp-Regular.otf.tables.diff | 6 +- .../NotoSerifCJK-Bold.ttc-0.G_P_O_S_.ttx.diff | 6 ++ references/NotoSerifCJK-Bold.ttc-glyphs | 6 ++ references/NotoSerifCJK-Bold.ttc.tables.diff | 6 +- ...NotoSerifCJK-Light.ttc-0.G_P_O_S_.ttx.diff | 6 ++ references/NotoSerifCJK-Light.ttc-glyphs | 6 ++ references/NotoSerifCJK-Light.ttc.tables.diff | 6 +- ...toSerifCJK-Regular.ttc-0.G_P_O_S_.ttx.diff | 6 ++ references/NotoSerifCJK-Regular.ttc-glyphs | 6 ++ .../NotoSerifCJK-Regular.ttc.tables.diff | 6 +- references/meiryo.ttc-0.G_P_O_S_.ttx.diff | 14 ++++ references/meiryo.ttc-glyphs | 10 +++ references/meiryo.ttc.tables.diff | 6 +- tests/full_test.py | 2 +- 42 files changed, 282 insertions(+), 63 deletions(-) diff --git a/east_asian_spacing/config.py b/east_asian_spacing/config.py index bbe8569..c8fa980 100644 --- a/east_asian_spacing/config.py +++ b/east_asian_spacing/config.py @@ -23,6 +23,12 @@ def __init__(self): self.cjk_colon_semicolon = {0xFF1A, 0xFF1B} self.cjk_exclam_question = {0xFF01, 0xFF1F} + # Narrow/Halfwidth forms do not have internal spacings, + # but they can appear in the context. + # E.g., full-closing should kern if followed by a narrow-closing. + self.narrow_opening = {0x28, 0x5B, 0xFF62} + self.narrow_closing = {0x29, 0x5D, 0xFF63} + # Skip adding the features to fonts with monospace ASCII. self.skip_monospace_ascii = False # Determines the applicability by computing ink bounds. diff --git a/east_asian_spacing/spacing.py b/east_asian_spacing/spacing.py index b15f98d..0605799 100755 --- a/east_asian_spacing/spacing.py +++ b/east_asian_spacing/spacing.py @@ -47,6 +47,11 @@ def __init__(self, self.middle = middle if middle is not None else GlyphDataList() self.space = space if space is not None else GlyphDataList() + # Not-applicable left and right. They are not kerned, but they can + # appear in the context. + self.na_left = GlyphDataList() + self.na_right = GlyphDataList() + self._add_glyphs_count = 0 # For checking purposes. Because this class keeps glyph IDs, using the # same instance for different fonts may lead to unexpected behaviors, @@ -84,6 +89,8 @@ def assert_glyphs_are_disjoint(self): assert self.middle.isdisjoint(self.right) assert self.middle.isdisjoint(self.space) assert self.right.isdisjoint(self.space) + assert self.left.isdisjoint(self.na_left) + assert self.right.isdisjoint(self.na_right) def _to_str(self, glyph_ids=False): name_and_glyph_data_lists = self._name_and_glyph_data_lists @@ -148,6 +155,8 @@ def unite(self, other): self.middle |= other.middle self.right |= other.right self.space |= other.space + self.na_left |= other.na_left + self.na_right |= other.na_right self._all_glyphs |= other._all_glyphs def add_by_ink_part(self, glyphs: Iterable[GlyphData], font): @@ -163,16 +172,11 @@ def add_by_ink_part(self, glyphs: Iterable[GlyphData], font): def ifilter_fullwidth(self, font: Font): em = font.fullwidth_advance - self.left.ifilter_advance(em) - self.right.ifilter_advance(em) + self.left.ifilter_advance(em, self.na_left) + self.right.ifilter_advance(em, self.na_right) self.middle.ifilter_advance(em) self.space.ifilter_advance(em) - def ifilter_ink_part(self): - self.left.ifilter_ink_part(InkPart.LEFT) - self.right.ifilter_ink_part(InkPart.RIGHT) - self.middle.ifilter_ink_part(InkPart.MIDDLE) - async def add_glyphs(self, font, config): self.assert_font(font) config = config.for_font(font) @@ -196,7 +200,7 @@ async def add_glyphs(self, font, config): class _ShapeHelper(object): - def __init__(self, glyph_sets: 'GlyphSets', font, log_name=None): + def __init__(self, glyph_sets: 'GlyphSets', font: Font, log_name=None): self._font = font self._all_glyphs = glyph_sets._all_glyphs self._log_name = log_name @@ -204,12 +208,15 @@ def __init__(self, glyph_sets: 'GlyphSets', font, log_name=None): async def shape(self, unicodes, language=None, + fullwidth=True, temporary=False) -> GlyphDataList: font = self._font text = ''.join(chr(c) for c in unicodes) # Unified code points (e.g., U+2018-201D) in most fonts are Latin glyphs. + features = [] # Enable "fwid" feature to get fullwidth glyphs. - features = ['fwid', 'vert'] if font.is_vertical else ['fwid'] + if fullwidth: features.append('fwid') + if font.is_vertical: features.append('vert') shaper = Shaper(font, language=language, script='hani', @@ -259,11 +266,11 @@ async def ensure_fullwidth_advance(font: Font, config: Config) -> bool: return False async def get_opening_closing(self, font, config): - opening = config.cjk_opening | config.quotes_opening - closing = config.cjk_closing | config.quotes_closing + cjk_opening = config.cjk_opening | config.quotes_opening + cjk_closing = config.cjk_closing | config.quotes_closing shaper = GlyphSets._ShapeHelper(self, font, log_name='opening_closing') left, right, middle, space = await asyncio.gather( - shaper.shape(closing), shaper.shape(opening), + shaper.shape(cjk_closing), shaper.shape(cjk_opening), shaper.shape(config.cjk_middle), shaper.shape(config.fullwidth_space)) trio = GlyphSets(left, right, middle, space) @@ -271,12 +278,20 @@ async def get_opening_closing(self, font, config): # Left/right in vertical should apply only if they have `vert` glyphs. # YuGothic/UDGothic doesn't have 'vert' glyphs for U+2018/201C/301A/301B. horizontal = await self._shape(font.horizontal_font, - opening | closing) + cjk_opening | cjk_closing) trio.left -= horizontal trio.right -= horizontal + else: + assert not trio.na_left + assert not trio.na_right + trio.na_left, trio.na_right = await asyncio.gather( + shaper.shape(config.narrow_closing, fullwidth=False), + shaper.shape(config.narrow_opening, fullwidth=False)) trio.assert_glyphs_are_disjoint() if config.use_ink_bounds: - trio.ifilter_ink_part() + trio.left.ifilter_ink_part(InkPart.LEFT, self.na_left) + trio.right.ifilter_ink_part(InkPart.RIGHT, self.na_right) + trio.middle.ifilter_ink_part(InkPart.MIDDLE) return trio async def get_period_comma(self, font, config): @@ -297,7 +312,9 @@ async def get_period_comma(self, font, config): zht.clear() trio = GlyphSets(ja, None, zht) if config.use_ink_bounds: - trio.ifilter_ink_part() + trio.left.ifilter_ink_part(InkPart.LEFT) + trio.right.ifilter_ink_part(InkPart.RIGHT) + trio.middle.ifilter_ink_part(InkPart.MIDDLE) trio.assert_glyphs_are_disjoint() return trio @@ -418,10 +435,13 @@ def add_from_cache(self, font, glyphs: GlyphDataList) -> GlyphDataList: class PosValues(object): - def __init__(self, font: Font, trio) -> None: - self.left, self.right, self.middle, self.space = ( + def __init__(self, font: Font, glyph_sets: 'GlyphSets') -> None: + glyph_sets.assert_glyphs_are_disjoint() + self.left, self.right, self.middle, self.space, self.na_left, self.na_right = ( tuple(font.glyph_names(sorted(glyphs.glyph_id_set))) - for glyphs in trio._glyph_data_lists) + for glyphs in (glyph_sets.left, glyph_sets.right, + glyph_sets.middle, glyph_sets.space, + glyph_sets.na_left, glyph_sets.na_right)) em = font.fullwidth_advance # When `em` is an odd number, ceil the advance. To do this, use @@ -545,7 +565,7 @@ def _build_single_pos_lookup( return lookup def _build_chws_lookup(self, font: Font, lookups: List[otTables.Lookup], - pos) -> List[int]: + pos: 'GlyphSets.PosValues') -> List[int]: self.assert_font(font) lookup_indices = [] @@ -554,7 +574,7 @@ def _build_chws_lookup(self, font: Font, lookups: List[otTables.Lookup], pair_pos_builder = PairPosBuilder(ttfont, None) pair_pos_builder.addClassPair( None, pos.left, pos.left_value, - pos.left + pos.right + pos.middle + pos.space, None) + pos.left + pos.right + pos.middle + pos.space + pos.na_left, None) lookup = pair_pos_builder.build() assert lookup lookup_indices.append(len(lookups)) @@ -569,8 +589,9 @@ def _build_chws_lookup(self, font: Font, lookups: List[otTables.Lookup], chain_context_pos_builder = ChainContextPosBuilder(ttfont, None) chain_context_pos_builder.rules.append( - ChainContextualRule([pos.right + pos.middle + pos.space], - [pos.right], [], [[single_pos_lookup]])) + ChainContextualRule( + [pos.right + pos.middle + pos.space + pos.na_right], + [pos.right], [], [[single_pos_lookup]])) lookup = chain_context_pos_builder.build() assert lookup lookup_indices.append(len(lookups)) diff --git a/references/BIZ-UDGothicR.ttc-0.G_P_O_S_.ttx.diff b/references/BIZ-UDGothicR.ttc-0.G_P_O_S_.ttx.diff index 3cdac32..cdb11c1 100644 --- a/references/BIZ-UDGothicR.ttc-0.G_P_O_S_.ttx.diff +++ b/references/BIZ-UDGothicR.ttc-0.G_P_O_S_.ttx.diff @@ -1,6 +1,6 @@ @@ + -+ ++ + + + @@ -147,6 +147,8 @@ + + + ++ ++ + + + @@ -185,6 +187,7 @@ + + + ++ + + + @@ -231,6 +234,8 @@ + + + ++ ++ + + + @@ -250,6 +255,7 @@ + + + ++ + + + diff --git a/references/BIZ-UDGothicR.ttc-glyphs b/references/BIZ-UDGothicR.ttc-glyphs index 137fe15..23b3cfd 100644 --- a/references/BIZ-UDGothicR.ttc-glyphs +++ b/references/BIZ-UDGothicR.ttc-glyphs @@ -44,8 +44,14 @@ # 0 U+301B 〛 # 0 U+301E 〞 # 0 U+301A 〚 +# 10 U+0028 ( +# 11 U+0029 ) +# 61 U+005B [ +# 63 U+005D ] # 105 U+FF1F ? # 106 U+FF01 ! +# 12419 U+FF62 「 +# 12420 U+FF63 」 # vertical.left 11951 # U+3001 、 11952 # U+3002 。 diff --git a/references/BIZ-UDGothicR.ttc.tables.diff b/references/BIZ-UDGothicR.ttc.tables.diff index 5f4a792..0f082a5 100644 --- a/references/BIZ-UDGothicR.ttc.tables.diff +++ b/references/BIZ-UDGothicR.ttc.tables.diff @@ -2,7 +2,7 @@ Font 0: "BIZ UDGothic" "Regular" PS="BIZ-UDGothic" Font 1: "BIZ UDPGothic" "Regular" PS="BIZ-UDPGothic" Tag Size -+GPOS 648 [0] ++GPOS 672 [0] GSUB 43,556 [0] GSUB 45,586 [1] OS/2 96 [0] @@ -14,7 +14,7 @@ -Data: 5,027,902 -Gap: 650 -Tables: 24 -+Total: 5,029,202 -+Data: 5,028,550 ++Total: 5,029,226 ++Data: 5,028,574 +Gap: 652 +Tables: 25 diff --git a/references/NotoSansCJK-Bold.ttc-0.G_P_O_S_.ttx.diff b/references/NotoSansCJK-Bold.ttc-0.G_P_O_S_.ttx.diff index 9bb9e98..dc2f744 100644 --- a/references/NotoSansCJK-Bold.ttc-0.G_P_O_S_.ttx.diff +++ b/references/NotoSansCJK-Bold.ttc-0.G_P_O_S_.ttx.diff @@ -710,6 +710,8 @@ + + + ++ ++ + + + @@ -747,6 +749,7 @@ + + + ++ + + + @@ -806,6 +809,8 @@ + + + ++ ++ + + + @@ -824,6 +829,7 @@ + + + ++ + + + diff --git a/references/NotoSansCJK-Bold.ttc-1.G_P_O_S_.ttx.diff b/references/NotoSansCJK-Bold.ttc-1.G_P_O_S_.ttx.diff index 9bb9e98..dc2f744 100644 --- a/references/NotoSansCJK-Bold.ttc-1.G_P_O_S_.ttx.diff +++ b/references/NotoSansCJK-Bold.ttc-1.G_P_O_S_.ttx.diff @@ -710,6 +710,8 @@ + + + ++ ++ + + + @@ -747,6 +749,7 @@ + + + ++ + + + @@ -806,6 +809,8 @@ + + + ++ ++ + + + @@ -824,6 +829,7 @@ + + + ++ + + + diff --git a/references/NotoSansCJK-Bold.ttc-2.G_P_O_S_.ttx.diff b/references/NotoSansCJK-Bold.ttc-2.G_P_O_S_.ttx.diff index 3048d37..2d2668f 100644 --- a/references/NotoSansCJK-Bold.ttc-2.G_P_O_S_.ttx.diff +++ b/references/NotoSansCJK-Bold.ttc-2.G_P_O_S_.ttx.diff @@ -710,6 +710,8 @@ + + + ++ ++ + + + @@ -747,6 +749,7 @@ + + + ++ + + + @@ -806,6 +809,8 @@ + + + ++ ++ + + + @@ -824,6 +829,7 @@ + + + ++ + + + diff --git a/references/NotoSansCJK-Bold.ttc-3.G_P_O_S_.ttx.diff b/references/NotoSansCJK-Bold.ttc-3.G_P_O_S_.ttx.diff index 9bb9e98..dc2f744 100644 --- a/references/NotoSansCJK-Bold.ttc-3.G_P_O_S_.ttx.diff +++ b/references/NotoSansCJK-Bold.ttc-3.G_P_O_S_.ttx.diff @@ -710,6 +710,8 @@ + + + ++ ++ + + + @@ -747,6 +749,7 @@ + + + ++ + + + @@ -806,6 +809,8 @@ + + + ++ ++ + + + @@ -824,6 +829,7 @@ + + + ++ + + + diff --git a/references/NotoSansCJK-Bold.ttc-4.G_P_O_S_.ttx.diff b/references/NotoSansCJK-Bold.ttc-4.G_P_O_S_.ttx.diff index 9bb9e98..dc2f744 100644 --- a/references/NotoSansCJK-Bold.ttc-4.G_P_O_S_.ttx.diff +++ b/references/NotoSansCJK-Bold.ttc-4.G_P_O_S_.ttx.diff @@ -710,6 +710,8 @@ + + + ++ ++ + + + @@ -747,6 +749,7 @@ + + + ++ + + + @@ -806,6 +809,8 @@ + + + ++ ++ + + + @@ -824,6 +829,7 @@ + + + ++ + + + diff --git a/references/NotoSansCJK-Bold.ttc-glyphs b/references/NotoSansCJK-Bold.ttc-glyphs index 21cdf2d..808fd4a 100644 --- a/references/NotoSansCJK-Bold.ttc-glyphs +++ b/references/NotoSansCJK-Bold.ttc-glyphs @@ -52,8 +52,14 @@ # space 1396 # U+3000   # filtered +# 9 U+0028 ( +# 10 U+0029 ) +# 60 U+005B [ +# 62 U+005D ] # 59047 U+FF01 ! # 59077 U+FF1F ? +# 59143 U+FF62 「 +# 59144 U+FF63 」 # vertical.left 58979 # U+FF0C , 58980 # U+3001 、 diff --git a/references/NotoSansCJK-Bold.ttc.tables.diff b/references/NotoSansCJK-Bold.ttc.tables.diff index eea7055..86b9838 100644 --- a/references/NotoSansCJK-Bold.ttc.tables.diff +++ b/references/NotoSansCJK-Bold.ttc.tables.diff @@ -7,11 +7,11 @@ -GPOS 47,590 [2] -GPOS 47,590 [3] -GPOS 47,590 [4] -+GPOS 45,620 [0] -+GPOS 45,620 [1] -+GPOS 45,700 [2] -+GPOS 45,620 [3] -+GPOS 45,620 [4] ++GPOS 45,644 [0] ++GPOS 45,644 [1] ++GPOS 45,724 [2] ++GPOS 45,644 [3] ++GPOS 45,644 [4] GPOS 3,662 [5] GPOS 3,662 [6] GPOS 3,662 [7] @@ -22,7 +22,7 @@ -Total: 20,050,758 -Data: 20,047,931 -Gap: 2,827 -+Total: 20,040,978 -+Data: 20,038,161 ++Total: 20,041,098 ++Data: 20,038,281 +Gap: 2,817 Tables: 57 diff --git a/references/NotoSansCJK-Light.ttc-0.G_P_O_S_.ttx.diff b/references/NotoSansCJK-Light.ttc-0.G_P_O_S_.ttx.diff index 9e8b6a7..62b161e 100644 --- a/references/NotoSansCJK-Light.ttc-0.G_P_O_S_.ttx.diff +++ b/references/NotoSansCJK-Light.ttc-0.G_P_O_S_.ttx.diff @@ -710,6 +710,8 @@ + + + ++ ++ + + + @@ -747,6 +749,7 @@ + + + ++ + + + @@ -806,6 +809,8 @@ + + + ++ ++ + + + @@ -824,6 +829,7 @@ + + + ++ + + + diff --git a/references/NotoSansCJK-Light.ttc-1.G_P_O_S_.ttx.diff b/references/NotoSansCJK-Light.ttc-1.G_P_O_S_.ttx.diff index 9e8b6a7..62b161e 100644 --- a/references/NotoSansCJK-Light.ttc-1.G_P_O_S_.ttx.diff +++ b/references/NotoSansCJK-Light.ttc-1.G_P_O_S_.ttx.diff @@ -710,6 +710,8 @@ + + + ++ ++ + + + @@ -747,6 +749,7 @@ + + + ++ + + + @@ -806,6 +809,8 @@ + + + ++ ++ + + + @@ -824,6 +829,7 @@ + + + ++ + + + diff --git a/references/NotoSansCJK-Light.ttc-2.G_P_O_S_.ttx.diff b/references/NotoSansCJK-Light.ttc-2.G_P_O_S_.ttx.diff index 2041eff..2a33b4b 100644 --- a/references/NotoSansCJK-Light.ttc-2.G_P_O_S_.ttx.diff +++ b/references/NotoSansCJK-Light.ttc-2.G_P_O_S_.ttx.diff @@ -710,6 +710,8 @@ + + + ++ ++ + + + @@ -747,6 +749,7 @@ + + + ++ + + + @@ -806,6 +809,8 @@ + + + ++ ++ + + + @@ -824,6 +829,7 @@ + + + ++ + + + diff --git a/references/NotoSansCJK-Light.ttc-3.G_P_O_S_.ttx.diff b/references/NotoSansCJK-Light.ttc-3.G_P_O_S_.ttx.diff index 9e8b6a7..62b161e 100644 --- a/references/NotoSansCJK-Light.ttc-3.G_P_O_S_.ttx.diff +++ b/references/NotoSansCJK-Light.ttc-3.G_P_O_S_.ttx.diff @@ -710,6 +710,8 @@ + + + ++ ++ + + + @@ -747,6 +749,7 @@ + + + ++ + + + @@ -806,6 +809,8 @@ + + + ++ ++ + + + @@ -824,6 +829,7 @@ + + + ++ + + + diff --git a/references/NotoSansCJK-Light.ttc-4.G_P_O_S_.ttx.diff b/references/NotoSansCJK-Light.ttc-4.G_P_O_S_.ttx.diff index 9e8b6a7..62b161e 100644 --- a/references/NotoSansCJK-Light.ttc-4.G_P_O_S_.ttx.diff +++ b/references/NotoSansCJK-Light.ttc-4.G_P_O_S_.ttx.diff @@ -710,6 +710,8 @@ + + + ++ ++ + + + @@ -747,6 +749,7 @@ + + + ++ + + + @@ -806,6 +809,8 @@ + + + ++ ++ + + + @@ -824,6 +829,7 @@ + + + ++ + + + diff --git a/references/NotoSansCJK-Light.ttc-glyphs b/references/NotoSansCJK-Light.ttc-glyphs index 21cdf2d..808fd4a 100644 --- a/references/NotoSansCJK-Light.ttc-glyphs +++ b/references/NotoSansCJK-Light.ttc-glyphs @@ -52,8 +52,14 @@ # space 1396 # U+3000   # filtered +# 9 U+0028 ( +# 10 U+0029 ) +# 60 U+005B [ +# 62 U+005D ] # 59047 U+FF01 ! # 59077 U+FF1F ? +# 59143 U+FF62 「 +# 59144 U+FF63 」 # vertical.left 58979 # U+FF0C , 58980 # U+3001 、 diff --git a/references/NotoSansCJK-Light.ttc.tables.diff b/references/NotoSansCJK-Light.ttc.tables.diff index dd40071..97f6c29 100644 --- a/references/NotoSansCJK-Light.ttc.tables.diff +++ b/references/NotoSansCJK-Light.ttc.tables.diff @@ -7,11 +7,11 @@ -GPOS 47,386 [2] -GPOS 47,386 [3] -GPOS 47,386 [4] -+GPOS 45,416 [0] -+GPOS 45,416 [1] -+GPOS 45,496 [2] -+GPOS 45,416 [3] -+GPOS 45,416 [4] ++GPOS 45,440 [0] ++GPOS 45,440 [1] ++GPOS 45,520 [2] ++GPOS 45,440 [3] ++GPOS 45,440 [4] GSUB 177,152 [0] GSUB 166,180 [1] GSUB 167,140 [2] @@ -22,7 +22,7 @@ -Total: 18,160,342 -Data: 18,158,928 -Gap: 1,414 -+Total: 18,150,562 -+Data: 18,149,158 ++Total: 18,150,682 ++Data: 18,149,278 +Gap: 1,404 Tables: 37 diff --git a/references/NotoSansCJK-Regular.ttc-0.G_P_O_S_.ttx.diff b/references/NotoSansCJK-Regular.ttc-0.G_P_O_S_.ttx.diff index 9e8b6a7..62b161e 100644 --- a/references/NotoSansCJK-Regular.ttc-0.G_P_O_S_.ttx.diff +++ b/references/NotoSansCJK-Regular.ttc-0.G_P_O_S_.ttx.diff @@ -710,6 +710,8 @@ + + + ++ ++ + + + @@ -747,6 +749,7 @@ + + + ++ + + + @@ -806,6 +809,8 @@ + + + ++ ++ + + + @@ -824,6 +829,7 @@ + + + ++ + + + diff --git a/references/NotoSansCJK-Regular.ttc-1.G_P_O_S_.ttx.diff b/references/NotoSansCJK-Regular.ttc-1.G_P_O_S_.ttx.diff index 9e8b6a7..62b161e 100644 --- a/references/NotoSansCJK-Regular.ttc-1.G_P_O_S_.ttx.diff +++ b/references/NotoSansCJK-Regular.ttc-1.G_P_O_S_.ttx.diff @@ -710,6 +710,8 @@ + + + ++ ++ + + + @@ -747,6 +749,7 @@ + + + ++ + + + @@ -806,6 +809,8 @@ + + + ++ ++ + + + @@ -824,6 +829,7 @@ + + + ++ + + + diff --git a/references/NotoSansCJK-Regular.ttc-2.G_P_O_S_.ttx.diff b/references/NotoSansCJK-Regular.ttc-2.G_P_O_S_.ttx.diff index 2041eff..2a33b4b 100644 --- a/references/NotoSansCJK-Regular.ttc-2.G_P_O_S_.ttx.diff +++ b/references/NotoSansCJK-Regular.ttc-2.G_P_O_S_.ttx.diff @@ -710,6 +710,8 @@ + + + ++ ++ + + + @@ -747,6 +749,7 @@ + + + ++ + + + @@ -806,6 +809,8 @@ + + + ++ ++ + + + @@ -824,6 +829,7 @@ + + + ++ + + + diff --git a/references/NotoSansCJK-Regular.ttc-3.G_P_O_S_.ttx.diff b/references/NotoSansCJK-Regular.ttc-3.G_P_O_S_.ttx.diff index 9e8b6a7..62b161e 100644 --- a/references/NotoSansCJK-Regular.ttc-3.G_P_O_S_.ttx.diff +++ b/references/NotoSansCJK-Regular.ttc-3.G_P_O_S_.ttx.diff @@ -710,6 +710,8 @@ + + + ++ ++ + + + @@ -747,6 +749,7 @@ + + + ++ + + + @@ -806,6 +809,8 @@ + + + ++ ++ + + + @@ -824,6 +829,7 @@ + + + ++ + + + diff --git a/references/NotoSansCJK-Regular.ttc-4.G_P_O_S_.ttx.diff b/references/NotoSansCJK-Regular.ttc-4.G_P_O_S_.ttx.diff index 9e8b6a7..62b161e 100644 --- a/references/NotoSansCJK-Regular.ttc-4.G_P_O_S_.ttx.diff +++ b/references/NotoSansCJK-Regular.ttc-4.G_P_O_S_.ttx.diff @@ -710,6 +710,8 @@ + + + ++ ++ + + + @@ -747,6 +749,7 @@ + + + ++ + + + @@ -806,6 +809,8 @@ + + + ++ ++ + + + @@ -824,6 +829,7 @@ + + + ++ + + + diff --git a/references/NotoSansCJK-Regular.ttc-glyphs b/references/NotoSansCJK-Regular.ttc-glyphs index 21cdf2d..808fd4a 100644 --- a/references/NotoSansCJK-Regular.ttc-glyphs +++ b/references/NotoSansCJK-Regular.ttc-glyphs @@ -52,8 +52,14 @@ # space 1396 # U+3000   # filtered +# 9 U+0028 ( +# 10 U+0029 ) +# 60 U+005B [ +# 62 U+005D ] # 59047 U+FF01 ! # 59077 U+FF1F ? +# 59143 U+FF62 「 +# 59144 U+FF63 」 # vertical.left 58979 # U+FF0C , 58980 # U+3001 、 diff --git a/references/NotoSansCJK-Regular.ttc.tables.diff b/references/NotoSansCJK-Regular.ttc.tables.diff index ee961fb..db4a47e 100644 --- a/references/NotoSansCJK-Regular.ttc.tables.diff +++ b/references/NotoSansCJK-Regular.ttc.tables.diff @@ -7,11 +7,11 @@ -GPOS 47,386 [2] -GPOS 47,386 [3] -GPOS 47,386 [4] -+GPOS 45,416 [0] -+GPOS 45,416 [1] -+GPOS 45,496 [2] -+GPOS 45,416 [3] -+GPOS 45,416 [4] ++GPOS 45,440 [0] ++GPOS 45,440 [1] ++GPOS 45,520 [2] ++GPOS 45,440 [3] ++GPOS 45,440 [4] GPOS 3,662 [5] GPOS 3,662 [6] GPOS 3,662 [7] @@ -22,7 +22,7 @@ -Total: 19,484,782 -Data: 19,481,966 -Gap: 2,816 -+Total: 19,475,002 -+Data: 19,472,196 ++Total: 19,475,122 ++Data: 19,472,316 +Gap: 2,806 Tables: 57 diff --git a/references/NotoSansCJKjp-Regular.otf-glyphs b/references/NotoSansCJKjp-Regular.otf-glyphs index 93b1d98..84a5999 100644 --- a/references/NotoSansCJKjp-Regular.otf-glyphs +++ b/references/NotoSansCJKjp-Regular.otf-glyphs @@ -52,8 +52,14 @@ # space 1396 # U+3000   # filtered +# 9 U+0028 ( +# 10 U+0029 ) +# 60 U+005B [ +# 62 U+005D ] # 59047 U+FF01 ! # 59077 U+FF1F ? +# 59143 U+FF62 「 +# 59144 U+FF63 」 # vertical.left 58979 # U+FF0C , 58980 # U+3001 、 diff --git a/references/NotoSansCJKjp-Regular.otf.G_P_O_S_.ttx.diff b/references/NotoSansCJKjp-Regular.otf.G_P_O_S_.ttx.diff index 9e8b6a7..62b161e 100644 --- a/references/NotoSansCJKjp-Regular.otf.G_P_O_S_.ttx.diff +++ b/references/NotoSansCJKjp-Regular.otf.G_P_O_S_.ttx.diff @@ -710,6 +710,8 @@ + + + ++ ++ + + + @@ -747,6 +749,7 @@ + + + ++ + + + @@ -806,6 +809,8 @@ + + + ++ ++ + + + @@ -824,6 +829,7 @@ + + + ++ + + + diff --git a/references/NotoSansCJKjp-Regular.otf.tables.diff b/references/NotoSansCJKjp-Regular.otf.tables.diff index ddb50c7..a33a03a 100644 --- a/references/NotoSansCJKjp-Regular.otf.tables.diff +++ b/references/NotoSansCJKjp-Regular.otf.tables.diff @@ -3,7 +3,7 @@ DSIG 8 [0] GDEF 28 [0] -GPOS 47,386 [0] -+GPOS 45,416 [0] ++GPOS 45,440 [0] GSUB 177,152 [0] OS/2 96 [0] VORG 920 [0] @@ -14,7 +14,7 @@ -Total: 16,467,736 -Data: 16,467,435 -Gap: 301 -+Total: 16,465,764 -+Data: 16,465,465 ++Total: 16,465,788 ++Data: 16,465,489 +Gap: 299 Tables: 17 diff --git a/references/NotoSerifCJK-Bold.ttc-0.G_P_O_S_.ttx.diff b/references/NotoSerifCJK-Bold.ttc-0.G_P_O_S_.ttx.diff index 7cfb796..826294e 100644 --- a/references/NotoSerifCJK-Bold.ttc-0.G_P_O_S_.ttx.diff +++ b/references/NotoSerifCJK-Bold.ttc-0.G_P_O_S_.ttx.diff @@ -319,6 +319,8 @@ + + + ++ ++ + + + @@ -356,6 +358,7 @@ + + + ++ + + + @@ -415,6 +418,8 @@ + + + ++ ++ + + + @@ -433,6 +438,7 @@ + + + ++ + + + diff --git a/references/NotoSerifCJK-Bold.ttc-glyphs b/references/NotoSerifCJK-Bold.ttc-glyphs index fd2bf16..4a106c8 100644 --- a/references/NotoSerifCJK-Bold.ttc-glyphs +++ b/references/NotoSerifCJK-Bold.ttc-glyphs @@ -52,8 +52,14 @@ # space 1396 # U+3000   # filtered +# 9 U+0028 ( +# 10 U+0029 ) +# 60 U+005B [ +# 62 U+005D ] # 59944 U+FF01 ! # 59974 U+FF1F ? +# 60040 U+FF62 「 +# 60041 U+FF63 」 # vertical.left 59876 # U+FF0C , 59877 # U+3001 、 diff --git a/references/NotoSerifCJK-Bold.ttc.tables.diff b/references/NotoSerifCJK-Bold.ttc.tables.diff index a0c8a65..b59c40f 100644 --- a/references/NotoSerifCJK-Bold.ttc.tables.diff +++ b/references/NotoSerifCJK-Bold.ttc.tables.diff @@ -3,7 +3,7 @@ BASE 240 [0, 1, 2, 3] CFF 23,702,137 [0, 1, 2, 3] -GPOS 56,560 [0, 1, 2, 3] -+GPOS 55,120 [0, 1, 2, 3] ++GPOS 55,144 [0, 1, 2, 3] GSUB 144,778 [0] GSUB 135,100 [1] GSUB 155,736 [2] @@ -14,7 +14,7 @@ -Total: 25,880,240 -Data: 25,879,172 -Gap: 1,068 -+Total: 25,878,798 -+Data: 25,877,732 ++Total: 25,878,822 ++Data: 25,877,756 +Gap: 1,066 Tables: 28 diff --git a/references/NotoSerifCJK-Light.ttc-0.G_P_O_S_.ttx.diff b/references/NotoSerifCJK-Light.ttc-0.G_P_O_S_.ttx.diff index c961267..e1a4630 100644 --- a/references/NotoSerifCJK-Light.ttc-0.G_P_O_S_.ttx.diff +++ b/references/NotoSerifCJK-Light.ttc-0.G_P_O_S_.ttx.diff @@ -319,6 +319,8 @@ + + + ++ ++ + + + @@ -356,6 +358,7 @@ + + + ++ + + + @@ -415,6 +418,8 @@ + + + ++ ++ + + + @@ -433,6 +438,7 @@ + + + ++ + + + diff --git a/references/NotoSerifCJK-Light.ttc-glyphs b/references/NotoSerifCJK-Light.ttc-glyphs index fd2bf16..4a106c8 100644 --- a/references/NotoSerifCJK-Light.ttc-glyphs +++ b/references/NotoSerifCJK-Light.ttc-glyphs @@ -52,8 +52,14 @@ # space 1396 # U+3000   # filtered +# 9 U+0028 ( +# 10 U+0029 ) +# 60 U+005B [ +# 62 U+005D ] # 59944 U+FF01 ! # 59974 U+FF1F ? +# 60040 U+FF62 「 +# 60041 U+FF63 」 # vertical.left 59876 # U+FF0C , 59877 # U+3001 、 diff --git a/references/NotoSerifCJK-Light.ttc.tables.diff b/references/NotoSerifCJK-Light.ttc.tables.diff index 3018cf1..3059002 100644 --- a/references/NotoSerifCJK-Light.ttc.tables.diff +++ b/references/NotoSerifCJK-Light.ttc.tables.diff @@ -3,7 +3,7 @@ BASE 240 [0, 1, 2, 3] CFF 22,478,004 [0, 1, 2, 3] -GPOS 54,988 [0, 1, 2, 3] -+GPOS 53,542 [0, 1, 2, 3] ++GPOS 53,566 [0, 1, 2, 3] GSUB 144,778 [0] GSUB 135,100 [1] GSUB 155,736 [2] @@ -13,7 +13,7 @@ vmtx 259,912 [0, 1, 2, 3] -Total: 24,654,832 -Data: 24,653,775 -+Total: 24,653,386 -+Data: 24,652,329 ++Total: 24,653,410 ++Data: 24,652,353 Gap: 1,057 Tables: 28 diff --git a/references/NotoSerifCJK-Regular.ttc-0.G_P_O_S_.ttx.diff b/references/NotoSerifCJK-Regular.ttc-0.G_P_O_S_.ttx.diff index c961267..e1a4630 100644 --- a/references/NotoSerifCJK-Regular.ttc-0.G_P_O_S_.ttx.diff +++ b/references/NotoSerifCJK-Regular.ttc-0.G_P_O_S_.ttx.diff @@ -319,6 +319,8 @@ + + + ++ ++ + + + @@ -356,6 +358,7 @@ + + + ++ + + + @@ -415,6 +418,8 @@ + + + ++ ++ + + + @@ -433,6 +438,7 @@ + + + ++ + + + diff --git a/references/NotoSerifCJK-Regular.ttc-glyphs b/references/NotoSerifCJK-Regular.ttc-glyphs index fd2bf16..4a106c8 100644 --- a/references/NotoSerifCJK-Regular.ttc-glyphs +++ b/references/NotoSerifCJK-Regular.ttc-glyphs @@ -52,8 +52,14 @@ # space 1396 # U+3000   # filtered +# 9 U+0028 ( +# 10 U+0029 ) +# 60 U+005B [ +# 62 U+005D ] # 59944 U+FF01 ! # 59974 U+FF1F ? +# 60040 U+FF62 「 +# 60041 U+FF63 」 # vertical.left 59876 # U+FF0C , 59877 # U+3001 、 diff --git a/references/NotoSerifCJK-Regular.ttc.tables.diff b/references/NotoSerifCJK-Regular.ttc.tables.diff index 70717a0..8700ebb 100644 --- a/references/NotoSerifCJK-Regular.ttc.tables.diff +++ b/references/NotoSerifCJK-Regular.ttc.tables.diff @@ -3,7 +3,7 @@ BASE 240 [0, 1, 2, 3] CFF 22,633,889 [0, 1, 2, 3] -GPOS 54,756 [0, 1, 2, 3] -+GPOS 53,310 [0, 1, 2, 3] ++GPOS 53,334 [0, 1, 2, 3] GSUB 144,778 [0] GSUB 135,100 [1] GSUB 155,736 [2] @@ -13,7 +13,7 @@ vmtx 259,912 [0, 1, 2, 3] -Total: 24,810,096 -Data: 24,809,036 -+Total: 24,808,650 -+Data: 24,807,590 ++Total: 24,808,674 ++Data: 24,807,614 Gap: 1,060 Tables: 28 diff --git a/references/meiryo.ttc-0.G_P_O_S_.ttx.diff b/references/meiryo.ttc-0.G_P_O_S_.ttx.diff index 894d410..c9593ed 100644 --- a/references/meiryo.ttc-0.G_P_O_S_.ttx.diff +++ b/references/meiryo.ttc-0.G_P_O_S_.ttx.diff @@ -236,10 +236,16 @@ + + + ++ ++ ++ ++ ++ + + + + ++ + + + @@ -277,6 +283,7 @@ + + + ++ + + + @@ -324,6 +331,13 @@ + + + ++ ++ ++ ++ ++ ++ ++ + + + diff --git a/references/meiryo.ttc-glyphs b/references/meiryo.ttc-glyphs index e666cc5..21a5c4a 100644 --- a/references/meiryo.ttc-glyphs +++ b/references/meiryo.ttc-glyphs @@ -44,10 +44,20 @@ # space 1561 # U+3000   # filtered +# 11 U+0028 ( +# 12 U+0029 ) +# 62 U+005B [ +# 64 U+005D ] +# 331 U+0028 ( +# 332 U+0029 ) +# 382 U+005B [ +# 384 U+005D ] # 418 U+2019 ’ # 420 U+2018 ‘ # 430 U+201C “ # 444 U+201D ” +# 1190 U+FF62 「 +# 1191 U+FF63 」 # 1569 U+FF1F ? # 1570 U+FF01 ! # vertical.left diff --git a/references/meiryo.ttc.tables.diff b/references/meiryo.ttc.tables.diff index 80a5953..e9571b8 100644 --- a/references/meiryo.ttc.tables.diff +++ b/references/meiryo.ttc.tables.diff @@ -3,7 +3,7 @@ Tag Size GDEF 54 [0, 1, 2, 3] -GPOS 29,870 [0, 1, 2, 3] -+GPOS 29,790 [0, 1, 2, 3] ++GPOS 29,846 [0, 1, 2, 3] GSUB 57,962 [0, 1] GSUB 45,274 [2, 3] MERG 12 [0, 1, 2, 3] @@ -14,7 +14,7 @@ -Total: 9,516,836 -Data: 9,515,272 -Gap: 1,564 -+Total: 9,516,744 -+Data: 9,515,192 ++Total: 9,516,800 ++Data: 9,515,248 +Gap: 1,552 Tables: 41 diff --git a/tests/full_test.py b/tests/full_test.py index e58b842..8b27704 100644 --- a/tests/full_test.py +++ b/tests/full_test.py @@ -23,7 +23,7 @@ async def test_build_and_diff(test_font_path, refs_dir, tmp_path): out_path = await builder.build_and_save(tmp_path) assert out_path - await builder.test() + await builder.test(smoke=False) # Compute diffs. There should be two, table and GPOS. diff_paths = await Dump.diff_font(out_path, test_font_path, tmp_path)