+
    f7i/ c                  sN&   ^ RI Ht ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
 ^ RIHt ^ RIHt ^ R	IHt ^ R
IHt ^ RIHtHt ^ RI5 ^ RI5 ^ RIHtHt ^ RIHtHt ^ RIHt ^ RI t ^ RI!t!^ RI"t"^ RI#t#^ RI$H%t%H&t& ^ RI'H(t( ^ RI)H*t* Rt+R]+,           R,           t,]#PZ                  ! R4      t.RR lt/]*! ]/].4      ].n0        ]! ]#PZ                  ! R4      R7      t1R t2R t3]! ]Ph                  4      R 4       t5]! ]Ph                  4      R 4       t6]! ]Ph                  4      R 4       t7]! ]Ph                  4      R  4       t8]! ]Pr                  4      R! 4       t5]! ]Pr                  4      R" 4       t:]! ]Pr                  4      RR# l4       t7]! ]Pr                  4      R$ 4       t8]! ]Pv                  4      R% 4       t<]! ]Pv                  4      R& 4       t=]! ]P|                  4      R' 4       t<]! ]P|                  4      R( 4       t=]! ]P~                  4      R) 4       t<]! ]P~                  4      R* 4       t=]! ]P                  4      R+ 4       t<]! ]P                  4      R, 4       t=]! ]P                  4      R- 4       t<]! ]P                  4      R. 4       t=]! ]P                  4      R/ 4       tC]! ]P                  4      R0 4       tE]! ]P                  4      R1 4       t=]! ]P                  4      R2 4       tG]! ]P                  4      R3 4       t=]! ]P                  4      R4 4       tG]! ]P                  4      R5 4       t=]! ]P                  4      R6 4       tE]! ]P                  4      R7 4       tG]! ]P                  4      R8 4       t=]! ]P                  4      R9 4       tG]! ]P                  4      R: 4       t=]! ]P                  4      R; 4       tG]! ]P                  4      R< 4       t=]! ]P                  4      R= 4       tG]! ]Pv                  ]P|                  ]P~                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  4      R> 4       tN]! ]Pv                  ]P|                  ]P~                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  4      R? 4       tO]! ]Pv                  ]P|                  ]P~                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  4	      R@ 4       tG]! ]Pv                  ]P~                  ]P                  4      RA 4       tT]! ]P|                  ]P                  ]P                  ]P                  4      RB 4       tT]! ]P                  ]P                  ]P                  ]P                  4      RC 4       tU]! ]P                  ]P                  4      RD 4       t<]! ]P                  ]P                  ]P                  ]P                  4      RE 4       t=]! ]P                  ]P                  ]P                  ]P                  4      RF 4       tN]! ]P                  ]P                  ]P                  ]P                  4      RG 4       tO]! ]P                  4      RH 4       t<]! ]P                  4      RI 4       tT]! ]P                  ]P                  4      RJ 4       t=]! ]P                  ]P                  4      RK 4       tG]! ]P                  ]P                  4      RL 4       tN]! ]P                  ]P                  4      RM 4       tO]! ]P                  4      RRN l4       t<]! ]P                  4      RO 4       t=]! ]P                  4      RP 4       tG]! ]P                  4      RQ 4       tN]! ]P                  4      RR 4       tO]! ]P                  4      RS 4       tT]! ]P                  4      RT 4       t=]! ]P                  4      RU 4       tG]! ]P                  4      RV 4       tN]! ]P                  4      RW 4       tZ]! ]P                  4      RX 4       t[]! ]P                  4      RY 4       tN]! ]P                  4      RZ 4       tN]! ]P                  4      R[ 4       tO]! ]P                  4      R\ 4       t^]! ]P                  4      R] 4       tN]! ]P                  4      R^ 4       tN]! ]P                  4      R_ 4       tO]! ]P                  4      R` 4       t^]! ]P                  4      Ra 4       ta]! ]P                  4      Rb 4       t^]! ]P                  4      Rc 4       ta]! ]P                  ]P                  4      Rd 4       t^]! ]P                  ]P                  4      Re 4       ta]! ]P                  ]P                  4      Rf 4       td]! ]P                  4      RRg l4       t^]! ]P                  4      RRh l4       ta]! ]P                  4      Ri 4       td]! ]P                  4      Rj 4       t^]! ]P                  4      Rk 4       ta]! ]P                  4      Rl 4       td]! ]P                  ! Rm4      4      Rn 4       t=]! ]P                  ! Ro4      4      Rp 4       t=]! ]P                  ! Rq4      4      Rr 4       t=]! ]P                  ! Rs4      4      Rt 4       t<]! ]P                  ! Rs4      ]P                  ! Ru4      4      Rv 4       t=]! ]P                  ! Rs4      ]P                  ! Ru4      4      Rw 4       th]! ]P                  ! Rs4      ]P                  ! Ru4      4      Rx 4       tN]! ]P                  ! Rs4      ]P                  ! Ru4      4      Ry 4       tZ]! ]P                  ! Rs4      ]P                  ! Ru4      4      RRz l4       ti]! ]P                  ! Rs4      ]P                  ! Ru4      4      R{ 4       tj]! ]P                  ! Rs4      ]P                  ! Ru4      4      R| 4       tk]! ]P                  ! Rs4      ]P                  ! Ru4      4      R} 4       ta]! ]P                  ! Rs4      ]P                  ! Ru4      4      R~ 4       tl]! ]P                  ! Rs4      ]P                  ! Ru4      4      R 4       tm]! ]P                  ! Rs4      ]P                  ! Ru4      4      R 4       tn]! ]P                  ! Rs4      ]P                  ! Ru4      4      R 4       tG]! ]P                  ! R4      4      R 4       t=R to]! ]P                  ! R4      4      R 4       tG]! ]P                  ! R4      4      R 4       tm]! ]P                  ! R4      4      R 4       t=]! ]P                  ! R4      4      R 4       t=]! ]P                  ! R4      4      R 4       t=]! ]P                  ! R4      4      R 4       t=]! ]P                  ! R4      4      R 4       t=]! ]P                  ! R4      4      R 4       t<]! ]P                  ! R4      4      R 4       t=]! ]P                  ! R4      4      R 4       t=]! ]P                  ! R4      4      R 4       tm]! ]P                  ! R4      4      R 4       t=R tp]! ]P                  ! R4      4      R 4       t=]! ]P                  ! R4      4      R 4       t=]! ]P                  ! R4      4      R 4       t=]! ]P                  ! R4      4      R 4       t=]! ]P                  ! R4      4      R 4       tm]! ]P                  ! R4      4      R 4       t=]! ]P                  ! R4      4      R 4       t=R tq]! ]P                  ! R4      4      R 4       t<]! ]P                  ! R4      4      R 4       t=]! ]P                  ! R4      4      R 4       tG]! ]P                  4      R 4       t<]! ]P                  4      R 4       t<]! ]P                  ! R4      4      R 4       t=]! ]P                  ! R4      4      R 4       t<]! ]P                  ! R4      4      R 4       tG]! ]P                  ! R4      4      R 4       t<]! ]P                  4      R 4       t=]! ]P                  4      R 4       t=]! ]P                  4      R 4       t=]! ]P                  4      R 4       t=]! ]P                  4      R 4       t=]! ]P                  ! R4      4      R 4       t=]! ]P                  ! R4      P                  4      R 4       tz]! ]P                  ! R4      4      R 4       t<]! ]P                  ! R4      4      R 4       tm]! ]P                  ! R4      4      R 4       t=]! ]P                  ! R4      4      R 4       tG]! ]P                  ! R4      4      R 4       t<]! ]P                  ! R4      4      R 4       tm]! ]P                  ! R4      4      R 4       t=]! ]P                  ! R4      4      R 4       tm]! ]P                  ! R4      4      R 4       tm0 Rmt{]! ]P                  ! R4      4      R 4       tGR R lt|]! ]P                  ! R4      4      R 4       tG ! R R]}4      t~ ! R R]}4      t]1! R4      RR l4       t]1! R4      R 4       tR tR tR tR t]1! R4      RR l4       t. ROtR# )    )annotations)config)otRound)ttLib)otTables)USE_HARFBUZZ_REPACKER)
maxCtxFont)NullPen)Timer)makeOutputFileName)_add_method
_uniq_sort)*)varStoremultiVarStore)NameRecordVisitormakeName)mirroredN)Counterdefaultdict)reduce)
MethodTypez9fonttools subset font-file [glyph...] [--option=value]...a$  fonttools subset -- OpenType font subsetter and optimizer

fonttools subset is an OpenType font subsetter and optimizer, based on
fontTools. It accepts any TT- or CFF-flavored OpenType (.otf or .ttf)
or WOFF (.woff) font file. The subsetted glyph set is based on the
specified glyphs or characters, and specified OpenType layout features.

The tool also performs some size-reducing optimizations, aimed for using
subset fonts as webfonts.  Individual optimizations can be enabled or
disabled, and are enabled by default when they are safe.

Usage: a9  

At least one glyph or one of --gids, --gids-file, --glyphs, --glyphs-file,
--text, --text-file, --unicodes, or --unicodes-file, must be specified.

Args:

font-file
  The input font file.
glyph
  Specify one or more glyph identifiers to include in the subset. Must be
  PS glyph names, or the special string '*' to keep the entire glyph set.

Initial glyph set specification
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

These options populate the initial glyph set. Same option can appear
multiple times, and the results are accummulated.

--gids=<NNN>[,<NNN>...]
  Specify comma/whitespace-separated list of glyph IDs or ranges as decimal
  numbers.  For example, --gids=10-12,14 adds glyphs with numbers 10, 11,
  12, and 14.

--gids-file=<path>
  Like --gids but reads from a file. Anything after a '#' on any line is
  ignored as comments.

--glyphs=<glyphname>[,<glyphname>...]
  Specify comma/whitespace-separated PS glyph names to add to the subset.
  Note that only PS glyph names are accepted, not gidNNN, U+XXXX, etc
  that are accepted on the command line.  The special string '*' will keep
  the entire glyph set.

--glyphs-file=<path>
  Like --glyphs but reads from a file. Anything after a '#' on any line
  is ignored as comments.

--text=<text>
  Specify characters to include in the subset, as UTF-8 string.

--text-file=<path>
  Like --text but reads from a file. Newline character are not added to
  the subset.

--unicodes=<XXXX>[,<XXXX>...]
  Specify comma/whitespace-separated list of Unicode codepoints or
  ranges as hex numbers, optionally prefixed with 'U+', 'u', etc.
  For example, --unicodes=41-5a,61-7a adds ASCII letters, so does
  the more verbose --unicodes=U+0041-005A,U+0061-007A.
  The special strings '*' will choose all Unicode characters mapped
  by the font.

--unicodes-file=<path>
  Like --unicodes, but reads from a file. Anything after a '#' on any
  line in the file is ignored as comments.

--ignore-missing-glyphs
  Do not fail if some requested glyphs or gids are not available in
  the font.

--no-ignore-missing-glyphs
  Stop and fail if some requested glyphs or gids are not available
  in the font. [default]

--ignore-missing-unicodes [default]
  Do not fail if some requested Unicode characters (including those
  indirectly specified using --text or --text-file) are not available
  in the font.

--no-ignore-missing-unicodes
  Stop and fail if some requested Unicode characters are not available
  in the font.
  Note the default discrepancy between ignoring missing glyphs versus
  unicodes.  This is for historical reasons and in the future
  --no-ignore-missing-unicodes might become default.

Other options
^^^^^^^^^^^^^

For the other options listed below, to see the current value of the option,
pass a value of '?' to it, with or without a '='. In some environments,
you might need to escape the question mark, like this: '--glyph-names\?'.

Examples::

    $ fonttools subset --glyph-names?
    Current setting for 'glyph-names' is: False
    $ fonttools subset --name-IDs=?
    Current setting for 'name-IDs' is: [0, 1, 2, 3, 4, 5, 6]
    $ fonttools subset --hinting? --no-hinting --hinting?
    Current setting for 'hinting' is: True
    Current setting for 'hinting' is: False

Output options
^^^^^^^^^^^^^^

--output-file=<path>
  The output font file. If not specified, the subsetted font
  will be saved in as font-file.subset.

--flavor=<type>
  Specify flavor of output font file. May be 'woff' or 'woff2'.
  Note that WOFF2 requires the Brotli Python extension, available
  at https://github.com/google/brotli

--with-zopfli
  Use the Google Zopfli algorithm to compress WOFF. The output is 3-8 %
  smaller than pure zlib, but the compression speed is much slower.
  The Zopfli Python bindings are available at:
  https://pypi.python.org/pypi/zopfli

--harfbuzz-repacker
  By default, we serialize GPOS/GSUB using the HarfBuzz Repacker when
  uharfbuzz can be imported and is successful, otherwise fall back to
  the pure-python serializer. Set the option to force using the HarfBuzz
  Repacker (raises an error if uharfbuzz can't be found or fails).

--no-harfbuzz-repacker
  Always use the pure-python serializer even if uharfbuzz is available.

Glyph set expansion
^^^^^^^^^^^^^^^^^^^

These options control how additional glyphs are added to the subset.

--retain-gids
  Retain glyph indices; just empty glyphs not needed in-place.

--notdef-glyph
  Add the '.notdef' glyph to the subset (ie, keep it). [default]

--no-notdef-glyph
  Drop the '.notdef' glyph unless specified in the glyph set. This
  saves a few bytes, but is not possible for Postscript-flavored
  fonts, as those require '.notdef'. For TrueType-flavored fonts,
  this works fine as long as no unsupported glyphs are requested
  from the font.

--notdef-outline
  Keep the outline of '.notdef' glyph. The '.notdef' glyph outline is
  used when glyphs not supported by the font are to be shown. It is not
  needed otherwise.

--no-notdef-outline
  When including a '.notdef' glyph, remove its outline. This saves
  a few bytes. [default]

--recommended-glyphs
  Add glyphs 0, 1, 2, and 3 to the subset, as recommended for
  TrueType-flavored fonts: '.notdef', 'NULL' or '.null', 'CR', 'space'.
  Some legacy software might require this, but no modern system does.

--no-recommended-glyphs
  Do not add glyphs 0, 1, 2, and 3 to the subset, unless specified in
  glyph set. [default]

--no-layout-closure
  Do not expand glyph set to add glyphs produced by OpenType layout
  features.  Instead, OpenType layout features will be subset to only
  rules that are relevant to the otherwise-specified glyph set.

--layout-features[+|-]=<feature>[,<feature>...]
  Specify (=), add to (+=) or exclude from (-=) the comma-separated
  set of OpenType layout feature tags that will be preserved.
  Glyph variants used by the preserved features are added to the
  specified subset glyph set. By default, 'calt', 'ccmp', 'clig', 'curs',
  'dnom', 'frac', 'kern', 'liga', 'locl', 'mark', 'mkmk', 'numr', 'rclt',
  'rlig', 'rvrn', and all features required for script shaping are
  preserved. To see the full list, try '--layout-features=?'.
  Use '*' to keep all features.
  Multiple --layout-features options can be provided if necessary.
  Examples:

    --layout-features+=onum,pnum,ss01
        * Keep the default set of features and 'onum', 'pnum', 'ss01'.
    --layout-features-='mark','mkmk'
        * Keep the default set of features but drop 'mark' and 'mkmk'.
    --layout-features='kern'
        * Only keep the 'kern' feature, drop all others.
    --layout-features=''
        * Drop all features.
    --layout-features='*'
        * Keep all features.
    --layout-features+=aalt --layout-features-=vrt2
        * Keep default set of features plus 'aalt', but drop 'vrt2'.

--layout-scripts[+|-]=<script>[,<script>...]
  Specify (=), add to (+=) or exclude from (-=) the comma-separated
  set of OpenType layout script tags that will be preserved. LangSys tags
  can be appended to script tag, separated by '.', for example:
  'arab.dflt,arab.URD,latn.TRK'. By default all scripts are retained ('*').

Hinting options
^^^^^^^^^^^^^^^

--hinting
  Keep hinting [default]

--no-hinting
  Drop glyph-specific hinting and font-wide hinting tables, as well
  as remove hinting-related bits and pieces from other tables (eg. GPOS).
  See --hinting-tables for list of tables that are dropped by default.
  Instructions and hints are stripped from 'glyf' and 'CFF ' tables
  respectively. This produces (sometimes up to 30%) smaller fonts that
  are suitable for extremely high-resolution systems, like high-end
  mobile devices and retina displays.

Optimization options
^^^^^^^^^^^^^^^^^^^^

--desubroutinize
  Remove CFF use of subroutinizes.  Subroutinization is a way to make CFF
  fonts smaller.  For small subsets however, desubroutinizing might make
  the font smaller.  It has even been reported that desubroutinized CFF
  fonts compress better (produce smaller output) WOFF and WOFF2 fonts.
  Also see note under --no-hinting.

--no-desubroutinize [default]
  Leave CFF subroutinizes as is, only throw away unused subroutinizes.

Font table options
^^^^^^^^^^^^^^^^^^

--drop-tables[+|-]=<table>[,<table>...]
  Specify (=), add to (+=) or exclude from (-=) the comma-separated
  set of tables that will be be dropped.
  By default, the following tables are dropped:
  'JSTF', 'DSIG', 'EBDT', 'EBLC', 'EBSC', 'PCLT', 'LTSH'
  and Graphite tables: 'Feat', 'Glat', 'Gloc', 'Silf', 'Sill'.
  The tool will attempt to subset the remaining tables.

  Examples:

  --drop-tables-=BASE
      * Drop the default set of tables but keep 'BASE'.

  --drop-tables+=GSUB
      * Drop the default set of tables and 'GSUB'.

  --drop-tables=DSIG
      * Only drop the 'DSIG' table, keep all others.

  --drop-tables=
      * Keep all tables.

--no-subset-tables+=<table>[,<table>...]
  Add to the set of tables that will not be subsetted.
  By default, the following tables are included in this list, as
  they do not need subsetting (ignore the fact that 'loca' is listed
  here): 'gasp', 'head', 'hhea', 'maxp', 'vhea', 'OS/2', 'loca', 'name',
  'cvt ', 'fpgm', 'prep', 'VMDX', 'DSIG', 'CPAL', 'MVAR', 'cvar', 'STAT'.
  By default, tables that the tool does not know how to subset and are not
  specified here will be dropped from the font, unless --passthrough-tables
  option is passed.

  Example:

   --no-subset-tables+=FFTM
      * Keep 'FFTM' table in the font by preventing subsetting.

--passthrough-tables
  Do not drop tables that the tool does not know how to subset.

--no-passthrough-tables
  Tables that the tool does not know how to subset and are not specified
  in --no-subset-tables will be dropped from the font. [default]

--hinting-tables[-]=<table>[,<table>...]
  Specify (=), add to (+=) or exclude from (-=) the list of font-wide
  hinting tables that will be dropped if --no-hinting is specified.

  Examples:

  --hinting-tables-=VDMX
      * Drop font-wide hinting tables except 'VDMX'.
  --hinting-tables=
      * Keep all font-wide hinting tables (but strip hints from glyphs).

--legacy-kern
  Keep TrueType 'kern' table even when OpenType 'GPOS' is available.

--no-legacy-kern
  Drop TrueType 'kern' table if OpenType 'GPOS' is available. [default]

Font naming options
^^^^^^^^^^^^^^^^^^^

These options control what is retained in the 'name' table. For numerical
codes, see: http://www.microsoft.com/typography/otspec/name.htm

--name-IDs[+|-]=<nameID>[,<nameID>...]
  Specify (=), add to (+=) or exclude from (-=) the set of 'name' table
  entry nameIDs that will be preserved. By default, only nameIDs between 0
  and 6 are preserved, the rest are dropped. Use '*' to keep all entries.

  Examples:

  --name-IDs+=7,8,9
      * Also keep Trademark, Manufacturer and Designer name entries.
  --name-IDs=
      * Drop all 'name' table entries.
  --name-IDs=*
      * keep all 'name' table entries

--name-legacy
  Keep legacy (non-Unicode) 'name' table entries (0.x, 1.x etc.).
  XXX Note: This might be needed for some fonts that have no Unicode name
  entires for English. See: https://github.com/fonttools/fonttools/issues/146

--no-name-legacy
  Drop legacy (non-Unicode) 'name' table entries [default]

--name-languages[+|-]=<langID>[,<langID>]
  Specify (=), add to (+=) or exclude from (-=) the set of 'name' table
  langIDs that will be preserved. By default only records with langID
  0x0409 (English) are preserved. Use '*' to keep all langIDs.

--obfuscate-names
  Make the font unusable as a system font by replacing name IDs 1, 2, 3, 4,
  and 6 with dummy strings (it is still fully functional as webfont).

Glyph naming and encoding options
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

--glyph-names
  Keep PS glyph names in TT-flavored fonts. In general glyph names are
  not needed for correct use of the font. However, some PDF generators
  and PDF viewers might rely on glyph names to extract Unicode text
  from PDF documents.
--no-glyph-names
  Drop PS glyph names in TT-flavored fonts, by using 'post' table
  version 3.0. [default]
--legacy-cmap
  Keep the legacy 'cmap' subtables (0.x, 1.x, 4.x etc.).
--no-legacy-cmap
  Drop the legacy 'cmap' subtables. [default]
--symbol-cmap
  Keep the 3.0 symbol 'cmap'.
--no-symbol-cmap
  Drop the 3.0 symbol 'cmap'. [default]

Other font-specific options
^^^^^^^^^^^^^^^^^^^^^^^^^^^

--recalc-bounds
    Recalculate font bounding boxes.
--no-recalc-bounds
    Keep original font bounding boxes. This is faster and still safe
    for all practical purposes. [default]
--recalc-timestamp
    Set font 'modified' timestamp to current time.
--no-recalc-timestamp
    Do not modify font 'modified' timestamp. [default]
--canonical-order
    Order tables as recommended in the OpenType standard. This is not
    required by the standard, nor by any known implementation.
--no-canonical-order
    Keep original order of font tables. This is faster. [default]
--prune-unicode-ranges
    Update the 'OS/2 ulUnicodeRange*' bits after subsetting. The Unicode
    ranges defined in the OpenType specification v1.7 are intersected with
    the Unicode codepoints specified in the font's Unicode 'cmap' subtables:
    when no overlap is found, the bit will be switched off. However, it will
    *not* be switched on if an intersection is found.  [default]
--no-prune-unicode-ranges
    Don't change the 'OS/2 ulUnicodeRange*' bits.
--prune-codepage-ranges
    Update the 'OS/2 ulCodePageRange*' bits after subsetting.  [default]
--no-prune-codepage-ranges
    Don't change the 'OS/2 ulCodePageRange*' bits.
--recalc-average-width
    Update the 'OS/2 xAvgCharWidth' field after subsetting.
--no-recalc-average-width
    Don't change the 'OS/2 xAvgCharWidth' field. [default]
--recalc-max-context
    Update the 'OS/2 usMaxContext' field after subsetting.
--no-recalc-max-context
    Don't change the 'OS/2 usMaxContext' field. [default]
--font-number=<number>
    Select font number for TrueType Collection (.ttc/.otc), starting from 0.
--pretty-svg
    When subsetting SVG table, use lxml pretty_print=True option to indent
    the XML output (only recommended for debugging purposes).

Application options
^^^^^^^^^^^^^^^^^^^

--verbose
    Display verbose information of the subsetting process.
--timing
    Display detailed timing information of the subsetting process.
--xml
    Display the TTX XML representation of subsetted font.

Example
^^^^^^^

Produce a subset containing the characters ' !"#$%' without performing
size-reducing optimizations::

  $ fonttools subset font.ttf --unicodes="U+0020-0025" \
    --layout-features=* --glyph-names --symbol-cmap --legacy-cmap \
    --notdef-glyph --notdef-outline --recommended-glyphs \
    --name-IDs=* --name-legacy --name-languages=*
zfontTools.subsetc                s   a V P                  R \        V4      4       V'       d8   VP                  4       oV P                  R\        V3R lV 4       4      4       R# R# )zGlyph names: %szGlyph IDs:   %sc              3  6   <"   T F  pSV,          x  K  	  R # 5iN ).0greverseGlyphMap   & @/usr/lib64/python3.14/site-packages/fontTools/subset/__init__.py	<genexpr>Z_log_glyphs.<locals>.<genexpr>  s     +O1OA,>,>   N)infosortedgetReverseGlyphMap)selfglyphsfontr   s   &&&@r   _log_glyphsr'     sF    II0113		#V+O+O%OP     zfontTools.subset.timer)loggerc                s<    V Uu/ uF  q"W,          bK  	  up# u upi r   r   )dr%   r      && r   _dict_subsetr,     s    #$VqtGV$$$s   c                sb    \        V 4      pV Uu. uF  q3V8  g   K  W,          NK  	  up# u upi r   len)lindicescounti   &&  r   _list_subsetr4     s-    FE!/'QYDADD'///s   ,,c                sp    \        V P                  4       UUu. uF  w  r#W19   g   K  VNK  	  upp# u uppi )z3Returns ascending list of matching coverage values.)	enumerater%   )r$   r%   r2   r   r3   r   	intersectr6     s/     $DKK0@0$!AKAA0@@@s   
22c                sB   a \        V3R lV P                   4       4      # )z#Returns set of intersecting glyphs.c              3  s8   <"   T F  qS9   g   K  Vx  K  	  R # 5ir   r   )r   r   r%   r   r   r   Z#intersect_glyphs.<locals>.<genexpr>  s     5+Qfqq+s   
)setr%   )r$   r%      &fr   intersect_glyphsr9     s     5$++555r(   c                s    V P                  V4      pV P                   Uu. uF  q3V9   g   K  VNK  	  upV n        V# u upi )z4Returns ascending list of remaining coverage values.r6   r%   )r$   r%   r0   r   r3   r   subsetr;     s<     nnV$G"kk9k&[11k9DKN :s   ==c                s^    V Uu. uF  q P                   V,          NK  	  upV n         R# u upi )zRemaps coverage.Nr%   )r$   Zcoverage_mapr2   r+   r   remapr=     s%     ,88<a;;q>><8DK8s   *c           	     s"  a  \        \        ;QJ d    V 3R lV 4       F  '       g   K   RM	  RM! V 3R lV 4       4      '       d   ^ .M. S P                  P                  4        UUu. uF  w  r#W!9   g   K  VNK  	  upp,           4      # u uppi )z0Returns ascending list of matching class values.c              3  @   <"   T F  qSP                   9  x  K  	  R # 5ir   	classDefsr   r   r$   r   r   r   Zintersect.<locals>.<genexpr>  s     <VT^^+V   TF)r   anyr@   items)r$   r%   r   vs   f&  r   r6   r6     sk     <V<<V<<<!"--/
?/1;11/
?	@ 
?s   (
B7Bc                s   a aa S^ 8X  d   \        V 3R lS 4       4      # \        VV3R lS P                  P                  4        4       4      # )z%Returns set of glyphs matching class.c              3  sL   <"   T F  qSP                   9  g   K  Vx  K  	  R # 5ir   r?   rA   r   r   r   "intersect_class.<locals>.<genexpr>
  s     @f(?11fs   $
$c              3  sP   <"   T F  w  rVS8X  g   K  VS9   g   K  Vx  K  	  R # 5ir   r   )r   r   rE   r%   klasss   &  r   r   rF     s%     R3TQqEzqa6kqq3s   &&
&)r7   r@   rD   )r$   r%   rG   s   fffr   intersect_classrH     s;     z@f@@@RT^^113RRRr(   c                s  a  S P                   P                  4        UUu/ uF  w  rEWA9   g   K  WEbK  	  uppS n         \        V'       dA   \        ;QJ d    V 3R lV 4       F  '       g   K   RM	  RM! V 3R lV 4       4      '       d   ^ .M. \	        S P                   P                  4       4      ,           4      pV'       d   S P                  V4       V# u uppi )z,Returns ascending list of remaining classes.c              3  r>   r   r?   rA   r   r   r   Zsubset.<locals>.<genexpr>  s     &O1'>rB   TF)r@   rD   r   rC   listvaluesr=   )r$   r%   r=   	useClass0r   rE   r0   s   f&&&   r   r;   r;     s     (,~~';';'=M'=tqdad'=MDN  33&O&O333&O&O#O#O C
t~~$$&
'	(G 

7N Ns
   
CCc                s    V P                   P                  4        UUu/ uF  w  r#W!P                  V4      bK  	  uppV n         R# u uppi )zRemaps classes.N)r@   rD   index)r$   Z	class_mapr   rE   r3   r   r=   r=   "  s:     9=8L8L8NO8Na++8NODNOs   Ac                s   a VP                   P                  V3R  lV P                  P                  4        4       4       R# )c              3  >   <"   T F  w  rVS9   g   K  Vx  K  	  R # 5ir   r   )r   r   rE   
cur_glyphs   &  r   r   !closure_glyphs.<locals>.<genexpr>*  s     J"6$!!z/AA"6   
N)r%   updatemappingrD   r$   srN      &&fr   closure_glyphsrW   (  s&    HHOOJ$,,"4"4"6JJr(   c                s    V P                   P                  4        UUu/ uF+  w  r#W!P                  9   g   K  W1P                  9   g   K)  W#bK-  	  uppV n         \        V P                   4      # u uppi r   )rS   rD   r%   boolr$   rU   r   rE   r3   r   subset_glyphsrZ   -  s[     ++--hh1=-DL s   A-A-	A-c                s    V P                   P                  4        F(  w  r4W29   g   K  VP                  P                  V4       K*  	  R # r   )rS   rD   r%   rR   )r$   rU   rN   glyphZsubst   &&&  r   rW   rW   5  s1    **,HHOOE" -r(   c                sJ  a V P                   P                  4        UUu/ uF\  w  r#VSP                  9   g   K  \        ;QJ d    V3R  lV 4       F  '       d   K   RM	  RM! V3R  lV 4       4      '       g   KZ  W#bK^  	  uppV n         \	        V P                   4      # u uppi )c              3  @   <"   T F  qSP                   9   x  K  	  R # 5ir   r<   )r   subrU   r   r   r    subset_glyphs.<locals>.<genexpr>A  s      >ASArB   FT)rS   rD   r%   allrX   rY   s   &f  r   rZ   rZ   <  s{     LL&&((DA= 	 S >A >SSS >A >> 	(DL
 s   B
BBB;Bc                s   a VP                   P                  ! V3R  lV P                  P                  4        4       !   R# )c              3  rM   r   r   )r   r   vlistrN   rO   r   r   rP   H  s     W,CqJee,CrQ   N)r%   rR   
alternatesrD   rT   rV   r   rW   rW   F  s&    HHOOWDOO,A,A,CWXr(   c                s  a V P                   P                  4        UUUu/ uF~  w  r#VSP                  9   g   K  \        ;QJ d    V3R  lV 4       F  '       g   K   RM	  RM! V3R  lV 4       4      '       g   KZ  Y# Uu. uF  qDSP                  9   g   K  VNK  	  upbK  	  upppV n         \	        V P                   4      # u upi u upppi )c              3  r]   r   r<   )r   rE   rU   r   r   r   r_   P  s      >1ahhrB   TF)rb   rD   r%   rC   rX   )r$   rU   r   ra   rE      &f   r   rZ   rZ   K  s     --//HA= 	/ S > >SSS > >> 	/u.u!QXXAAu../DO
   	 /s4   C
CCC<C CCCCc                s   aa SP                   P                  ! VV3R  lV P                  P                  4        4       !   R# )c              3  s(  <"   T F  w  rVS9   g   K  V Uu. uFe  p\         ;QJ d)    V3R  lVP                   4       F  '       d   K   RM	  RM! V3R  lVP                   4       4      '       g   KY  VP                  NKg  	  upx  K  	  R# u upi 5i)c              3  r]   r   r<   r   crU   r   r   r   +closure_glyphs.<locals>.<genexpr>.<genexpr>Y  s     0V1ahhrB   FTN)r`   	ComponentLigGlyph)r   r   seqsseqrN   rU   s   &   r   r   rP   X  sd      

1J XTWTcSS0V0VSSS0V0V-V\S\\TW1 Xs&   BBBB%B2BBN)r%   rR   	ligaturesrD   rT   s   &ffr   rW   rW   U  s-    HHOO

>>//1

r(   c                s  a V P                   P                  4        UUu/ uF  w  r#VSP                  9   g   K  W#bK  	  uppV n         V P                   P                  4        UUUu/ uF  w  r$TV Uu. uFx  pVP                  SP                  9   g   K   \        ;QJ d)    V3R  lVP
                   4       F  '       d   K   RM	  RM! V3R  lVP
                   4       4      '       g   Kv  VNKz  	  upbK  	  upppV n         V P                   P                  4        UUu/ uF  w  r#V'       g   K  W#bK  	  uppV n         \        V P                   4      # u uppi u upi u upppi u uppi )c              3  r]   r   r<   rd   r   r   r   r_   g  s     /U}!QXX}rB   FT)rk   rD   r%   rh   r`   rg   rX   )r$   rU   r   rE   ri   rj   s   &f    r   rZ   rZ   `  s   '+~~';';'=O'=tqahhdad'=ODN ~~++- .GA 	

||qxx' ,/C/Us}}/UCCC/Us}}/U,U C
 	

 .DN (,~~';';'=C'=tqdad'=CDN P
 DsF   EE&E2E
EE %E*E0EE%/E%Ec                s  a a S P                   ^8X  d   S P                  P                  V4      pV'       dw   \        ;QJ d:    V3R lS P                  S P
                  ,            4       F  '       d   K   RM/	  RM+! V3R lS P                  S P
                  ,            4       4      '       g   R# SP                  P                  V 3R lV 4       4       R# R# )   c              3  Z   <"   T F   pVP                  SP                  4      x  K"  	  R # 5ir   r:   rd   r   r   r   rP   s  s(      "
D KK!!D   (+FTNc              3  sJ   <"   T F  pSP                   V,          x  K  	  R # 5ir   )
Substituter   r2   r$   r   r   r   rP   x  s     <Gq**Gs    #)FormatCoverager6   r`   LookAheadCoverageBacktrackCoverager%   rR   )r$   rU   rN   r0   s   ff& r   rW   rW   o  s    {{a--))*5cc "
++d.D.DD"
ccc "
++d.D.DD"
 
 
 	<G<< r(   c                s  a V P                   ^8X  Eda   V P                  P                  SP                  4      p\	        V P
                  V4      V n        \        V P
                  4       UUu. uF  w  r4VSP                  9   g   K  VNK  	  ppp\	        V P
                  V4      V n        V P                  P                  V4       \        V P
                  4      V n	        \        V P                  ;'       dy    \        ;QJ dB    V3R lV P                  V P                  ,            4       F  '       d   K   R4      # 	  R4      # ! V3R lV P                  V P                  ,            4       4      4      # R# u uppi )rl   c              3  rm   r   r;   r%   rd   r   r   r   r_     s(      HA ""Hrn   FTN)rq   rr   r;   r%   r4   ro   r5   r=   r.   
GlyphCountrX   r`   rs   rt   )r$   rU   r0   r2   r^   rc   r   rZ   rZ   }  s'   {{a--&&qxx0&t@#,T__#=Q#=11#=Q&t@G$doo.OO   //$2H2HH
 	

 	
 //$2H2HH 
 	
  Rs   ,E6E6c                s     V P                   R9   # )rl   rl         )ZDeltaFormatr$      &r   
is_hintingr|     s    y((r(   c                s    R F8  p\        WR4      pVf   K  VP                  4       '       g   K-  \        W4       K:  	  R# )
XPlaDeviceN)r}   Z
YPlaDeviceZ
XAdvDeviceZ
YAdvDevice)getattrr|   Zdelattrr$   namerE      &  r   prune_hintsr     s0    HD%=Q\\^^D Ir(   c                s   V P                   ^8X  d/   \        V P                  P                  VP                  4      4      # V P                   ^8X  d   V P                  P                  VP                  4      pV P
                  p\        V4      pV Uu. uF  qUV8  g   K  W5,          NK  	  upV n        \        V P
                  4      V n        \        V P                  4      # R# u upi rl   N)rq   r.   rr   r;   r%   Value
ValueCountrX   )r$   rU   r0   rJ   r1   r2      &&    r   rZ   rZ     s    {{a4==''122		--&&qxx0F)0>AIifii>
djj/DOO$$ 
 ?s   C#C#c                s\  a  S P                   f   R# S P                  ^8X  dM   VP                  '       g   S P                   P                  4        S P                   P	                  4       S n        MS P                  ^8X  d   R S P                   9   d   M|VP                  '       g$   S P                    F  pVP                  4        K  	  \        \        P                  S P                    Uu. uF  q3P	                  4       NK  	  up^ 4      S n        S P                  ^8X  d   \        ;QJ d)    V 3R lS P                    4       F  '       d   K   RM	  RM! V 3R lS P                    4       4      '       d5   ^S n        S P
                  ^ 8w  d   S P                   ^ ,          MR S n         S =
R# u upi )NTc              3  sN   <"   T F  qSP                   ^ ,          8H  x  K  	  R# 5ir    N)r   )r   rE   r$   r   r   r   Z$prune_post_subset.<locals>.<genexpr>  s     GJqTZZ] 2J   "%F)r   rq   hintingr   getEffectiveFormatZValueFormatr   intZ__or__r`   r   )r$   r&   optionsrE   s   f&& r   prune_post_subsetr     s!   zz {{aJJ""$::88:		4:: ???AMMO $%

TZZHZ113ZH! D
 {{aCCGDJJGCCCGDJJGGG&*&6&6!&;TZZ]
O Is   )F)
c                s   V P                   ^8X  Edm   V P                  P                  VP                  4      pV P                  p\        V4      pV Uu. uF  qUV8  g   K  W5,          NK  	  upV n        V P                   FZ  pVP                   Uu. uF!  qwP                  VP                  9   g   K  VNK#  	  upVn        \        VP                  4      Vn        K\  	  \        V P                  4       UUu. uF  w  rVVP                  '       g   K  VNK  	  pppV P                  P                  V4       \        V P                  V4      V n        \        V P                  4      V n        \        V P                  4      # V P                   ^8X  Ed   V P                  P                  VP                  P                  V P                  P                  4      RR7       Uu. uF  pWP                   8  g   K  VNK  	  p	pV P"                  P                  VP                  RRR7       Uu. uF  pWP$                  8  g   K  VNK  	  p
pV	 Uu. uF  qPP&                  V,          NK  	  upV n        V P&                   F*  pV
 Uu. uF  qXP(                  V,          NK  	  upVn        K,  	  \        V	4      V n        \        V
4      V n        \        V P                   ;'       d=    V P$                  ^8  ;'       d&    V P                  P                  VP                  4      4      # R# u upi u upi u uppi u upi u upi u upi u upi )rl   Tr=   F)r=   rK   N)rq   rr   r;   r%   PairSetr.   PairValueRecordZSecondGlyphZPairValueCountr5   r=   r4   ZPairSetCountrX   Z	ClassDef1intersectionZClass1CountZ	ClassDef2ZClass2CountClass1RecordClass2Record)r$   rU   r0   Zpairsr1   r2   prre   Z
class1_mapZ
class2_maps   &&         r   rZ   rZ     s   {{a--&&qxx0E
*1?'QY'?A,,!,a0I,!A  #1#4#45A	  "+4<<!8M!8A<L<L11!8MG$#DLL':-D%%&&		 ^^**%%dmm&:&:;4 + 
 ###	 A 	 
 ^^**18845*Q
Q### AQ 	 

 <FF:a..q11:F""A9CDAnnQ//DAN #z?z? / /!!A%/ /$$QXX.
 	
' 
 @!
 N


 GDsH   L! L!L&2L&6L+L+L14L1&L6=L6	L;?M c                s   VP                   '       Eg   ^R^R/V P                  ,          w  r4^ ;V n        V n        \	        W4       F  p\	        WT4       F  pVP
                  '       dL   VP
                  P                  4        V ;P                  VP
                  P                  4       ,          un        VP                  '       g   Kt  VP                  P                  4        V ;P                  VP                  P                  4       ,          un        K  	  K  	  \        V P                  V P                  ,          4      # )rl   )r   r   )r   r   )
r   rq   ZValueFormat1ZValueFormat2r~   ZValue1r   r   ZValue2rX   )r$   r&   r   Zattr1Zattr2Zrowr      &&&    r   r   r     s    ???-/
 ++
 121D-4'CS(888HH((*%%)D)D)FF%888HH((*%%)D)D)FF% ) ( !!D$5$5566r(   c                sR   V P                   ^8X  d   V P                  P                  VP                  4      pV P                  p\        V4      pV Uu. uF  qUV8  g   K  W5,          NK  	  upV n        \        V P                  4      V n        \        V P                  4      # R# u upi r   )rq   rr   r;   r%   EntryExitRecordr.   ZEntryExitCountrX   )r$   rU   r0   Zrecordsr1   r2   r   r   rZ   rZ     s    {{a--&&qxx0&&G4;IGq5y


GI!$"6"67D''((   Js   B$B$c                s,   V P                   ^8X  d
   ^V n         R# V P                   ^8X  di   R F9  p\        WR4      pVf   K  VP                  4       '       g   K-  \        WR4       K;  	  V P                  f   V P
                  f
   ^V n         R# R# R# R# )rx   N)XDeviceTableYDeviceTable)rq   r~   r|   setattrr   r   r   r   r   r   r     s~    {{a		4DD)A}D) 5 $):):)BDK *C$ 
r(   c                s   VP                   '       gn   V P                   F]  pVP                  '       d   VP                  P                  4        VP                  '       g   KC  VP                  P                  4        K_  	  R # T)r   r   ZEntryAnchorr   Z
ExitAnchor)r$   r&   r   rec   &&& r   r   r   +  sR    ???''C++-~~~**,	 (
 r(   c                s  aa
 V P                   ^8X  Ed   V P                  P                  VP                  4      p\	        V P
                  P                  V4      V P
                  n        \        V P
                  P                  4      V P
                  n        \        R V P
                  P                   4       4      pV P                  P                  VP                  4      pV P                  P                  o
\        S
4      pV Uau. uFR  oSV8  g   K  \        ;QJ d     V
V3R lV 4       F  '       g   K   RM	  RM! V
V3R lV 4       4      '       g   KP  SNKT  	  ppV'       g   R# V P                  P                  V4       \	        V P                  P                  V4      V P                  n        \        V P                  P                  4      V P                  n        \        V4      V n        V P
                  P                   F#  pVP%                  VP&                  4      Vn        K%  	  V P                  P                   F  p	\	        V	P(                  V4      V	n        K   	  \+        V P"                  ;'       d5    V P
                  P                  ;'       d    V P                  P                   4      # R# u upi )rl   c              3  8   "   T F  qP                   x  K  	  R # 5ir   Classr   rE      & r   r   r_   >       "N4Mq774M   c              3  s\   <"   T F!  pSS,          P                   V,          R Jx  K#  	  R # 5ir   )
BaseAnchor)r   jbase_recordsr2      & r   r   r_   G  s%     U}!LO..q1=}   ),TFN)rq   MarkCoverager;   r%   r4   	MarkArray
MarkRecordr.   	MarkCountr   ZBaseCoverager6   	BaseArray
BaseRecordrC   r=   Z	BaseCount
ClassCountrL   r   r   rX   )r$   rU   mark_indicesclass_indicesZintersect_base_indicesZnum_base_recordsr2   Zbase_indicesmbr      &&    `   @r   rZ   rZ   6  s   {{a((//9$0NN%%|%
! $'t~~'@'@#A ""NDNN4M4M"NN!%!2!2!<!<QXX!F~~00|, ,
+##  U}UU}UU A+ 	 
 -$0NN%%|%
! $'t~~'@'@#A m,**A#))!''2AG +**A'mDAL +OOUU 8 8UUT^^=U=U
 	
? 
   	J<
J<!J<9J<J<c                sT   VP                   '       g   V P                  P                   F1  pVP                  '       g   K  VP                  P	                  4        K3  	  V P
                  P                   F0  pVP                   F  pV'       g   K  VP	                  4        K  	  K2  	  R # r   )r   r   r   
MarkAnchorr   r   r   r   )r$   r&   r   r   r   as   &&&   r   r   r   ^  so    ???**A|||((* + **A\\1MMO " + r(   c                s   a V P                   ^8X  Ed   V P                  P                  VP                  4      p\	        V P
                  P                  V4      V P
                  n        \        V P
                  P                  4      V P
                  n        \        R V P
                  P                   4       4      oV P                  P                  VP                  4      pV P                  P                  pV P                  P                  pV Uu. uFo  pWe8  g   K  \        ;QJ d/    V3R lWF,          P                    4       F  '       g   K   RM$	  RM ! V3R lWF,          P                    4       4      '       g   Km  VNKq  	  ppV'       g   R# V P                  P#                  V4       \	        V P                  P                  V4      V P                  n        \        V P                  P                  4      V P                  n        \        S4      V n        V P
                  P                   F#  pSP'                  VP(                  4      Vn        K%  	  V P                  P                   F7  p	V	f   K	  V	P                    F  p
\	        V
P*                  S4      V
n        K   	  K9  	  \-        V P$                  ;'       d5    V P
                  P                  ;'       d    V P                  P                  4      # R# u upi )rl   c              3  r   r   r   r   r   r   r   r_   s  r   r   c              3  s   <a"   T F?  o\         ;QJ d    V3R  lS 4       F  '       g   K   RM	  RM! V3R  lS 4       4      x  KA  	  R# 5i)c              3  sN   <"   T F  pSP                   V,          R Jx  K  	  R # 5ir   )LigatureAnchor)r   r   	componentr   r   r   *subset_glyphs.<locals>.<genexpr>.<genexpr>~  s!     S]I,,Q/t;]r   TFN)rC   )r   r   r   s   &@r   r   r_   }  s6      !BI S]SS]SSS!Bs   AA ATFN)rq   r   r;   r%   r4   r   r   r.   r   r   ZLigatureCoverager6   LigatureArrayLigatureAttachZLigatureCountrC   ComponentRecordr=   r   rL   r   r   rX   )r$   rU   r   Zintersect_ligature_indicesZligature_arrayZnum_ligaturesr2   Zligature_indicesr   r/   re   r   s   &&         @r   rZ   rZ   k  sW   {{a((//9$0NN%%|%
! $'t~~'@'@#A ""NDNN4M4M"NN%)%:%:%D%DQXX%N"++::**88 0
/    !/!2!B!B !/!2!B!B  A/ 	 
  ##$45,8--/?-
) ,/t/A/A/P/P+Q(m,**A#))!''2AG +##22Ay&&#/0@0@-#P  ' 3
 OO 1 1((1 1""00
 	
O 
s   K;
K;)$K;+K; K;c                s   VP                   '       g   V P                  P                   F1  pVP                  '       g   K  VP                  P	                  4        K3  	  V P
                  P                   FI  pVf   K	  VP                   F0  pVP                   F  pV'       g   K  VP	                  4        K  	  K2  	  KK  	  R# NT)	r   r   r   r   r   r   r   r   r   )r$   r&   r   r   r/   re   r   r   r   r   r     s    ???**A|||((* + ##22Ay&&))Aq * ' 3 r(   c                s  aa
 V P                   ^8X  Ed   V P                  P                  VP                  4      p\	        V P
                  P                  V4      V P
                  n        \        V P
                  P                  4      V P
                  n        \        R V P
                  P                   4       4      pV P                  P                  VP                  4      pV P                  P                  o
\        S
4      pV Uau. uFR  oSV8  g   K  \        ;QJ d     VV
3R lV 4       F  '       g   K   RM	  RM! VV
3R lV 4       4      '       g   KP  SNKT  	  ppV'       g   R# V P                  P                  V4       \	        V P                  P                  V4      V P                  n        \        V P                  P                  4      V P                  n        \        V4      V n        V P
                  P                   F#  pVP#                  VP$                  4      Vn        K%  	  V P                  P                   F  p	\	        V	P&                  V4      V	n        K   	  \)        V P                   ;'       d5    V P
                  P                  ;'       d    V P                  P                  4      # R# u upi )rl   c              3  r   r   r   r   r   r   r   r_     s     "O4Nq774Nr   c              3  s\   <"   T F!  pSS,          P                   V,          R Jx  K#  	  R # 5ir   )Mark2Anchor)r   r   r2   mark2_recordsr   r   r   r_     s&     WAM!$0034?r   TFN)rq   ZMark1Coverager;   r%   r4   
Mark1Arrayr   r.   r   r   ZMark2Coverager6   
Mark2ArrayMark2RecordrC   r=   r   rL   r   r   rX   )r$   rU   Zmark1_indicesr   Zintersect_mark2_indicesZnum_mark2_recordsr2   Zmark2_indicesr   r   r   r   r   rZ   rZ     s   {{a**11!((;%1OO&&&
" %((B(B$C!""ODOO4N4N"OO"&"4"4">">qxx"H33. -
,$$  WWWWW A, 	 
   /&2OO'''
# %((C(C$D!m,++A#))!''2AG ,,,A(FAM -OOWW 9 9WWdoo>W>W
 	
? 
r   c                sT   VP                   '       g   V P                  P                   F1  pVP                  '       g   K  VP                  P	                  4        K3  	  V P
                  P                   F0  pVP                   F  pV'       g   K  VP	                  4        K  	  K2  	  R # r   )r   r   r   r   r   r   r   r   )r$   r&   r   r   r   r\   r   r   r     so    ???++A|||((* , ,,A]]1MMO # - r(   c                    R # r   r   r$   lookup_indices   &&r   subset_lookupsr     s     	r(   c                s    . # r   r   rz   r{   r   collect_lookupsr     s	     Ir(   c                r   r   r   r$   r&   r      &&&r   r   r     s     r(   c                r   Fr   rz   r{   r   may_have_non_1to1r     s     r(   c                r   r   r   rz   r{   r   r   r     s     r(   c                s    ! R  R\         4      pV P                  R9  d   R# \        V P                  R4      '       g   / V P                  n        V P                  V P                  P                  9  d@   V! V P                  V P                  4      pW P                  P                  V P                  &   V P                  P                  V P                  ,          # )c                  s    ] tR tRtR tRtR# )0__subset_classify_context.<locals>.ContextHelperi+  c                	s\   VP                   P                  R 4      '       d   RpR pMRpRpVP                   P                  R4      '       d   Rp^p^pMRp^ p^pWS,           pW0n        W@n        WPn        Wn        W`n        Wpn        VR,           V n	        V^8X  d   R p	R p
R pR	 pR
pR
pR pR pR pR pMGV^8X  d    R p	R p
R pR pR pR pR pR pR pR pM!V^8X  d   R p	R p
R
pR
pR
pR
pR pR pR pR pV'       d%   X
V n
        XV n        XV n        XV n        XV n        M#X	V n
        XV n        XV n        XV n        XV n        V^8X  dC   VR,           V n        VR ,           V n        VR!,           V n        VR",           V n        R# V n        R
# V^8X  dv   VR$,           V n        VR%,           V n        VR&,           V n        VR',           V n        R( V n        V'       d   R)MR*V n        V'       d   ^M^ V n        V'       d   R+MR,V n        R
# V^8X  d   V'       d   R-MR.V n        R
# R
# )/ZSubstZSubZPosChain LookupRecordc                    V P                   # r   rr   r   r{   r   <lambda>K__subset_classify_context.<locals>.ContextHelper.__init__.<locals>.<lambda>G      QZZr(   c                r   r   r   r   r{   r   r   r   H      !**r(   c                    R# )Nr   r   r   r{   r   r   r   I  s    r(   c                r   )N)NNNr   r   r{   r   r   r   J  s    -?r(   Nc                    V P                   3# r   )Inputr   r{   r   r   r   M  
    aggZr(   c                H    V P                   V P                  V P                  3# r   	Backtrackr   	LookAheadr   r{   r   r   r   N      1;;*Mr(   c                8    Vw  V n         R  V 4       w  V n        R# )c              3  F   "   T F  p\        V4      ^,           x  K  	  R# 5ir   r-   r   xr   r   r   a__subset_classify_context.<locals>.ContextHelper.__init__.<locals>.SetRuleData.<locals>.<genexpr>R       &=1as1vzz1   !N)r   rv   r   r*   r   r   SetRuleDataN__subset_classify_context.<locals>.ContextHelper.__init__.<locals>.SetRuleDataP      !"JQW&=1&=OQ\r(   c                    Vw  V n         V n        V n        \        V^ ,          4      \        V^,          4      ^,           \        V^,          4      uV n        V n        V n        R# r   r   r   r   r.   BacktrackGlyphCountInputGlyphCountLookAheadGlyphCountr   r   r   ChainSetRuleDataS__subset_classify_context.<locals>.ContextHelper.__init__.<locals>.ChainSetRuleDataT  P    :;7Q[!'1;
 QqTC!IM3qt9	-)-r(   c                r   r   r   r   r{   r   r   r   ]  r   r(   c                r   r   r   r   r{   r   r   r   ^  r   r(   c                r   r   ClassDefr   r{   r   r   r   _  s
    r(   c                r   r   ZBacktrackClassDefInputClassDefZLookAheadClassDefr   r{   r   r   r   `  s     ''OO''.r(   c                s    Vw  V n         R # r   r   r   r   r   SetContextDataZQ__subset_classify_context.<locals>.ContextHelper.__init__.<locals>.SetContextDataf  s    $%MQZr(   c                s0    Vw  V n         V n        V n        R # r   r   r   r   r   SetChainContextDataZV__subset_classify_context.<locals>.ContextHelper.__init__.<locals>.SetChainContextDatai  s    RSOQ(!/1;Nr(   c                r   r   r   r   r{   r   r   r   l  r   r(   c                r   r   r   r   r{   r   r   r   m  r   r(   c                r   )c              3  r   r   r-   r   r   r   r   r   q  r   r   N)r   rv   r   r   r   r   r   o  r   r(   c                r   r   r   r   r   r   r   r   s  r   r(   c                (    V P                   ^ ,          # r    r   r   r{   r   r   r   |  s    QZZ]r(   c                r   r   )InputCoverager   r{   r   r   r   }  s    !//!*<r(   c                r   r   r   r   r{   r   r   r     r   r(   c                s^    V P                   V P                  ,           V P                  ,           # r   )rt   r   rs   r   r{   r   r   r     s    ''!//9A<O<OOr(   c                r   )c              3  8   "   T F  p\        V4      x  K  	  R # 5ir   r-   r   r   r   r   r     s     &9q!s1vvqr   N)rr   rv   r   r   r   r   r     s    $%MQZ&9q&9OQ\r(   c                sh    Vw  V n         V n        V n        R  V 4       w  V n        V n        V n        R# )c              3  r   r   r-   r   r   r   r   Zf__subset_classify_context.<locals>.ContextHelper.__init__.<locals>.ChainSetRuleData.<locals>.<genexpr>  s     +AQr   N)rt   r   rs   r   r   r   r   r   r   r   r     s7    RSOQ(!/1;N
 ,+	-)-r(   Rule	RuleCountRuleSetRuleSetCountc                s    W 9   d   V.# . # r   r   r%   re   r   r   r   r   r     s    Q[qc6Pb6Pr(   Z	ClassRuleZClassRuleCountZClassSetZClassSetCountc                sl    V'       d   VP                  W4      # V^ 8X  d   \        V 4      # \        4       # r   )rH   r7   r  r   r   r   r     s6     %%f0 <)*a#f+<58U<r(   r   r   r   r   r   rr   )__name__endswith
startswithTypTyper   ChainTypInputIdxDataLenr   rr   ContextDatar   RuleDatar   r   r  r  r  	Intersectr   ClassDefIndexr   )r$   rG   rq   r  r	  r   r  r  r
  rr   ZChainCoverager  ZChainContextDatar   r   r  ZChainRuleDatar   r   s   &&&                r   __init__Z9__subset_classify_context.<locals>.ContextHelper.__init__,  sX   ~~&&w//~~((11{HHIJ$M$M"L $~ 5D{/ 4/#? !%&*#/ M>> 1/ 45$ &T 0 M>> 12 <"#' !%&*#/!:,  -#3 &9# -#3  (#. &4# (#. {$v-	!)K!7')3$,~$=!!P1${2	!),<!<'*4$,$>!" 49j*/QQ"(-W7
105_:
 r(   )r   r
  r   r  r  rr   r  r   r  r  r   r   r  r  r  r  r   r   r  r	  N)r  
__module____qualname____firstlineno__r  __static_attributes__r   r(   r   ContextHelperr   +  s	    L	Fr(   r  N_subset__ContextHelpersrw   )objectrq   hasattr	__class__r  )r$   r  Zhelperr   r   __subset_classify_contextr  $  s    MF MF^ {{)#4>>#<==13.{{$..@@@t~~t{{;>D..t{{;>>11$++>>r(   c                s  aa V P                  4       oSP                  V 4      P                  V4      pV'       g   . # SP                  V 4      P                  V4      pV P                  ^8X  EdF   SP                  V 4      p\        V SP                  4      p\        V SP                  4      pV EF  pWv8  g   WW,          '       g   K  \        WW,          SP                  4       EF  pV'       g   K  \        ;QJ d9    VV3R l\        VSP                  V4      4       4       F  '       d   K   RM.	  RM*! VV3R l\        VSP                  V4      4       4       4      '       g   K  \        4       p	\        VSP                  4       EF  p
V
'       g   K  V
P                  pW9   d   RpMXV^ 8X  d.   \!        SP                  V 4      P"                  V,          .4      pM$\!        VP$                  V^,
          ,          .4      pSP&                  P(                  P*                  V
P,                  ,          pV	P/                  V4       VP1                  4       '       d6   V	P3                  \5        V\7        VP$                  4      ^,           4      4       VP9                  SVR7       EK  	  EK  	  EK  	  R# V P                  ^8X  Ed   \        V SP:                  4      pVP                  V4      pSP                  V 4      p\        V SP                  4      p\        V SP                  4      pV EF  pWv8  g   WW,          '       g   K  \        WW,          SP                  4       EF  pV'       g   K  \        ;QJ d9    VV3R l\        VSP                  V4      4       4       F  '       d   K   RM.	  RM*! VV3R l\        VSP                  V4      4       4       4      '       g   K  \        4       p	\        VSP                  4       EF6  p
V
'       g   K  V
P                  pW9   d   RpMiV^ 8X  d   \!        VP=                  W'4      4      pMG\!        VP=                  SP"                  \        VSP$                  4      V^,
          ,          4      4      pSP&                  P(                  P*                  V
P,                  ,          pV	P/                  V4       VP1                  4       '       d@   V	P3                  \5        V\7        \        VSP$                  4      4      ^,           4      4       VP9                  SVR7       EK9  	  EK  	  EK  	  R# V P                  ^8X  Ed   \        ;QJ d.    V3R lSP                  V 4       4       F  '       d   K   RM#	  RM! V3R lSP                  V 4       4       4      '       g   . # T p\        VSP$                  4      p\        4       p	\        VSP                  4       F  p
V
'       g   K  V
P                  pW9   d   RpM=V^ 8X  d   \!        V4      pM*\!        W,          P                  SP"                  4      4      pSP&                  P(                  P*                  V
P,                  ,          pV	P/                  V4       VP1                  4       '       d,   V	P3                  \5        V\7        V4      ^,           4      4       VP9                  SVR7       K  	  R# R# )rl   c              3     <a"   T FF  w  op\         ;QJ d!    VVV3R  lV 4       F  '       d   K   RM	  RM! VVV3R  lV 4       4      x  KH  	  R# 5i)c              3  ^   <"   T F"  pSP                  SP                  SV4      x  K$  	  R # 5ir   r  r%   r   kre   cdrU      & r   r   rf     %     DeAHHb!44e   *-FTNr`   r   klistr!  re   rU      & @r   r   rP     :      %D	E CDeDCCCDeDDD%D   AA"AFTN)rN   c              3  r  )c              3  r  r   r  r  r"  r   r   rf     r#  r$  FTNr%  r&  r(  r   r   rP     r)  r*  c              3  p   <"   T F+  qR J;'       d    VP                  SP                  4      x  K-  	  R # 5ir   r:   r   r   rU   r   r   r   rP     s-     UDTqD=::Q[[%::DT   6$6)r  rr   r6   r9   rq   r  r~   r  r  r   r`   zipr  r7   r   ZSequenceIndex	frozensetr%   r   table
LookupListLookupLookupListIndexaddr   rR   ranger.   rW   r   rH   )r$   rU   rN   r0   r  rssrssCountr2   r   ZchaosllZseqiZ
pos_glyphsZlookupr   Zinput_coveragesre   s   &f&             @r   rW   rW     s   &&(Ajj((4G	D!22:>J{{ammD)dAII&40A}CFFSVQVV,s %(ajjm%Dsss %(ajjm%D   !!Q^^4B ++D}%)
19)2AJJt4D4K4KA4N3O)PJ)2AGGD1H4E3F)GJWW//66r7I7IJFIIdO//11U4QWW1A%BC))!
)C! 5 - : 
	4,$$Z0mmD)dAII&40A}CFFSVQVV,s %(ajjm%Dsss %(ajjm%D   !!Q^^4B ++D}%)
19)2 ( 8 8 G*J *3 ( 8 8$%HHga.A$(.K!"*J
 WW//66r7I7IJFIIdO//11U4WQ5H1IA1M%NO))!
)C- 5 - F 
	sUAJJtDTUsssUAJJtDTUUUI!!QWW-!Q^^,B##D}!
19!*:!6J!*'->>qxxH"J WW''..r/A/ABFIIdO''))U4_)=)ABC!!!
!;% - 
r(   c                s  a V P                  4       pV P                  ^8X  Ed   V P                  P                  SP                  4      p\        WP                  4      p\        WP                  4      pV Uu. uF  qfV8  g   K  WF,          NK  	  ppV F  pV'       g   K  \        WrP                  4      pV U	u. uFo  p	V	'       g   K  \        ;QJ d.    V3R lVP                  V	4       4       F  '       d   K   RM#	  RM! V3R lVP                  V	4       4       4      '       g   Km  V	NKq  	  pp	\        WrP                  V4       \        WrP                  \        V4      4       K  	  \        V4       UUu. uF.  w  rgV'       g   K  \        WrP                  4      '       g   K,  VNK0  	  pppV P                  P                  V4       \!        WC4      p\        WP                  V4       \        WP                  \        V4      4       \#        V4      # V P                  ^8X  Ed	   V P                  P                  SP                  4      '       g   R# VP%                  V 4      p
V
 Uu. uF)  q'       d   VP                  SP                  RR7      MRNK+  	  ppWP&                  ,          p\        WP                  4      p\        WP                  4      pV Uu. uF  qfV8  g   K  WF,          NK  	  pp?\        WP(                  4      P+                  V P                  P                  4      p\        V4       UUu. uF  w  rdWc9   d   TMRNK  	  upppV EFF  pV'       g   K  \        WrP                  4      pV U	u. uF{  p	V	'       g   K  \        ;QJ d4    R \-        WP                  V	4      4       4       F  '       d   K   RM)	  RM%! R \-        WP                  V	4      4       4       4      '       g   Ky  V	NK}  	  pp	\        WrP                  V4       \        WrP                  \        V4      4       V Fa  p	TP/                  T	\-        WP                  V	4      4       UUUu. uF%  w  rV Uu. uF  qP1                  V4      NK  	  upNK'  	  uppp4       Kc  	  EKI  	  V Uu. uF)  qw'       d   \        WrP                  4      '       d   TMRNK+  	  ppV'       d   VR,          f   VR K  \        WP                  V4       \        WP                  \        V4      4       \#        V4      # V P                  ^8X  dY   \        ;QJ d.    V3R lVP                  V 4       4       F  '       d   K   R# 	  R# ! V3R lVP                  V 4       4       4      # R# u upi u up	i u uppi u upi u upi u uppi u up	i u upi u upppi u upi )	rl   c              3  s   <"   T F?  p\         ;QJ d    V3R  lV 4       F  '       d   K   RM	  RM! V3R  lV 4       4      x  KA  	  R# 5i)c              3  r]   r   r<   )r   r   rU   r   r   r   r   J  s     95aM5rB   FTNr%  )r   ZglistrU   r   r   r   r_   J  s/     U}e95995999}s   A
A
 A
FTr   Nc              3  s   a"   T FB  w  op\         ;QJ d    V3R  lV 4       F  '       d   K   RM	  RM! V3R  lV 4       4      x  KD  	  R# 5i)c              3  s,   <"   T F	  qS9   x  K  	  R # 5ir   r   )r   r   	klass_mapr   r   r   r   p  s     61Ys   FTNr%  )r   r'  r9  s   & @r   r   r_   o  s;      ,J(	5 C66CCC6666,Js   AA Ac              3  r+  r   ru   r,  r   r   r   r_     s-     RAQAD=77QXXahh%77AQr-  )r  rq   rr   r;   r%   r~   r  r  r   r`   r  r   r  r.   r5   r=   r4   rX   r  r  r   r6   r.  r   rL   )r$   rU   re   r0   r6  r7  r2   rsZssr   r  r   Z
klass_mapsr9  r'  r   s   &f              r   rZ   rZ   4  sz    	&&(A{{a--&&qxx0dII&40&7w!h,vsvvw7BVV$B A  CUqzzRS}UCCCUqzzRS}UU    B#BSW-  #,C.O.B172vv;N11.OG$3(ii%nnc#h/Cy		}}##AHH--mmD)CN
CNaaAHHQXXTH*T9; 	 

 __-dII&40&7w!h,vsvvw7$

+55dmm6J6JK;DS>J>als,>JBVV$B A  C ,/
JJqM,JCCC ,/
JJqM,J     B#BSW-  14J

10N0N,I 6;;U+U;0N # 6 EHHCbRGB//rT9CHc"goBii%nnc#h/ Cy		sRDAQRssRsRsRDAQRRR 
[ 8
 P
 8 K" < Is   7VV:
V	
V#V:*V)V8V$	V$&V$)/V*V/'V/<V4>
V:
V:)V:0V:9V:%W0V?	W&/W?Wc                s   V P                  4       pV P                  R9   d   \        WP                  4       F  pV'       g   K  \        W2P                  4       F  pV'       g   K  \        TVP                  \        WBP                  4       Uu. uF"  pV'       g   K  VP                  V9   g   K   VNK$  	  up4       \        WBP                  4       F-  pV'       g   K  VP                  VP                  4      Vn        K/  	  K  	  K  	  R# V P                  ^8X  d   \        T VP                  \        WP                  4       Uu. uF"  pV'       g   K  VP                  V9   g   K   VNK$  	  up4       \        WP                  4       F-  pV'       g   K  VP                  VP                  4      Vn        K/  	  R# R# u upi u upi rl   N)rl   rx   )	r  rq   r~   r  r   r   r   r3  rL   )r$   r   re   r;  r   r8  r   r   r   r     su    	&&(A{{f$		*BR(NN #*!^^"<"<B "$"4"4"F "< "!^^4B )7)=)=b>P>P)QB& 5 ) +& 
	NN "$77B ,,> 7	
 $/B!/!5!5b6H6H!IB 0 
s$   
F?F?0F?
GG(Gc           
     s   V P                  4       pV P                  R9   d   \        WP                  4       UUUu. uFe  pV'       g   K  \        W!P                  4       F?  pV'       g   K  \        W1P
                  4       F  pV'       g   K  VP                  NK  	  KA  	  Kg  	  uppp# V P                  ^8X  d9   \        WP
                  4       Uu. uF  qD'       g   K  VP                  NK  	  up# R# u upppi u upi r<  )r  rq   r~   r  r   r   r3  )r$   re   r;  r   r8  s   &    r   r   r     s     	&&(A{{f dII.
.  R(	 
 a0 B
 1  ) .
 	
 
	-4T>>-JQ-Jrb"""-JQQ 

 Rs#   
C6
C6,C6C6	C=!C=c                sb    V P                   ^8X  d   V P                  P                  W4       R# R# r   )rq   ExtSubTablerW   rT   r   r   rW   rW     s'    {{a''6 r(   c                \    V P                   ^8X  d   V P                  P                  4       # R# r   )rq   r=  r   rz   r{   r   r   r     s(    {{a1133 r(   c                ^    V P                   ^8X  d   V P                  P                  V4      # R# r   )rq   r=  rZ   r$   rU   r   r   rZ   rZ     s*    {{a--a00 r(   c                s^    V P                   ^8X  d   V P                  P                  W4      # R# r   )rq   r=  r   r   r   r   r   r     s*    {{a11$@@ r(   c                r?  r   )rq   r=  r   r   r   r   r   r     s*    {{a..~>> r(   c                r>  r   )rq   r=  r   rz   r{   r   r   r     s(    {{a//11 r(   c                s   Vf   \        VP                  4      p\        V 4      pVP                  pVP	                  VR4      w  rVV\        VP                  4      8w  d&   \        VP                  4      \        4       3;w  rVWC&   VP                  V4      '       d   R # VP                  V4       V P                   F  pV'       g   K  VP                  W4       K   	  R # )Nr   )r/  r%   Zid_doneLookupsgetr.   r7   ZissubsetrR   SubTablerW   )r$   rU   rN   keyZdoneLookupsr1   coveredst   &&&     r   rW   rW     s    qxx(
 T(C..K __S)4NEAHH-0]CE,BB)7##NN:mm
!( r(   c                s.   V P                    Uu. uF'  q"'       g   K  VP                  V4      '       g   K%  VNK)  	  upV n         \        V P                   4      V n        \	        V R 4      '       d   V P
                  e   V P
                  VP                  9  d;   RV n        V ;P                  R,          un        V ;P                  ^,          un        M*VP                  P                  V P
                  4      V n        \        V P                  4      # u upi )MarkFilteringSetNi)
rC  rZ   r.   ZSubTableCountr  rH  used_mark_setsZ
LookupFlagrL   rX   )r$   rU   rF  r+   r   rZ   rZ   !  s    "&--N-B2R":J:J1:MRR-NDMT]]+Dt'((T-B-B-N  (8(88$(D!OOu$OOOs"O$%$4$4$:$:4;P;P$QD!""## Os   	DDDc                z    R pV P                    F(  pV'       g   K  VP                  W4      '       g   K&  RpK*  	  V# FT)rC  r   )r$   r&   r   retrF  r\   r   r   r   /  s8    
Cmm..C	 
 Jr(   c                sN    V P                    F  pVP                  V4       K  	  R # r   )rC  r   )r$   r   rU   r+   r   r   r   :  s    ]]	( r(   c                s<    \        R  V P                   4       . 4      # )c              3  T   "   T F  q'       g   K  VP                  4       x  K   	  R # 5ir   )r   r   rF  r   r   r   "collect_lookups.<locals>.<genexpr>B  s!     C}$""$$}   	(()sumrC  rz   r{   r   r   r   @  s    Ct}}CRHHr(   c                s    \         ;QJ d&    R  V P                   4       F  '       g   K   R# 	  R# ! R  V P                   4       4      # )c              3  rM  r   )r   rN  r   r   r   Z$may_have_non_1to1.<locals>.<genexpr>G  s!     D"%r##%%rP  TF)rC   rC  rz   r{   r   r   r   E  s3    3DD33D3D3DDDDr(   c                s    \        V P                  4       UUu. uF*  w  r#V'       g   K  VP                  V4      '       g   K(  VNK,  	  upp# u uppi )z(Returns the indices of nonempty lookups.)r5   r2  rZ   )r$   rU   r2   r/   r3   r   rZ   rZ   J  s:     $DKK0M0$!AA!//!:LAA0MMMs   AAAc                rJ  rK  )r2  r   )r$   r&   r   rL  r/   r\   r   r   r   P  s8    
C[[t--C	 
 Jr(   c                s    V P                  4        V Uu. uF(  q"V P                  8  g   K  V P                  V,          NK*  	  upV n        \        V P                  4      V n        V P                   F  pVP	                  V4       K  	  R # u upi r   )ensureDecompiledLookupCountr2  r.   r   r$   r   r2   r/   r3   r   r   r   [  sn    +9R>aAQAQ=Q>4;;q>>>RDK4;;'D[[	(  Ss
   BBc                s    V P                  4        \        V P                  4       UUu. uF  w  r#W!9   d   TMRNK  	  uppV n        R# u uppi z+Sets lookups not in lookup_indices to None.N)rR  r5   r2  rT  r3   r   neuter_lookupsrV  d  sF     	7@7M7MtqQ d*7MDK s   A	c                s  a  \        V4      pTp \        V 3R lV 4       . 4      pV Uu. uF   pWA9  g   K  VS P                  8  g   K  VNK"  	  ppV'       g   \        V4      # \        V4      pVP                  V4       TpKv  u upi )zBReturns sorted index of all lookups reachable from lookup_indices.c              3  s   <"   T F8  qSP                   8  g   K  SP                  V,          P                  4       x  K:  	  R # 5ir   )rS  r2  r   rp   r   r   r   Z"closure_lookups.<locals>.<genexpr>t  s3     Ww!dFVFVBV-T[[^++--ws
   A)A)r   rQ  rS  extend)r$   r   ZrecurseZrecurse_lookupsr/   s   f&   r   closure_lookupsrX  m  s      /NG
WwW
 %
$& +,t/?/?+? A$ 	 

 n--$_5o.!
s   BB
Bc                sj   V P                    Uu. uF  q"V9   g   K  VNK  	  upV n         V P                    Uu. uF  q!P                  V4      NK  	  upV n         \        V P                   4      V n        V P                  ;'       g%    \	        V P
                  \        P                  4      # u upi u upi )z1"Returns True if feature is non-empty afterwards.)r3  rL   r.   rS  
isinstanceZFeatureParamsr   ZFeatureParamsSize)r$   r   r/   r+   r   r   r     s     (,';';S';!N?RAA';SD=A=Q=QR=Q003=QRD4//0D   zH66   TRs   B+B+B0c                s    \        V P                  4       UUu. uF;  w  r#VP                  P                  V4      '       g   VP                  R8X  g   K9  VNK=  	  upp# u uppi ))Returns the indices of nonempty features.pref)r5   FeatureRecordFeaturer   
FeatureTag)r$   r   r2   fr3   r   r   r     sX     d0011DAII$$^448N 	
1  s   6AAc                s0   a  \        V 3R  lV 4       . 4      # )c              3  s   <"   T F?  pVSP                   8  g   K  SP                  V,          P                  P                  x  KA  	  R # 5ir   )FeatureCountr\  r]  r3  rp   r   r   r   rO    s?      	
$4$$$ :Dq!))99$s
   A
/A
)rQ  r$   feature_indicess   f&r   r   r     s"    	
$	

 	 r(   c                s    V P                  4        \        V P                  V4      V n        \        V P                  4      V n        \        V P                  4      # r   )rR  r4   r\  r.   r`  rX   ra  r   r   subset_featuresrc    sG    %d&8&8/JDD../D!!""r(   c                s    V P                    Uu. uF2  pVP                  P                  V4      '       g   K&  VP                  NK4  	  up# u upi )rZ  )SubstitutionRecordr]  r   FeatureIndex)r$   r   r   r+   r   r   r     sG    
 (((A99##N3 	(  s
   #A
A
c                sD   a \        V3R lV P                   4       . 4      # )rZ  c              3  sZ   <"   T F   pVP                   P                  S4      x  K"  	  R # 5ir   )FeatureTableSubstitutionr   )r   r_  r   r   r   r   Z!subset_lookups.<locals>.<genexpr>  s,      	
0 &&55nEE0rn   rQ  FeatureVariationRecordr   r8   r   r   r     s*     	
00	
 	 r(   c                sD   a \        V3R  lV P                   4       . 4      # )c              3  s   <"   T FK  pVP                   P                   F.  pVP                  S9   g   K  VP                  P                  x  K0  	  KM  	  R # 5ir   )rf  rd  re  r]  r3  )r   Zvrr   rb  rO   r   r   rO    sI      	
100CC~~0 &AII%%C &1s
   ,A"Arg  ra  r8   r   r   r     s(    	
11	
 	 r(   c                sV   V P                  4        V P                   Uu. uF  q"P                  V9   g   K  VNK  	  upV n        V P                   F#  pVP                  VP                  4      Vn        K%  	  \	        V P                  4      V n        \        V P
                  4      # u upi r   )rR  rd  re  rL   r.   SubstitutionCountrX   r$   rb  r   r+   r   rc  rc    s    ***ann.O*D $$(..q~~> % !8!89D&&''s
   B&B&c                s`   V P                  4        V P                   Uu. uF%  q"P                  VP                  4       9   g   K#  VNK'  	  upV n        V P                   F  pWP                  ,          Vn        K  	  \	        V P                  4      V n        \        V P
                  4      # u upi r   )rR  rd  re  keysr.   ri  rX   r$   feature_index_mapr   r+   r   prune_featuresrn    s    ***ann@Q@V@V@X.X*D $$*>>: % !8!89D&&''s    B+B+c                   V P                  4        V P                   F  pVP                  P                  V4       K   	  V P                  '       dJ   V P                  R,          P                  P                  '       g   V P                  P                  4        K[  \        V P                  4      V n        \        V P                  4      # rl   r:  )	rR  rh  rf  rc  ri  popr.   FeatureVariationCountrX   rj  r+   r   rc  rc    s    ((	""22?C )
 	###++

"
"#4#45 	##'')!$T%@%@!AD**++r(   c                ro  rp  )	rR  rh  rf  rn  ri  rq  r.   rr  rX   rl  r+   r   rn  rn    s    ((	""112CD )
 	###++

"
"#4#45 	##'')!$T%@%@!AD**++r(   c                s   V P                   V9   d"   VP                  V P                   4      V n         MR V n         V P                   Uu. uF  q"V9   g   K  VNK  	  upV n        V P                   Uu. uF  q"V9   g   K  VP                  V4      NK  	  upV n        \        V P                  4      V n        \        V P                  ;'       g    V P                   R 8g  4      # u upi u upi   )ReqFeatureIndexrL   re  r.   r`  rX   )r$   rb  r_  r+   r   rc  rc    s    ..44T5I5IJ$$($5$5N$5qo9M$5ND +/*;*;*;QO?S a *;D D--.D!!BBT%9%9U%BCC Os   C!C!1C&>C&c                sT   VP                  V P                  R 4      V n        V P                   Uu. uF!  q"VP                  4       9   g   K  W,          NK#  	  upV n        \	        V P                  4      V n        \        V P
                  ;'       g    V P                  R 8g  4      # u upi rs  )rB  ru  re  rk  r.   r`  rX   )r$   rm  r_  r+   r   rn  rn  $  s    ,001E1EuMD&*&7&7&7@Q@V@V@X;X&7D D--.D!!BBT%9%9U%BCC	s   B%B%c                s    V P                   R ,          pV P                  R8w  d   VP                  V P                  4       \        V4      # )NNNrt  )re  ru  appendr   ra  r   r   collect_featuresrx  .  s?    ''*Ou$t334o&&r(   c                   V P                   '       d1   V P                   P                  V4      '       g   V'       g   R V n         V P                   Uu. uF'  q3P                  P                  V4      '       g   K%  VNK)  	  upV n        \	        V P                  4      V n        \        V P
                  ;'       g    V P                   4      # u upi r   )DefaultLangSysrc  LangSysRecordLangSysr.   LangSysCountrX   )r$   rb  keepEmptyDefaultLangSysr/   r   r   rc  rc  6  s     	##33ODD'"%%%a)B)B?)S%D D../D!!88T%8%899	   "C	8C	c                ry  r   )rz  rn  r{  r|  r.   r}  rX   )r$   rm  r~  r/   r   r   rn  rn  E  s     	##223DEE'"%%%a)A)ABS)T%D D../D!!88T%8%899	r  c                s   V P                    Uu. uF  qP                  P                  4       NK  	  ppV P                  '       d*   VP	                  V P                  P                  4       4       \        \        V. 4      4      # u upi r   )r{  r|  rx  rz  rw  r   rQ  )r$   r/   rb  r   r   rx  rx  T  sj    =A=O=OP=Oyy113=OOPt22CCEFc/2.// Qs   "Bc                   V P                    Uu. uF=  pVP                  P                  WP                  R 8H  4      '       g   V'       g   K;  VNK?  	  upV n         \	        V P                   4      V n        \        V P
                  4      # u upi ZDFLT)ScriptRecordScriptrc  	ScriptTagr.   ScriptCountrX   )r$   rb  retain_emptyrU   r   r   rc  rc  \  sx    
 """A88##O[[F5JKK 	
"D 4,,-D  !!   8B	B	c                r  r  )r  r  rn  r  r.   r  rX   )r$   rm  r  rU   r   r   rn  rn  i  sy    
 """A88""#4kkV6KLL 	
"D 4,,-D  !!r  c                sN    \        \        R  V P                   4       . 4      4      # )c              3  sT   "   T F  qP                   P                  4       x  K   	  R # 5ir   )r  rx  r   rU   r   r   r   Z#collect_features.<locals>.<genexpr>x  s      R@Q1884466@Qs   &()r   rQ  r  rz   r{   r   rx  rx  v  s!    cR@Q@QRTVWXXr(   EBLCc                s   V P                    F}  pVP                   F6  pVP                   Uu. uF  qDVP                  9   g   K  VNK  	  upVn        K8  	  VP                   Uu. uF  qUP                  '       g   K  VNK  	  upVn        K  	  V P                    Uu. uF  qP                  '       g   K  VNK  	  upV n         R # u upi u upi u upi r   )strikesZindexSubTablesnamesr%   )r$   rU   strikeZindexSubTablenr2   r   r   rZ   rZ   |  s    ,,#22M.;.A.A"S.A!((]11.A"SM 3,2,A,A M,AqWW,A M   $||@|!/?/?AA|@DL	 #T M@s#   CC$C	<C	C4CEBDTc           
     s    V P                    UUu. uF-  q!P                   Uu/ uF  q3V9   g   K  W2V,          bK  	  upNK/  	  pppV Uu. uF  q"'       g   K  VNK  	  upV n         R # u upi u uppi u upi r   )
strikeDatar%   )r$   rU   r  r   r     &&   r   rZ   rZ     sr     GKooFUFxx7x!;1Ix7o  
 -7AJ&&vvJADO 	8
 Bs&   A-A(A(A-
	A3A3(A-Zsbixc                s    V P                   P                  4        FG  pVP                   Uu/ uF(  q3VP                  9   g   K  W2P                  V,          bK*  	  upVn        KI  	  R # u upi r   )r  rJ   r%   )r$   rU   r  r   r3   r   rZ   rZ     sV    ,,%%'67hhUhv}}BT,MM!,,hU (  Vs   A(A(GSUBc                s   V P                   Vn         V P                   P                  '       d&   V P                   P                  P                  4       pM. pV P                   P                  '       d'   V P                   P                  P	                  V4      pM. p\        V P                   R R4      '       d,   W0P                   P                  P	                  V4      ,          p\        V4      pV P                   P                  '       d   / Vn	         \        VP                  4      pV F  pWPP                   P                  P                  8  d   K)  V P                   P                  P                  V,          '       g   KX  V P                   P                  P                  V,          P                  V4       K  	  WAP                  8X  g   K   T=	V= R# FeatureVariationsN)r0  
ScriptListrx  FeatureListr   r~   r  r   r1  rA  r/  r%   rS  r2  rW   )r$   rU   rb  r   Zorig_glyphsr2   r   r   rW   rW     sI   jjAGzz**//@@Bzz//??Ptzz.55**66FFWW/Nzz#AHH-K#

--999zz,,33A66

%%,,Q/>>qA $ hh&N	r(   GPOSc                s    VP                   Vn        V P                  P                  '       d'   V P                  P                  P	                  V4      pM. pV P                  V4       R # r   )glyphs_gsubedr%   r0  r1  rZ   r   )r$   rU   r   r+   r   rZ   rZ     sM    AHzz..<<Q?'r(   c                sH    V P                   \        P                  ! R 4      8H  # )r  )r  r   getTableClassrz   r{   r   retain_empty_scriptsr    s     >>U00888r(   c                s^   V P                   P                  '       d&   V P                   P                  P                  V4       V P                   P                  '       d'   V P                   P                  P                  V4      pM. p\	        V P                   RR4      '       d,   W P                   P
                  P                  V4      ,          p\        V4      pV P                   P                  '       d&   V P                   P                  P                  V4       \	        V P                   RR4      '       d&   V P                   P
                  P                  V4       V P                   P                  '       d6   V P                   P                  P                  W P                  4       4       R# R# )zVRetains specified lookups, then removes empty features, language
systems, and scripts.r  N)
r0  r1  r   r  r~   r  r   rc  r  r  )r$   r   rb  r+   r   r   r     s#    zz

,,^<zz**00??Otzz.55::77FF~VV 1Ozz

..?tzz.55

$$44_Ezz

--668	
 r(   c                s    V P                   P                  '       d(   V P                   P                  P                  V4       R# R# rU  )r0  r1  rV  r   r   r   rV  rV    s1     zz

,,^< r(   c                s   V P                   P                  '       d&   V P                   P                  P                  4       pM. pV P                   P                  '       d'   V P                   P                  P	                  V4      pM. p\        V P                   RR4      '       d,   W0P                   P                  P	                  V4      ,          p\        V4      pV P                   P                  '       d'   V P                   P                  P                  V4      pM. pV'       d   V P                  V4       R# V P                  V4       R# )z/Remove (default) or neuter unreferenced lookupsr  N)r0  r  rx  r  r   r~   r  r   r1  rX  r   rV  )r$   r=   rb  r   r3   r   prune_lookupsr    s     zz**//@@Bzz//??Ptzz.55**66FFWW/Nzz..>>~NN+N+r(   c                s^   V P                   P                  '       d   \        V P                   P                  P                  4       UUu. uF  w  r#VP                  V9   g   K  VNK  	  pppV P                   P                  P                  V4       \        V P                   R R4      '       d&   V P                   P                  P                  V4       M. pV P                   P                  '       d6   V P                   P                  P                  W@P                  4       4       R# R# u uppi r  )
r0  r  r5   r\  r^  rc  r~   r  r  r  )r$   Zfeature_tagsr2   r_  rb  r  r   subset_feature_tagsr    s    zz "$**"8"8"F"FG
G|||+ AG 	 

 	

..?4::2D99JJ((88Izz

--668	
 
s   	D)#D)c                s   / p\        4       pV Fy  pR V9   d   VP                  R 4      MVR3w  rVVP                  VP                  ^4      4       VP	                  V\        4       4      P                  VP                  ^4      4       K{  	  V P
                  P                  '       Ed   V P
                  P                  P                   Uu. uF  qwP                  V9   g   K  VNK  	  upV P
                  P                  n        \        V P
                  P                  P                  4      V P
                  P                  n
        V P
                  P                  P                   F  pVP                  V9   g   K  RW(P                  ,          9  g   K/  VP                  P                   U	u. uF(  p	V	P                  W(P                  ,          9   g   K&  V	NK*  	  up	VP                  n        \        VP                  P                  4      VP                  n        RW(P                  ,          9  g   K  RVP                  n        K  	  R# R# u upi u up	i ).r   z*   ZdfltN)r7   splitr4  ZljustZ
setdefaultr0  r  r  r  r.   r  r  r{  Z
LangSysTagr}  rz  )
r$   tagsZlangsysZscript_tagstagZ
script_tagZlang_tagrU   recordr/   
   &&        r   subset_script_tagsr    s   G%K14syy~#s

((+,:su-11(..2CD 
 zzzz,,99.
9![[K=WAA9.


* -0

0E0E0R0R,S

)jj++88F7*vWEUEU=V/V $]]88/8||w/?/?'@@ A8/+
 .11L1L-M*)9)9!::37FMM0 9 .
/s   I"I-#IIc                sZ   V P                   P                  '       d&   V P                   P                  P                  4       pM. pV P                  V4      w  rV P                   P                  '       d&   V P                   P                  P                  V4       \        V P                   RR4      '       d&   V P                   P                  P                  V4       V P                   P                  '       d6   V P                   P                  P                  W P                  4       4       R# R# )zRemove unreferenced and duplicate features in FeatureList
Remove unreferenced features and remap duplicate feature indices in ScriptList and FeatureVariations
r  N)
r0  r  rx  remap_duplicate_featuresr  rc  r~   r  rn  r  )r$   rb  rm  r   r   rn  rn  /  s    
 zz**//@@B+/+H+H,(_ zz

..?tzz.55

$$334EFzz

,,88:	
 r(   c                s:   V P                   P                  P                  p/ p/ pV F  pW%,          pVP                  pVP	                  V4      pVf   \        V.4      W7&   WTV&   K@  Rp	V F  p
W*,          V8X  g   K  Rp	WV&    M	  V	'       d   Kj  VP                  V4       WTV&   K  	  / p^ pV F<  pVP	                  WU4      pVP	                  V4      pVf   WV&   V^,          pK8  WV&   K>  	  \        \        R VP                  4        4       . 4      4      pW3# )zPReturn retained feature indices(without duplicates) and remapped feature indicesFTc              3  r   r   )rI   r  r   r   r   Z+remap_duplicate_features.<locals>.<genexpr>p  s     76T!WW6r   )
r0  r  r\  r^  rB  r7   r4  r   rQ  rJ   )r$   rb  featuresZunique_featuresZduplicate_featuresr2   r_  r  Zsame_tag_featuresZfoundZother_iZfeature_mapZnew_idxZunique_irE   Zretained_feature_indicess   &&              r   r  r  F  s6    zz%%33HOKll+//4$#&s8O $%q!(G A%(/1%	 ) u!!!$$%q!' , KG%))!/OOH%9$NqLGN   *7o4467<  %22r(   c                s    R VP                   9  d   V P                  VP                   4       R VP                  9  d   V P                  VP                  4       V P	                  RR7       R# )r   Fr   T)layout_scriptsr  layout_featuresr  r  r   r   r   prune_pre_subsetr  u  s\     '((( 6 67
')))  !8!89U#r(   c                s   V P                   pVP                  '       d   VP                  '       g   R # VP                  P                  pVP                  P                   EFd  pVP
                  P                  pV'       g   K$  VP
                  P                  R,           EF  pVP                  p\        VP                  4      \        VP                  4      8w  d   K?  VP                  R8H  VP                  R8H  8w  d   Kb  VP                  R8w  d*   W$P                  ,          W&P                  ,          8w  d   K  \        \        VP                  4      4       F;  pW$P                  V,          ,          W&P                  V,          ,          8w  g   K:   K  	  VP
                  P                  P                  V4       EK!  	  EKg  	  R # )Nrv  rt  )r0  r  r  r\  r  r  rz  r{  r|  r.   re  ru  r5  remove)r$   r0  r  rU   r*   Zlrr/   r2   s   &       r   remove_redundant_langsysr    sD   JJE5#4#4#4  ..H**HH##((((++B

A1>>"c!..&99!!U*0A0AU0JK  E)--.(;L;L2MM3q~~./NN1-.(>>!;L2MM 0
 &&--b1# ,	 +r(   c                s4   V P                   pV P                  4        VP                  '       d   VP                  P                  W4       VP                  '       g   R Vn        VP                  '       d!   V P                  4        V P                  4        \        VR4      '       dr   VP                  '       d6   VP                  '       d   VP                  P                  '       g   R Vn        VP                  '       g   VP                  R8X  d   RVn
        R# )Nr  i     T)r0  r  r1  r   r  r  rn  r  r  rh  Versionr$   r&   r   r0  r   r   r   r     s    JJE**49  %%' u)**"""%"9"9"P"P"P&*E# &&&5==J+F&EMr(   GDEFc                s@   VP                   pV P                  pVP                  '       d   VP                  P                  P	                  V4      p\        VP                  P                  V4      VP                  n        \        VP                  P                  4      VP                  n        VP                  '       dP   VP                  P                  P                  4        UUu/ uF  w  rVWR9   g   K  WVbK  	  uppVP                  n
        VP                  '       dP   VP                  P                  P                  4        UUu/ uF  w  rVWR9   g   K  WVbK  	  uppVP                  n
        VP                  '       d   VP                  P                  P	                  V4      pVP                  P                  pV Uu. uF(  qV8  g   K  VP                  P                  V,          NK*  	  upVP                  n        \        VP                  P                  4      VP                  n        \!        VR 4      '       d   VP"                  '       d   VP"                  p	V	P                   F  p
V
'       g   K  V
P	                  V4       K   	  \%        V	P                  4       UUu. uF  w  rVP&                  '       g   K  VNK  	  uppVn        V	P                   Uu. uF  qP&                  '       g   K  VNK  	  upV	n        R# u uppi u uppi u upi u uppi u upi )MarkGlyphSetsDefT)r  r0  LigCaretListrr   r;   r4   rh   r.   LigGlyphCountMarkAttachClassDefr@   rD   GlyphClassDef
AttachListrv   ZAttachPointr  r  r5   r%   rI  )r$   rU   r%   r0  r0   r   rE   rv   r2   ZmarkGlyphSetsZcoveragere   s   &&          r   rZ   rZ     si   __FJJE$$--44V<&253E3E3N3NPW&X#+.u/A/A/J/J+K("55??EEG.
GTQ1;DADG.
  * "00::@@B)
BTQakDADB)
% ""++226:%%00
5<(
5<J+E((++W(
$ '*%*:*:*F*F&G#u())e.D.D.D..%..Hx' / +4M4J4J*KX*K$!qxxAA*KX-:-C-C!P-Cxx!!-C!P/.
)
(
 Y!Ps<   &
L5L
L
L
 L!L$L?LL4Lc                s   R V 9  d   R# V R ,          pVP                   p\        VR4      '       g   R# VP                  p\        4       pVP	                  V4       RV 9   d#   V R,          P                   P	                  V4       VP                  V4      pVP                  V4       RV 9   d%   V R,          P                   P                  V4       R# R# )r  NVarStorer  )r0  r  r  r7   Zcollect_device_varidxessubset_varidxesZremap_device_varidxes)r&   Zgdefr0  storeusedVarIdxes
varidx_maps   &     r   
_pruneGDEFr    s    T<DJJE5*%%NNE5L 
!!,/~V22<@ &&|4J 

+~V00< r(   c                sn   V P                   pVP                  '       d$   VP                  P                  '       g   R Vn        VP                  '       d$   VP                  P                  '       g   R Vn        VP
                  '       d$   VP
                  P                  '       g   R Vn        VP                  '       d$   VP                  P                  '       g   R Vn        \        VR4      '       d?   \        V4       VP                  P                  ^ 8X  d   VP                  R8X  d   RVn        \        VR4      '       d/   VP                  '       d   VP                  P                  '       g    R Vn        VP                  R8X  d   RVn        \        VP                  ;'       g    VP                  ;'       gw    VP
                  ;'       gc    VP                  ;'       gO    VP                  R8  ;'       d    VP                  ;'       g$    VP                  R8  ;'       d    VP                  4      # )Nr  i  i  r  r  )r0  r  r  r  r@   r  r  rv   r  r  r  ZVarDataCountr  r  rr   rX   r  r   r   r   r   	  s   JJE%"4"4"B"B"B!(@(@(J(J(J#' 5#6#6#@#@#@" 0 0 ; ; ;uj!!4>>&&!+}}
* *E-..%%%%%...!%==J&&EM 	< 	<##	< 	<	< 	< 	< 	< MMZ'BBE,B,B		< 	<
 MMZ'::ENN r(   kernc                s    V P                    Uu. uF  p\        VR 4      '       g   K  VNK  	  upV n         \        V P                   4      # u upi )	kernTable)
kernTablesr  rX   r$   r&   r   tr   r   r  r  0	  s>     #'//M/QWQ5Lqq/MDO   Ns
   AAc           	     s~   VP                   pV P                   FM  pVP                  P                  4        UUUu/ uF  w  w  rEpWB9   g   K  WR9   g   K  WE3VbK  	  upppVn        KO  	  V P                   Uu. uF  q3P                  '       g   K  VNK  	  upV n        \	        V P                  4      # u upppi u upi r   )r  r  r  rD   rX   )r$   rU   r%   r  r   r   rE      &&     r   rZ   rZ   7	  s    __F__ [[..0
0	{  { QFAI0
  #'//A/Q[[qq/ADO  

 Bs   B3
B3
B3
8B:B:Zvmtxc                s    \        V P                  VP                  4      V n        VP                   F  pRV P                  V&   K  	  \	        V P                  4      # )r    r    r    )r,   metricsr%   glyphs_emptiedrX   r$   rU   r   r+   r   rZ   rZ   D	  sD    ahh7DL Q r(   Zhmtxc                s    \        V P                  VP                  4      V n        VP                   F  pRV P                  V&   K  	  R# )r    Tr  )r,   r  r%   r  r  r+   r   rZ   rZ   L	  s8    ahh7DL Q r(   hdmxc           	     s>   V P                   P                  4        UUu/ uF  w  r#V\        W1P                  4      bK  	  uppV n         V P                    F,  pVP                   F  p^ V P                   V,          V&   K  	  K.  	  \        V P                   4      # u uppi r   )r  rD   r,   r%   r  rX   )r$   rU   Zszr/   r   r  r   rZ   rZ   T	  s{    <@IIOO<MN<M52\!XX..<MNDIii!!A DIIbM! "  		?	 Os   !BZankrc                s    V P                   P                  pVP                   Uu/ uF(  q3VP                  9   g   K  W2P                  V,          bK*  	  upVn        \	        VP                  4      ^ 8  # u upi r   )r0  ZAnchorPointsr%   ZAnchorsr.   r$   rU   r0  r[   r3   r   rZ   rZ   ]	  se    JJ##E 2319emm=S#}}U##EM u}}!!s
   A3A3bslnc                s    V P                   P                  pVP                  R9   d(   VP                  P	                  VP
                  4       R# R# )rx   N)rx   ry   )r0  Baselinerq   r%   r4  ZStandardGlyph)r$   rU   r0  r+   r   rW   rW   g	  s8    JJE||v	U(() r(   c                s6   V P                   P                  pVP                  R9   d   VP                   Uu/ uF(  pW2P                  P                  W2P                  4      bK*  	  pp\        V4      ^ 8  dc   \        VP                  4       4      P                  ^4      ^ ,          w  rVWRn        VP                  4        UUu/ uF  w  r7Wu8w  g   K  W7bK  	  ppp\        V4      ^ 8  d	   WBn        R# ^^ ^^/VP                  ,          Vn        V=R# u upi u uppi )rl   T)rl   ry   )r0  r  rq   r%   ZBaselineValuesrB  ZDefaultBaseliner.   r   rJ   most_commonrD   )r$   rU   r0  r[   Z	baselines
mostCommon_cntr      &&      r   rZ   rZ   n	  s   JJE||v 
! ''++E3H3HII! 	 
 y>A&y'7'7'9:FFqI!LJ$.!2;//2CW2Cheq2CIWy>A#,   q!Q<5EL$
 Xs   .D 
DDZlcarc                s   V P                   P                  pVP                  R9   d]   VP                   Uu/ uF(  q3VP                  9   g   K  W2P                  V,          bK*  	  upVn        \        VP                  4      ^ 8  # R# u upi )r    N)r    rl   )r0  ZLigatureCaretsrq   r%   ZCaretsr.   r  r3   r   rZ   rZ   	  st    JJ%%E||v45HH
4<5@U&E<<&&H
 5<< 1$$	 
s   BBgvarc                s    VP                   '       d3   VP                  '       g!   . V P                  VP                  ^ ,          &   R# r    T)notdef_glyphnotdef_outline
variations
glyphOrderr   r   r   r  r  	  s3    G$:$:$:.0*+r(   c                s    \        V P                  VP                  4      V n        \        V P                  4      V n        \        V P                  4      # r   )r,   r  r%   r.   Z
glyphCountrX   r@  r   r   rZ   rZ   	  s7    "4??AHH=DO$//*DO  r(   c                s2   VP                   P                  4        UUu/ uF  w  r4W1V,          bK  	  pppWP                   V P                  ,          ,          pV P                  P                  4        F  w  rxWP                  8  d   TM^ WW&   K  	  V# u uppi r   )rS   rD   last_retained_glyphreverseEmptiedGlyphMaplast_retained_order)	rU   r  Z	table_mapr   rE   Zmap_Zlast_idxr   r2   s	   &&&      r   _remap_index_mapr  	  s    )2):):)@)@)BC)BA!})BDC ++A,A,ABCH((..0"7"77(Q 1K Ds   BZHVARc                sb   V P                   p\        4       p\        4       pR pVP                  '       dn   \        VP                  P                  VP
                  4      VP                  n        VP                  VP                  P                  P                  4       4       MOVP                  VP                  P                  4       4       VP                  4       pVP                  P                  pVP                  '       dm   \        VP                  P                  VP
                  4      VP                  n        VP                  VP                  P                  P                  4       4       VP                  '       dm   \        VP                  P                  VP
                  4      VP                  n        VP                  VP                  P                  P                  4       4       VP                  P                  W5VR7      pVP                  '       d&   \!        WVP                  4      VP                  n        VP                  '       d&   \!        WVP                  4      VP                  n        VP                  '       d&   \!        WVP                  4      VP                  n        R# F)ZretainFirstMapZadvIdxesT)r0  r7   ZAdvWidthMapr,   rS   r%   rR   rJ   reverseOrigGlyphMapcopyr   retain_gidsZLsbMapZRsbMapr  r  r  r$   rU   r0  ZusedZ	advIdxes_ZretainAdvMapr  r  r   rZ   rZ   	  s   JJE5DIL$01B1B1J1JAHH$U!E%%--4467A))0023IIK	yy,,|||+ELL,@,@!((KELL((//12|||+ELL,@,@!((KELL((//12//I 0 J $4QEDUDU$V!|||/u||L|||/u||L r(   ZVVARc                s   V P                   p\        4       p\        4       pR pVP                  '       dn   \        VP                  P                  VP
                  4      VP                  n        VP                  VP                  P                  P                  4       4       MOVP                  VP                  P                  4       4       VP                  4       pVP                  P                  pVP                  '       dm   \        VP                  P                  VP
                  4      VP                  n        VP                  VP                  P                  P                  4       4       VP                  '       dm   \        VP                  P                  VP
                  4      VP                  n        VP                  VP                  P                  P                  4       4       VP                  '       dm   \        VP                  P                  VP
                  4      VP                  n        VP                  VP                  P                  P                  4       4       VP                  P!                  W5VR7      pVP                  '       d&   \#        WVP                  4      VP                  n        VP                  '       d&   \#        WVP                  4      VP                  n        VP                  '       d&   \#        WVP                  4      VP                  n        VP                  '       d&   \#        WVP                  4      VP                  n        R# r  )r0  r7   ZAdvHeightMapr,   rS   r%   rR   rJ   r  r  r   r  ZTsbMapZBsbMapZVOrgMapr  r  r  r  r  r   rZ   rZ   	  s,   JJE5DIL%1%2D2D2L2Lahh%W"E&&..5578A))0023IIK	yy,,|||+ELL,@,@!((KELL((//12|||+ELL,@,@!((KELL((//12}}} ,U]]-B-BAHH MEMM))0023//I 0 J %5aUEWEW%X"|||/u||L|||/u||L}}} 0 N r(   ZVORGc                s    V P                   P                  4        UUu/ uF  w  r#W!P                  9   g   K  W#bK  	  uppV n         \        V P                   4      V n        R # u uppi r   )ZVOriginRecordsrD   r%   r.   ZnumVertOriginYMetricsrY   r3   r   rZ   rZ   	  s[     ,,2244XX4D "%T%8%8!9D	s
   A"A"Zopbdc                s   V P                   P                  pVP                  ^ 8X  d]   VP                   Uu/ uF(  pW2P                  9   g   K  W2P                  V,          bK*  	  upVn        \        VP                  4      ^ 8  # VP                  ^8X  d]   VP                   Uu/ uF(  pW2P                  9   g   K  W2P                  V,          bK*  	  upVn        \        VP                  4      ^ 8  # R# u upi u upi r   )r0  ZOpticalBoundsrq   r%   ZOpticalBoundsDeltasr.   ZOpticalBoundsPointsr  r3   r   rZ   rZ   
  s    JJ$$E||q %
!111 4E,,U33!%
!
 5,,-11		 %
!111 4E,,U33!%
!
 5,,-11 
%
%
s   C3C3#C8:C8postc                s8    VP                   '       g   R V n        R# )      @T)glyph_names
formatTyper   r   r   r  r  
  s    r(   c                s    . V n         R # r   )Z
extraNamesr@  r   r   rZ   rZ   
  s    DOr(   propc                s   V P                   P                  pVP                  ^ 8X  d   VP                  ^ 8g  # VP                  ^8X  d   VP                   Uu/ uF(  q3VP
                  P                  W2P                  4      bK*  	  upVn        \        VP
                  P                  4       4      P                  ^4      ^ ,          w  rEWBn        VP
                  P                  4        UUu/ uF  w  r2W$8w  g   K  W2bK  	  uppXn        \        VP
                  4      ^ 8X  d   V=^ Vn        VP                  ^ 8g  # R# R# u upi u uppi )r    TN)r0  ZGlyphPropertiesrq   ZDefaultPropertiesr%   Z
PropertiesrB  r   rJ   r  rD   r.   )r$   rU   r  r   r  r  r   r   rZ   rZ   #
  s   ::%%D{{a%%**		GHxx
GO!t""1&<&<==x
 #4??#9#9#;<HHKAN
!+#'??#8#8#:
#:d>PGAG#:
 t1$DK))Q.. 



s   .D>*
E9Ec                sJ   a \        4       oV3R  lpV P                  W4       S# )c                s   < V P                   \        P                  P                  \        P                  P                  09   d   SP                  V P                  4       R # R # r   )rq   r   ZPaintFormatZ
PaintGlyphZPaintColrGlyphr4  Glyph)paintresult   &r   callbackZ$_paint_glyph_names.<locals>.callback=
  sI    <<  ++  //
 
 JJu{{#	
r(   )r7   traverse)r  colrr  r  s   && @r   _paint_glyph_namesr  :
  s"    UF$ 
NN4"Mr(   COLRc                s   V P                   ^ 8  dk   V P                  V P                  4      V n        V P                  P                  P
                   Uu/ uF  pVP                  VP                  bK  	  upV n        VP                  pV'       d   \        4       pV F  pV P                  P                  V. 4       F  pVP                  VP                  4       K   	  V P                   ^ 8  g   KT  V P                  P                  V4      pVf   Ku  VP                  \        WpP                  4      4       K  	  WAP                  ,          pVP                  P                  V4       TpK  R# u upi r   )versionZ_decompileColorLayersV0r0  ColorLayersBaseGlyphListBaseGlyphPaintRecordZ	BaseGlyphPaintColorLayersV1r%   r7   rB  r4  r   rR   r  )r$   rU   r   	decomposelayersr   layerr  r  r   rW   rW   H
  s   ||a
  77

C zz//DD
D MM399$D

 I
A))--a4

5::& 5 ||a**..q1$MM"4UJJ"GH  	((		 
s    E,c                s~   ^ RI Hp ^ RIHpHp VP
                  Vn        VP                   Uu/ uF(  qUV P                  9   g   K  WPP                  V,          bK*  	  upV n        V P                  ^ 8X  d   \        V P                  4      # V! V P                  P                  V P                  P                  4      pT! V Uu/ uF  qUVP                  9   g   K  WVV,          bK   	  up4      w  V P                  n        V P                  n        V =V P                  P                  ee   V P                  P                  P                  pV Uu/ uF  qUVP                  9   g   K  WWV,          bK   	  upV P                  P                  n        V P                  pV P                  P                  P                   '       g   ^ V n        V =
\        V4      # T! V P                  V UU	u/ uF0  qUW,           U	u. uF  qP"                  V	P$                  3NK  	  up	bK2  	  up	p4       V =R# u upi u upi u upi u up	i u up	pi )r    )unbuildColrV1)buildColrV1populateCOLRv0T)ZfontTools.colorLib.unbuilderr  ZfontTools.colorLib.builderr  r  Zglyphs_colredr%   r  r  rX   r0  Z	LayerListr  r  ZClipListclipsr  r   colorID)
r$   rU   r  r  r  r   ZcolorGlyphsV1r  ZlayersV0r  r  r   rZ   rZ   f
  s   :F AH )*(019I9I4IAD ||qD$$%%!$**"6"6

8P8PQM5@&3EmAHH}	!	mE62DJJ$**2 	zz&

##)):?$Q%Q=[Qa[%$Q

!H::##888JH~

LTUHqhkBkUjj%--(kB	BHU 	 = 	F %R CUs;   H%H%H*H*H/"H/#H92 H4H94H9CPALc                s>  a R V9   d   R# VP                  R4      pV'       g   R# \        \        4      oV3R lpVP                  ^ 8X  dN   VP                  P                  4        F.  pV F%  pSVP                  ,          P                  V4       K'  	  K0  	  MVP                  P                  '       dJ   VP                  P                  P                   F%  pSVP                  ,          P                  V4       K'  	  VP                  P                  P                   F)  pVP                  P                  VP                  V4       K+  	  \!        SP#                  4       4      R0,
          pV P$                   F-  p	\'        V	4       U
Uu. uF  w  rW9   g   K  VNK  	  upp
V	R&   K/  	  \'        \)        V4      4       FR  w  rSV,           F@  p\+        VR4      '       d	   Wn        K  \+        VR4      '       d	   Wn        K7  \-        V4      h	  KT  	  \/        V P$                  ^ ,          4      V n        V P                  ^8X  d@   . p\'        V P2                  4       F  w  rW9   g   K  VP                  V4       K   	  Wn        \5        V P0                  4      # u upp
i )	zSVG Tr  Fc                s  < \        V R 4      '       d%   SV P                  ,          P                  V 4       R# \        V R4      '       dB   V P                  P                   F%  pSVP                  ,          P                  V4       K'  	  R# R# )PaletteIndex	ColorLineN)r  r  rw  r  Z	ColorStop)r  Zstopcolors_by_indexr   r   collect_colors_by_indexZ2prune_post_subset.<locals>.collect_colors_by_index
  sh    5.))E../66u=UK((11 1 1299$? 2 )r(   rt  rv  r  r  )rB  r   rI   r  r  rJ   r  rw  r0  ZLayerRecordArrayZLayerRecordr  r  r  r  r  r7   rk  Zpalettesr5   r"   r  ZAssertionErrorr.   ZnumPaletteEntriesZpaletteEntryLabelsrX   )r$   r&   r   r  r  r  r  r  Zretained_palette_indicesZpaletter2   re   Z	new_indexZ	old_indexZkept_labelsZlabelr  s   &&&             @r   r   r   
  s    ~88FD!$'O@ ||q&&--/F.55e<   0 ::&&&44@@ 2 23::5A Ajj..CCFLL!!$**.EF D
  #?#7#7#9:fXE==$-g$6X$6DA!:Waa$6X
 ! !*&1I*J K	%i00Fvy))!*00&/#$V,, 1 !L !q!12D||q!$"9"9:HA,""5) ; #.&&'') Ys   	
JJc                s
   \        4       pV P                   F  pVP                  VP                  4       K   	  V P                  '       d9   V P                  P
                   F  pVP                  VP                  4       K   	  V# r   )r7   ZMathGlyphVariantRecordr4  ZVariantGlyphZGlyphAssemblyZPartRecordsr[   )r$   r%   variantsrE   r   r  r   rW   rW   
  s`    uH((Q^^$ )##//ALL! 0Or(   c                s   \        VP                  4      p\        4       pV P                  '       dV   V P                  P	                  V4      pV F4  pVP                  V P                  V,          P                  V4      4       K6  	  V P                  '       dV   V P                  P	                  V4      pV F4  pVP                  V P                  V,          P                  V4      4       K6  	  VP                  P                  V4       R # r   )
r/  r%   r7   VertGlyphCoverager6   rR   VertGlyphConstructionrW   HorizGlyphCoverageHorizGlyphConstruction)r$   rU   r%   r  r0   r2   r   r   rW   rW   
  s    qxx FuH((226:AOOD66q9HHPQ  ))33F;AOOD77:II&QR  HHOOHr(   VARCc                s8   V P                   P                  P                  VP                  4      p\	        V P                   P
                  P                  V4      V P                   P
                  n        \        V P                   P
                  P                  4      # r   )r0  rr   r;   r%   r4   VarCompositeGlyphsVarCompositeGlyphrX   r$   rU   r0   r+   r   rZ   rZ   
  si    jj!!((2G6B

%%777DJJ!!3 

--??@@r(   c                s^   V P                   P                  f   R # \        V P                   P                  P                  4       UUu/ uF  w  r#W2bK	  	  pppV P                   P                  P
                  pVP                  p\        4       p\        V4      pV'       d   Tp	\        4       pV	 Fs  pW79   d   K  VP                  V4      p
V
f   K"  WZ,          pVP                   F9  pVP                  pVP                  V4       W9  g   K(  VP                  V4       K;  	  Ku  	  K  R # u uppi r   )r0  r  r5   rr   r%   r  r7   rB  
components	glyphNamer4  )r$   rU   r2   r  ZglyphMapZglyphRecordsr%   rE  newZoldNewZidxr[   compr      &&            r   rW   rW   
  s    zz$$,1:4::;N;N;U;U1VW1V	1VHW::00BBLXXFeG
f+C
eI#,,y)C{ %E((~~

4 &GGDM	 )    Xs   D)c                s(   V P                   pVP                  pVe>   \        4       pVP                  V4       VP	                  V4      pVP                  V4       VP                  P                  pVEe    \        4       pVP                  P                   FA  p	V	P                   F.  p
V
P                  f   K  VP                  V
P                  4       K0  	  KC  	  \        V4      p\        Wx4      VP                  n        \        V4       UUu/ uF  w  rWbK	  	  pppVP                  P                   F=  p	V	P                   F*  p
V
P                  f   K  WP                  ,          V
n        K,  	  K?  	  VP                   pVEe   VP"                  p\        4       pVP                  P                   FA  p	V	P                   F.  p
V
P$                  f   K  VP                  V
P$                  4       K0  	  KC  	  \        V4      p\        W4      Vn        \        V4       UUu/ uF  w  rWbK	  	  pppVP                  P                   F=  p	V	P                   F*  p
V
P$                  f   K  WP$                  ,          V
n        K,  	  K?  	  R# u uppi u uppi r   )r0  ZMultiVarStorer7   Zcollect_varidxesr  Zremap_varidxesZAxisIndicesListZItemr  r  r  ZaxisIndicesIndexr4  r"   r4   r5   ZConditionListZConditionTableZconditionIndex)r$   r&   r   r0  r  r  r  ZaxisIndicesListZusedIndicesr[   r  r  ZoldrS   ZconditionListZconditionTabless   &&&             r   r   r     s+   JJEEu|,**<8
Z(++00O"e--??E((((4OOD$9$9: ) @ [)%1/%O",5k,BC,B38,BC--??E((((4,34I4I,JD) ) @
 ''M '66e--??E((&&2OOD$7$78 ) @ [)'3O'Q$,5k,BC,B38,BC--??E((&&2*12E2E*FD' ) @
 - D  Ds   JJMATHc                s    V P                   P                  '       d(   V P                   P                  P                  V4       R # R # r   )r0  MathVariantsrW   r@  r   r   rW   rW   F  s/    zz

..q1 r(   c                    V P                   P                  VP                  4      p\        V P                  V4      V n        \        V P                  4      V n        \        V P                  4      # r   )rr   r;   r%   r4   ZItalicsCorrectionr.   ZItalicsCorrectionCountrX   r  r+   r   rZ   rZ   L  sS    mm""188,G)$*@*@'JD"%d&<&<"=D++,,r(   c                r  r   )ZTopAccentCoverager;   r%   r4   ZTopAccentAttachmentr.   ZTopAccentAttachmentCountrX   r  r+   r   rZ   rZ   T  sU    $$++AHH5G+D,D,DgND$'(@(@$AD!--..r(   c                r  r   )ZMathKernCoverager;   r%   r4   ZMathKernInfoRecordsr.   ZMathKernCountrX   r  r+   r   rZ   rZ   \  sU    ##**1884G+D,D,DgNDT556D""##r(   c                s   V P                   '       d   V P                   P                  V4       V P                  '       d   V P                  P                  V4       V P                  '       d   V P                  P                  V4       V P                  '       d&   V P                  P                  VP                  4       R # r   )MathItalicsCorrectionInforZ   MathTopAccentAttachmentMathKernInfoZExtendedShapeCoverager;   r%   r@  r   r   rZ   rZ   d  s    %%%&&44Q7###$$2215''*!!!""))!((3r(   c                s   V P                   '       d[   V P                   P                  VP                  4      p\        V P                  V4      V n        \        V P                  4      V n        V P                  '       d[   V P                  P                  VP                  4      p\        V P                  V4      V n        \        V P                  4      V n	        R # r   )
r  r;   r%   r4   r  r.   ZVertGlyphCountr  r   ZHorizGlyphCountr  r+   r   rZ   rZ   q  s    ((//9%1$2L2Lg%V"!$"<"<=))00:&243N3NPW&X#"4#>#>?r(   c                s,   VP                   Vn        V P                  P                  '       d&   V P                  P                  P	                  V4       V P                  P
                  '       d&   V P                  P
                  P	                  V4       R # r   )glyphs_mathedr%   r0  MathGlyphInforZ   r  r@  r   r   rZ   rZ     s`    AHzz

  ..q1zz

--a0r(   glyfc                s   V P                   '       d5   \        P                  ! R V P                   R,          4      ^ ,          ^ 8  d   R# \        V P                   4      ;q n         ^
p^pV'       Ed   W#,          ^,          W#^,           ,          ,          pW#^,           ,          ^,          W#^,           ,          ,          pW,          pV^,	          W#^,           &   V^,          W#^,           &   V^,          p\	        V4      pV^,          '       d   V^,          pM	V^,          pV^,          '       d   V^,          pM1V^@,          '       d   V^,          pMV^,          '       d
   V^,          pV^ ,          pEK  R# )z>h:Nrx   NN)datastructunpackZ	bytearrayr   )r$   Z
glyphidmapr  r2   ZmoreZflagsZglyphIDr  r   remapComponentsFastr    s   999dDIIbM:1=B ++D9
AD
$A!e,A;!#tE{2%lUnU	QE
6>>FAFA6>>FAV^^FAV^^FAv~) r(   c                s@   V P                   pVP                   pV'       d~   \        4       pV F<  pWR9  d   K  W%,          pVP                  V 4       F  pVP                  V4       K  	  K>  	  WAP                   ,          pVP                   P	                  V4       TpK  R # r   )r%   r7   ZgetComponentNamesr4  rR   )r$   rU   ZglyphSetr  r  r   Zglre   r  r   rW   rW     s    {{HI
U
A B))$/q! 0	  	hh
	
#	 r(   c                s    VP                   '       dM   VP                  '       g;   W P                  ^ ,          ,          pVP                  P	                  4        RVn        R# )r    r(   T)r  r  r  Z__dict__clearr  )r$   r&   r   r   r   r   r  r    sD    G$:$:$:#$	

r(   c                s*   \        V P                  VP                  4      V n        VP                  P                  '       g   \	        V P
                  4       UUu. uF  w  r#W1P                  9   g   K  VNK  	  ppp\	        V4       UUu/ uF  w  rVWebK	  	  pppV P                  P                  4        F(  p\        VR 4      '       g   K  VP                  V4       K*  	  \        P                  ! R4      P                  p	VP                   F/  pV	! 4       V P                  V&   RV P                  V,          n        K1  	  V P
                   Uu. uF'  q3VP                  9   g   W1P                  9   g   K%  VNK)  	  upV n        R# u uppi u uppi u upi )r  r  r(   T)r,   r%   r   r  r5   r  rJ   r  r  r   getTableModuler  r  r  )
r$   rU   r2   r   r0   r  ZoZglyphmaprE   r  r  r   rZ   rZ     s4   t{{AHH5DK99   !*4??!;M!;qHH}11!;M%.w%78%7TQAD%78##%Aq&!!%%h/ &   (..EA!A  ??"a188mq<L<L7L?DO  N8s   F3F
F
"F4Fc                s    VP                   '       * pV P                  P                  4        F  pVP                  VR 7       K  	  R# ))remove_hintingT)r   r%   rJ   Ztrim)r$   r&   r   r  rE   r\   r   r   r     s6     (N[[!	n- "r(   cmapc                s  a V P                    Uu. uF  q"P                  4       '       g   K  VNK  	  ppVP                  P                  '       d[   \	        4       pVP
                   F%  p\        V4      pVf   K  VP                  V4       K'  	  VP
                  P                  V4       V EF  pVP                  ^8X  d   VP                  P                  4        Fr  w  poWP
                  9  d   K  S UU	u0 uF  w  rYWQP
                  9   g   K  V	kK  	  p
pp	R V
9   d   V
P                  R 4       VP                  P                  V
4       Kt  	  K  VP                  oVP
                  P                  SP!                  4       4      pVP                  P                  V3R lV 4       4       EK  	  VP
                  P#                  4       Vn        V F(  pVP$                  P'                  VP                  4       K*  	  R # u upi u up	pi )Nc              3  r   r   r   )r   ur  r   r   r   rP     s     :\DGG\r    )tables	isUnicoder   bidi_closurer7   unicodes_requestedr   r4  rR   formatuvsDictrD   r  r%   r  r   rk  r  unicodes_missingZdifference_update)r$   rU   r  r  Zadditional_unicodesr  Zmirror_ur0  ZvarSelectorr   r%   r   r  s   &&          @r   rW   rW     s   6AaaF6 	yy!e%%A{H##''1 & 	
##$78 <<2%*]]%8%8%:!T&:&::(,J5I5I0I!!J6>MM$'' &; ::D//<<TYY[ILHHOO:\::  --224A	,,UZZ8 9 7" Ks   HH8H
H
c                s   VP                   '       gO   V P                   Uu. uF2  q3P                  4       '       g   VP                  4       '       g   K0  VNK4  	  upV n        VP                  '       g9   V P                   Uu. uF  q3P                  4       '       d   K  VNK  	  upV n        V P                   Uu. uF  q3P
                  ^ 8w  g   K  VNK  	  upV n        \        V P                  4      V n        R# u upi u upi u upi r  )legacy_cmapr  r  ZisSymbolsymbol_cmapr   r.   numSubTablesr  r   r   r  r    s    "&++O+Q!**,qq+O"&++B+QZZ\qq+B #kk;kXX]11k;DKDKK(D PB <s#   -C:C:C?C?9DDc                s   R Vn         . p/ p/ pV P                   EFN  pVP                  ^ 8X  d    VP                  ^8X  d   WSVP                  &   VP                  ^8X  d    VP                  ^8X  d   WTVP                  &   VP
                  ^8X  d   VP                  P                  4        UUUU	u/ uFQ  w  rgWaP                  9   g   K  TV UU	u. uF*  w  rWP                  9   g   WP                  9   g   K'  W3NK,  	  up	pbKS  	  up	pppVn        VP                  P                  4        UUu/ uF  w  rgV'       g   K  WgbK  	  uppVn        EK6  VP                  4       '       d   VP                  P                  4        UU	u/ uF)  w  rWP                  9   g   WP                  9   g   K'  WbK+  	  up	pVn        VP
                  ^8X  dU   VP                  '       d@   \        VP                  P                  4       4      R8  d   VP                  V4       EK   EK  EK  EK	  VP                  P                  4        UU	u/ uF  w  rWP                  9   g   K  WbK  	  up	pVn        EKQ  	  V F  pVP                  ^ 8X  dj   VP                  ^8X  dY   VP                  V9   dH   W5P                  ,          P                  VP                  8X  d   VP                  P                  4        K}  VP                  ^8X  g   K  VP                  ^
8X  g   K  VP                  V9   g   K  WEP                  ,          P                  VP                  8X  g   K  VP                  P                  4        EK   	  V P                   Uu. uF>  qUP
                  ^8w  d   VP                  '       g   K'  MVP                  '       g   K<  VNK@  	  upV n        \!        V P                  4      V n        R# u up	pi u up	pppi u uppi u up	pi u up	pi u upi )Nr  T)r%   r  
platformID	platEncIDZlanguager   r!  rD   r  glyphs_requestedr  r  maxrk  rw  r  r.   r%  )
r$   rU   Ztables_format12_bmpZtable_plat0_enc3Ztable_plat3_enc1r  rE   r/   r  r   r  r   rZ   rZ     s   AH[[<<1!1+,QZZ(<<1!1+,QZZ(88r> IIOO- .DA,,, ! !...!7K7K2K QF ! 
 .AI +,))//*;A*;$!q*;AAI[[]] FFLLN*DA***a3G3G.G *AF xx2~!&&&S-?'-I#**1- .J&~ ()vv||~Q~tq>P>P9Pdad~QAF? F !LLAq 

.. ,11QVV;FFLLNLLAr!

.. ,11QVV;FFLLN !  #kkWkBaff1fAII11kWDKDKK(D [ B R( XsZ   .O-O-$O'6O'=O--O5>O5$O;,O; PP?$P(P=P'O-DSIGc                s"    ^ V n         . V n        R# r  )Z	usNumSigsZsignatureRecordsr   r   r   r  r  R  s     DNDr(   maxpc                s    VP                   '       gC   V P                  R 8X  d2   ^V n        ^ V n        ^ V n        ^ V n        ^ V n        ^ V n        ^ V n        R# )r  T)	r   ZtableVersionZmaxZonesZmaxTwilightPointsZ
maxStorageZmaxFunctionDefsZmaxInstructionDefsZmaxStackElementsZmaxSizeOfInstructionsr   r   r   r  r  Z  sR    ???
*DM%&D"DO#$D &'D#$%D!)*D&r(   r   c                s   \        4       pVP                  V4       \        VP                  4      VP                  ,          pR VP                  9   d?   Y@P
                   Uu0 uF!  qUP                  R8  g   K  VP                  kK#  	  up,          pV P
                   Uu. uF  qUP                  V9   g   K  VNK  	  upV n        VP                  '       g9   V P
                   Uu. uF  qUP                  4       '       g   K  VNK  	  upV n        R VP                  9  d>   V P
                   Uu. uF!  qUP                  VP                  9   g   K  VNK#  	  upV n        VP                  '       Ed   . pVP                  P                  \        4      pV'       d   \        W4       V P
                   F  pVP                  R9   d0   VP                  4       '       d   RP                  R4      MRVn        MlVP                  R9   d0   VP                  4       '       d   RP                  R4      MRVn        M,VP                  ^8X  d	   RVn        MVP                  R	9   d   K  VP#                  V4       K  	  W`n        R# u upi u upi u upi u upi )
r   i   z.Z	utf_16_beZr   T)rl      )rx      )         )r   Zvisitr7   name_IDsZseenr  nameIDname_legacyr  name_languageslangIDobfuscate_namesr   NAME_IDS_TO_OBFUSCATE_remap_select_name_idsencodestringrw  )r$   r&   r   ZvisitorZnameIDsr  ZnamerecsneedRemappingrG  r   r   r   k  s   !GMM$'""#gll2G
gjjCjHHsNHAHHjCC!ZZ?Z88w+>!!Z?DJ "&=A{{}aa=

'(((!%RAxx7;Q;Q/QaaR
  112GH"47Axx6!:;++--7>>+6WV#9:6==5FQ\)OOA  
9 D? > Ss0   !I;8I;J 6J $J J-J
J
c               s$    V ^8  d   QhRRRRRR/# )rx   r&   zttLib.TTFontr;  zset[int]ZreturnZNoner   )r   s   "r   __annotate__r<    s+     CT CT CTh CT4 CTr(   c                s   RV 9  d
   RV 9  d   R# V R,          pVP                    Uu0 uF  q3P                  kK  	  pp/ pVP                  4       ^,
          pV F"  pV^,          pVR8  d   \        R4      hWeV&   K$  	  . pVP                    Fn  pVP                  V9  d   K  \	        VP
                  WSP                  ,          VP                  VP                  VP                  4      p	VP                  V	4       Kp  	  VP                   P                  V4       V P                  R4      p
V
e   V
P                   F.  pVP                  VP                  VP                  4      Vn        K0  	  V
P                   FG  pVP                  pVP                  W4      Vn        VP                   pVP                  W4      Vn        KI  	  V P                  R4      pVf   R# VP"                  P$                  pVP                  W4      VP"                  n        VP"                  P&                  '       dS   VP"                  P&                  P(                   F.  pVP                  VP*                  VP*                  4      Vn        K0  	  VP"                  P,                  '       dU   VP"                  P,                  P.                   F.  pVP                  VP0                  VP0                  4      Vn        K0  	  R# R# u upi )a'  Remap a set of IDs so that the originals can be safely scrambled or
dropped.

For each name record whose name id is in the `needRemapping` set, make a copy
and allocate a new unused name id in the font-specific range (> 255).

Finally update references to these in the `fvar` and `STAT` tables.
fvarSTATNr   i  z8Ran out of name IDs while trying to remap existing ones.)r  r2  Z_findUnusedNameIDZ
ValueErrorr   r:  r&  r'  r5  rw  rW  rB  ZaxesZ
axisNameIDZ	instancesZsubfamilyNameIDZpostscriptNameIDr0  ZElidedFallbackNameIDZDesignAxisRecordZAxisZ
AxisNameIDZAxisValueArrayZ	AxisValueZValueNameID)r&   r;  r   r  ZexistingIdsZ	remappingZnextIdZnameIdZcopiedRecordsZ
recordCopyr=  ZaxisZinstancer2  ZstatZelidedNameIDZvalues   &&               r   r8  r8    sU    TfD0<D 04zz:zV==zK:I##%)F!E>WXX"&   M**==-MMmm$MM

 	Z(  	JJm$
 88FDIID'mmDOOT__MDO H--F'0}}V'DH$..F(1f(EH%	 ' 88FD|::22L&/mmL&ODJJ#zz"""JJ//44D'mmDOOT__MDO 5zz   ZZ..88E )e.?.?ARAR SE 9 !c ;s   K1headc                r   r   r   r   r   r   r   r     s     r(   c                  s>   ] tR tRt ! R R]4      t ! R R]4      t. ROt]. RO,          t. R Ot. R!Ot	R. R"OR. R#OR. R$OR	. R%OR
RR.RRR.RR.RR.R. R&OR. R'OR. R(OR. R)OR. R*OR. R+O/t
]! ]! ]! ]
P                  4       4      . 4      4      tR tR t. 3R ltRtR# ),Optionsi  c                      ] tR tRtRtR# )Options.OptionErrori  r   Nr  r  r  r  r  r   r(   r   OptionErrorrB        r(   rD  c                  rA  )Options.UnknownOptionErrori  r   NrC  r   r(   r   UnknownOptionErrorrF    rE  r(   rG  ZcommonZ	fractionsZ
horizontalZverticalZltrZltraZltrmZrtlZrtlaZrtlmZrandZjustifyZjaltZprivateZeast_asian_spacingZarabicZhangulZtibetanZindicc                	s   V P                   R ,          V n        V P                  R ,          V n        RV n        V P
                  R ,          V n        RV n        RV n        V P                  R ,          V n
        R.V n        RV n        RV n        RV n        RV n        RV n        RV n        . ROV n        RV n        R.V n        RV n        RV n        RV n        RV n        RV n        RV n        RV n        RV n        RV n        RV n        RV n        RV n         RV n!        RV n"        RV n#        \H        PJ                  V n&        RV n'        RV n(        RV n)        RV n*        RV n+        RV n,        RV n-        V P\                  ! R/ VB  R# )	rv  FTr   i	  N)r    rl   rx   ry   r,  i   r-  r:  r   )/_drop_tables_defaultdrop_tables_no_subset_tables_defaultno_subset_tablespassthrough_tables_hinting_tables_defaulthinting_tableslegacy_kernlayout_closure_layout_features_defaultr  r  ignore_missing_glyphsignore_missing_unicodesr   r  r#  r$  r1  r3  r4  r6  r  r  r  recommended_glyphsrecalc_boundsrecalc_timestampprune_unicode_rangesprune_codepage_rangesrecalc_average_widthrecalc_max_contextcanonical_orderflavorwith_zopflidesubroutinizer   Zdefaultharfbuzz_repackerverbosetimingxmlfont_number
pretty_svglazyr  r7   )r$   kwargss   &,r   r  ZOptions.__init__K  s   44Q7 $ > >q A"'"::1= "#<<Q?"e%*"'+$   
 !%h$  #"'" %$(!%)"$)!"'# #!6!>!>	 6r(   c                	s    VP                  4        F:  w  r#\        W4      '       g   V P                  R V,          4      h\        WV4       K<  	  R# )Unknown option '%s'N)rD   r  rG  r   )r$   rf  r   rE   s   &,  r   r7   ZOptions.set  s@    LLNDA4##--.Ca.GHHDQ #r(   c                	s   . p. pV EF  pTpVP                  R 4      '       g   VP                  V4       K0  VR,          pVP                  R4      pRpVR8X  dQ   VP                  R4      '       d   VR,          p	V	R8X  d   Rp
MRp
MTp	Rp
V	P                  R	4      '       d   V	RR p	R	p
M3VRV p	V	R,          R
9   d   V	R,          R,           pV	RR p	WW^,           R p
T	pV	P	                  RR4      p	\        W	4      '       g9   VRJ g   W9   d   VP                  V4       EK  V P                  RV,          4      h\        W	4      pV
R	8X  d   \        RV: RV: 24       EK[  \        V\        4      '       d   \        V
4      p
EM?\        V\        4      '       d   \        V
4      p
EM\        V\        4      '       d   \        V
4      p
M\        V\        4      '       d   \        V
\        4      '       d   V P                  RV,          4      hV
P	                  RR4      P                  4       pVR.8X  d   . pV Uu. uF0  p\!        V4      '       d   V^ ,          R9   d   \        V^ 4      MTNK2  	  ppVR8X  d   Tp
MFVR8X  d   Tp
V
P#                  V4       M+VR8X  d%   Tp
V F  pW9   g   K  V
P%                  V4       K  	  \'        W	V
4       EK  	  W4,           # u upi )z--:rx   NNZ=zno-:ry   NNzcanonical-orderNFTZ?z-+-Z_rg  zCurrent setting for 'z' is: z5Option '%s' requires values to be specified using '=', r   Z
0123456789z+=z-=r:  )r  rw  Zfindr  replacer  rG  r~   printrY  rX   r   ZstrrI   rD  r  r.   rW  r  r   )r$   argvignore_unknownZposargsZpassthru_optionsr   Zorig_ar2   Zopr   rE   ZokZovZvvr   s   &&&            r   
parse_optsZOptions.parse_opts  s   AF<<%%q!"AsABBw<<&&"A-- !!AA::c??#2AAbqER5D=2B#2A!egJB		#s#A4##!T)R-A$++F3112G!2KLL!BCx2rBC"d##GB$$FB$$FB%%a&&**ORSS  YYsC(..0":BSUVSUa3q66adl.Bc!QiISUV9A4ZAHHRL4ZA6HHQK   DQM P ))! Ws   <6K)(r  r[  r^  rI  r\  rc  r  r_  r   rN  rR  rS  rP  r  r  re  r#  rO  r1  r4  r3  rK  r  r  r6  rL  rd  rX  rW  rY  rU  rZ  rV  rT  r  r$  ra  r`  r]  rb  N)ZJSTFr*  r  r  ZEBSCZPCLTZLTSH)ZFeatZGlatZGlocZSilfZSill)avarZBASEr=  Zgaspr?  Zhhear+  ZvheaOS/2Zlocar   cvtfpgmprepVDMXr*  r  ZMVARcvarr>  )rr  rv  rs  rt  r  ru  )ZrvrnZccmpZligaZloclZmarkZmkmkZrlig)ZfracZnumrZdnom)ZcaltZcligZcursr  Zrclt)ZvaltZvertZvkrnZvpalZvrt2)ZHarfZHARFZBuzzZBUZZ)ZchwsZvchwZhaltZvhal)
initZmediZfinaZisolZmed2Zfin2Zfin3ZcswhZmsetZstch)ZljmoZvjmoZtjmo)abvsblwsabvmblwm)ZnuktZakhnZrphfZrkrfr[  ZblwfZhalfZabvfZpstfZcfarZvatuZcjctrw  Zpresrx  ry  ZpstsZhalnZdistrz  r{  )r  r  r  r  	ExceptionrD  rG  rH  rJ  rM  Z_layout_features_groupsr   rQ  ZiterrJ   rQ  r  r7   ro  r  r   r(   r   r@  r@    s    i [  DD!, N
 	J-><F83> 
 	*3 
72f  *D(//12B7 2h  /1 K* K*r(   r@  c                  s    ] tR tRt ! R R]4      t ! R R]4      t ! R R]4      tRR	 lt. . . R
3R lt	R t
R tR tR tR tR tRtR# )	Subsetteri  c                  rA  )Subsetter.SubsettingErrori  r   NrC  r   r(   r   SubsettingErrorr~    rE  r(   r  c                  rA  )&Subsetter.MissingGlyphsSubsettingErrori  r   NrC  r   r(   r   MissingGlyphsSubsettingErrorr    rE  r(   r  c                  rA  )(Subsetter.MissingUnicodesSubsettingErrori  r   NrC  r   r(   r   MissingUnicodesSubsettingErrorr    rE  r(   r  Nc                	s    V'       g   \        4       pWn        \        4       V n        \        4       V n        \        4       V n        R # r   )r@  r   r7   r  glyph_names_requestedglyph_ids_requested)r$   r   r   r   r  ZSubsetter.__init__  s/    iG"%%%(U"#&5 r(   r   c                	s   V P                   P                  V4       \        V\        4      '       d   VP	                  R 4      pVP                  R4      p\        V4      ^,          p\        P                  ! RV,          V4       F  pV P                   P                  V4       K   	  V P                  P                  V4       V P                  P                  V4       R# )Zutf_8z	utf-32-bez>%dLN)r  rR   rY  ZbytesZdecoder9  r.   r  r  r4  r  r  )r$   r%   gidsunicodestextZ
text_utf32Zncharsr  s   &&&&&   r   populateZSubsetter.populate  s    &&x0dE"";;w'D[[-
ZA%v
;A##''* <""))&1  ''-r(   c                	s   V P                  V4       EF  pVP                  4       V P                  P                  9   gp   VP                  4       V P                  P                  9   d   V P                  P
                  '       d+   VR 8X  d>   V P                  P                  '       g"   RV9   d   \        P                  RV4       W K  \        P                  ! V4      p\        VR4      '       g   K  \        RV,          4      ;_uu_ 4        W,          pRRR4       \        RV,          4      ;_uu_ 4        XP                  WP                  4      pRRR4       X'       g   \        P                  RV4       W EKl  \        P                  RV4       EK  	  R#   + '       g   i     L; i  + '       g   i     Lc; i)	r  r  z
%s droppedr  z	load '%s'N
prune '%s'%s pruned to empty; dropped	%s pruned)_sort_tablesstripr   rI  rN  r   rO  logr!   r   r  r  timerr  r$   r&   r  clazzr0  retainr   r   _prune_pre_subsetZSubsetter._prune_pre_subset  s%   $$T*C		t||777IIK4<<#>#>> LL0006M4<<+C+C+CRVs+I'',Eu011;,-- IE .<#-.."33D,,GF /HH:C@	HH[#.3 +  .-..s   	F7F.F+.F>c           
     	s  a
 \        VP                  4       4      pVP                  4       ;V n        o
\        4       V n        V P                  P	                  V P
                  4       V P                  P	                  V
3R  lV P                   4       4       \        4       V n        V P                  P	                  V P                  P                  V4      4       V P                  P	                  V
3R lV P                   4       4       V P                  '       dX   \        P                  RV P                  4       V P                  P                  '       g   V P                  V P                  4      hV P                  P                  4       V n        \        4       V n        RV9   dP   \#        R4      ;_uu_ 4        VR,          P%                  V 4       V P                  P'                  V4       RRR4       \)        V P                  4      V n        V P                   '       dg   V P                    Uu. uF  pRV,          NK  	  pp\        P                  RV4       V P                  P,                  '       g   V P/                  V4      h?V P                  P0                  '       dx   RV9   dA   V P                  P3                  VP5                  ^ 4      4       \        P                  R	4       M0V P                  P3                  R
4       \        P                  R4       V P                  P6                  '       dz   RV9   ds   \9        \;        ^\=        VP                  4       4      4      4       F-  pV P                  P3                  VP5                  V4      4       K/  	  \        P                  R4       RV9   d   \#        R4      ;_uu_ 4        \        P                  R\=        V P                  4      4       \        P                  V P                  VR7       VR,          P%                  V 4       V P                  P'                  V4       \        P                  R\=        V P                  4      4       \        P                  V P                  VR7       RRR4       \)        V P                  4      V n        V P                  P@                  '       d   RV9   d   \#        R4      ;_uu_ 4        \        P                  R\=        V P                  4      4       \        P                  V P                  VR7       VR,          P%                  V 4       V P                  P'                  V4       \        P                  R\=        V P                  4      4       \        P                  V P                  VR7       RRR4       \)        V P                  4      V n!        R' EF'  pWa9   d   \#        RV,          4      ;_uu_ 4        \        P                  RV\=        V P                  4      4       \        P                  V P                  VR7       W,          P%                  V 4       V P                  P'                  V4       \        P                  RV\=        V P                  4      4       \        P                  V P                  VR7       RRR4       \E        V RVPG                  4        R2\)        V P                  4      4       EK*  	  RV9   d   \#        R4      ;_uu_ 4        \        P                  R\=        V P                  4      4       \        P                  V P                  VR7       VR,          P%                  V 4       V P                  P'                  V4       \        P                  R\=        V P                  4      4       \        P                  V P                  VR7       RRR4       \)        V P                  4      V n$        RV9   d   \#        R4      ;_uu_ 4        \        P                  R \=        V P                  4      4       \        P                  V P                  VR7       VR,          P%                  V 4       V P                  P'                  V4       \        P                  R!\=        V P                  4      4       \        P                  V P                  VR7       RRR4       \)        V P                  4      V n$        R"V9   d   \#        R#4      ;_uu_ 4        \        P                  R$\=        V P                  4      4       \        P                  V P                  VR7       VR",          P%                  V 4       V P                  P'                  V4       \        P                  R%\=        V P                  4      4       \        P                  V P                  VR7       RRR4       \)        V P                  4      V n%        \)        V P                  4      V n&        VPO                  4       pV PL                   Uu/ uF  qWx,          bK  	  upV n(        \S        V PP                  PU                  4       4      V n+        VP                  4       V PV                  ,          V n,        \)        4       V n-        V P                  P\                  '       dA   W PL                  ,
           Uu0 uF  pWx,          V PV                  8:  g   K  VkK   	  upV n-        V PZ                   Uu/ uF  qWx,          bK  	  upV n/        V P                  P\                  '       g%   S
 Uu. uF  qV PL                  9   g   K  VNK  	  p	pM2S
 Uu. uF&  qPa                  V4      V PV                  8:  g   K$  VNK(  	  p	pWn1        \9        \=        V	4      4       Uu/ uF  qWW,          ,          VbK  	  upV n2        \        P                  R&\=        V PL                  4      4       V =R#   + '       g   i     E
L5; iu upi   + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; iu upi u upi u upi u upi u upi u upi )(c              3  sX   <"   T F  q\        S4      8  g   K  SV,          x  K!  	  R # 5ir   r-   r   r2   glyph_orderr   r   r   ,Subsetter._closure_glyphs.<locals>.<genexpr>  s'      %
$<qCDT@TNKNN$<s   **c              3  sJ   <"   T F  q\        S4      8  g   K  Vx  K  	  R # 5ir   r-   r  r   r   r   r    s!      #
/!K8H3HAA/s   #
#zMissing requested glyphs: %sr  zclose glyph list over 'cmap'NzU+%04Xz)Missing glyphs for requested Unicodes: %sr  zAdded gid0 to subsetz.notdefzAdded .notdef to subsetz!Added first four glyphs to subsetr
  zclose glyph list over 'MATH'z0Closing glyph list over 'MATH': %d glyphs before)r&   z.Closed glyph list over 'MATH': %d glyphs afterr  zclose glyph list over 'GSUB'z0Closing glyph list over 'GSUB': %d glyphs beforez.Closed glyph list over 'GSUB': %d glyphs afterzclose glyph list over '%s'z.Closing glyph list over '%s': %d glyphs beforez,Closed glyph list over '%s': %d glyphs afterZglyphs_Zedr  zclose glyph list over 'VARC'z0Closing glyph list over 'VARC': %d glyphs beforez.Closed glyph list over 'VARC': %d glyphs afterzclose glyph list over 'glyf'z0Closing glyph list over 'glyf': %d glyphs beforez.Closed glyph list over 'glyf': %d glyphs afterzCFF zclose glyph list over 'CFF 'z0Closing glyph list over 'CFF ': %d glyphs beforez.Closed glyph list over 'CFF ': %d glyphs afterzRetaining %d glyphs)r  r  )3r7   getGlyphOrderorig_glyph_orderr(  rR   r  r  glyphs_missingZ
differencer  r!   r   rR  r  r  r%   r"  r  rW   Zintersection_updater/  glyphs_cmapedrS  r  r  r4  ZgetGlyphNamerT  r5  Zminr.   r  rP  r  r   lowerglyphs_glyfedglyphs_cffedglyphs_retainedr#   r  r)  rJ   r  r  r  r  r  Z
getGlyphIDnew_glyph_orderglyph_index_map)r$   r&   Z
realGlyphsr  Zmissingr2   r0  Zorderr   r  r  s   &&        @r   _closure_glyphsZSubsetter._closure_glyphs  s/	   ++-.
.2.@.@.BB #$$T%?%?@$$ %
$($<$<%
 	
 "e""4#8#8#C#CJ#OP"" #
//#
 	
 HH3T5H5HI<<555778K8KLL++002 #T>566V++D1//
; 7 't{{3   -1-B-BC-Bx!||-BGCHH@'J<<77799'BB<<$$$~ 1 1! 45/0	*23<<***~s1c$*<*<*>&?@AAKKOOD$5$5a$89 B<=T>566FDKKHX 

4;;T
2V++D1//
;Dc$++FV 

4;;T
2 7 't{{3<<&&&6T>566FDKKHX 

4;;T
2V++D1//
;Dc$++FV 

4;;T
2 7 't{{3%E}7%?@@HHHDKK(
 JJt{{J6K..t4KK33J?HHFDKK(
 JJt{{J6 A DGEKKM?"5y7MN# && T>566FDKKHX 

4;;T
2V++D1//
;Dc$++FV 

4;;T
2 7 't{{3T>566FDKKHX 

4;;T
2V++D1//
;Dc$++FV 

4;;T
2 7 't{{3T>566FDKKHX 

4;;T
2V++D1//
;Dc$++FV 

4;;T
2 7 &dkk2(5'')9=9M9M#N9MAuxK9M#N #&t'?'?'F'F'H#I #'#5#5#78P8P#Q 'k<<### $&:&::#:A8t777 :#D =A<O<O&P<Oq%({<O&P#||'''*5S+Qd>R>R9Rqq+OSO '&a//!*<@X@X*X;    /27O8L2M 
2MQ/$%q(2M 
 	&D,@,@(ABKi 766
 D( 766 766 A@@$ 766 766 766  $O# 'Q T 
s   84p.p,Cp1(Cq8C	qCq-Cr"Crr)*r.r.$r3r84r8!r='r=sp)	1q	q	q*-q>	r	r&	c                	s   . V n         V P                  V4       EFC  p\        P                  ! V4      pVP	                  4       V P
                  P                  9   d   \        P                  R V4       K[  \        VR4      '       d   \        RV,          4      ;_uu_ 4        W,          pV P                  V n        VP                  V 4      pV =RRR4       X'       g   \        P                  RV4       W K  \        P                  RV4       K  V P
                  P                  '       d   \        P                  RV4       EK+  \        P                  RV4       W EKF  	  \        R4      ;_uu_ 4        VP!                  V P"                  4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)	z%s subsetting not neededrZ   zsubset '%s'Nz%s subsetted to empty; droppedz%s subsettedz'%s NOT subset; don't know how to subsetz0%s NOT subset; don't know how to subset; droppedzsubset GlyphOrder)rI  r  r   r  r  r   rK  r  r!   r  r  r  r%   rZ   rL  ZwarningZsetGlyphOrderr  r  r   r   _subset_glyphsZSubsetter._subset_glyphs  s;    $$T*C'',Eyy{dll;;;3S900=3.// IE"&"6"6DK"006F	 0
 HH=sC	HH^S1000BCHNPSTI) +, &''t334 ('! 0/  (''s    -F4F-F*-F>	c                	s   VP                  4       pR V9   d#   VP                  R 4       VP                  R 4       V EFz  pVR8X  d   K  VR8X  Ed   V P                  P                  '       dV   W,          P                  4       pW,          P                  VRR7      pWE8w  d!   \        P                  RV\        V4      4       V P                  P                  '       dm   W,          P                  ^8  dV   W,          P                  4       pW,          P                  VRR7      pWg8w  d!   \        P                  RV\        V4      4       V P                  P                  '       dF   W,          P                  pW,          P!                  V4      p	W8w  d   \        P                  RW94       V P                  P"                  '       dF   \%        V4      p
WV,          P&                  8w  d$   WV,          n        \        P                  RW:4       \(        P*                  ! V4      p\-        VR	4      '       g   EK  \/        R
V,          4      ;_uu_ 4        W,          pVP1                  WP                  4      pRRR4       X'       g   \        P                  RV4       W EKd  \        P                  RV4       EK}  	  R#   + '       g   i     LP; i)r   
GlyphOrderrq  T)Z	pruneOnlyz%s Unicode ranges pruned: %sz%s CodePage ranges pruned: %sz%s xAvgCharWidth updated: %dz%s usMaxContext updated: %dr   r  Nr  r  )rk  r  rw  r   rW  ZgetUnicodeRangesZrecalcUnicodeRangesr  r!   r"   rX  r  ZgetCodePageRangesZrecalcCodePageRangesrY  ZxAvgCharWidthZrecalcAvgCharWidthrZ  r   ZusMaxContextr   r  r  r  r   )r$   r&   Z	tableTagsr  Zold_unirangesZnew_unirangesZold_codepagesZnew_codepagesZold_avg_widthZnew_avg_widthZmax_contextr  r0  r  r	  r   _prune_post_subsetZSubsetter._prune_post_subset  s   IIK	 YV$V$Cl"f}<<444$(I$>$>$@M$(I$A$A$RV$A$WM$5:CAV <<555$):K:Kq:P %)I$?$?$AM$(I$B$B4SW$B$XM$5;"=1
 <<444$(I$;$;M$(I$@$@$FM$5!?T<<222",T"2K"3i&<&<<1<S	.!>Q'',Eu122<#-.. IE"44T<<HF / HH:C@	HH[#.S D /.s   $J==Kc                	s   a . ROo\        S4       UUu/ uF  w  r#W2^,           bK  	  uppo\        VP                  4       V3R lR7      pV Uu. uF  q3R8w  g   K  VNK  	  up# u uppi u upi )r  c                s(   < SP                  V ^ 4      # r   )rB  )r  tagOrderr  r   r   Z(Subsetter._sort_tables.<locals>.<lambda>  s    8<<Q3Gr(   )rD  r  )r  r  r  r=  rp  r  r   r  )r5   r"   rk  )r$   r&   r2   r  r  r  s   &&   @r   r  ZSubsetter._sort_tables	  sb    S)28)<=)<A1uH)<=diik'GH54a#4455 >5s   A%A+A+c                	s    V P                  V4       V P                  V4       V P                  V4       V P                  V4       R # r   )r  r  r  r  )r$   r&   r   r   r;   ZSubsetter.subset  s:    t$T"D!%r(   )r  r  r  r%   r  r  r  r  r  r  r  r(  r  r  r  r  r   r  r  r  r"  r  rI  r   )r  r  r  r  r|  r  r  r  r  r  r  r  r  r  r  r;   r  r   r(   r   r}  r}    s\    )   ) !rBR 	./8l\561/f6&r(   r}  z	load fontc           	     s>   \         P                  ! V VVP                  VP                  VVP                  R 7      pV'       d[   \         P
                  ! R4      pVP                  pVP                  Vn        VR,          pVP                  R8X  d   RVn        Wvn        V# ))checkChecksumsZrecalcBBoxesZrecalcTimestampre  Z
fontNumberr  g       @r  )	r   ZTTFontrU  rV  rc  r  Zdecode_format_2_0Zdecode_format_3_0r  )	ZfontFiler   r  dontLoadGlyphNamesre  r&   r  Zsavedr_  s	   &&&&&    r   	load_fontr    s    <<%**00&&D$ ""6*&&!%!7!7L<<3AL!&Kr(   zcompile and save fontc                s    VP                   '       d   VP                  R 8X  d   ^ RIHp RVn        VP                  V n        VP
                  V P                  \        &   V P                  WP                  R7       R# )Zwoff)sfntT)ZreorderTablesN)
r]  r\  ZfontTools.ttLibr  Z
USE_ZOPFLIr_  Zcfgr   Zsaver[  )r&   outfiler   r  r   r   	save_fontr  6  sW    w~~7(..DK&-&?&?DHH"#IIg%<%<I=r(   c           
     s|   ^ RI pVP                  RRV 4      p VP                  RRV 4      p . pV P                  4        F{  pVP                  R4      p\        V4      ^8X  d   VP	                  \        V^4      4       KA  Vw  rVVP                  \        \        V^4      \        V^4      ^,           4      4       K}  	  V# )r    Nz0[xX]rj  z[<+>,;&#\\xXuU\n	]rh  )rer^   r  r.   rw  r   rW  r5  )rU   r  r/   itemfieldsZstartZends   &      r   parse_unicodesr  A  s    
xa A
$c1-A
A	Cv;!HHSr]#JEHHU3ub>3sB<!+;<=  Hr(   c           
     sd   . pV P                  R R4      P                  4        F  pVP                  R4      p\        V4      ^8X  d$   VP                  \	        V^ ,          4      4       KG  VP                  \        \	        V^ ,          4      \	        V^,          4      ^,           4      4       K  	  V# )ri  rj  rh  )rk  r  r.   rw  r   rW  r5  )rU   r/   r  r  s   &   r   
parse_gidsr  Q  s    
A		#s#))+Cv;!HHS^$HHU3vay>3vay>A+=>? , Hr(   c                sB    V P                  R R4      P                  4       # )ri  rj  )rk  r  )rU   r{   r   parse_glyphsr  \  s    99S#$$&&r(   c                 s|    \        R \        \        P                  R7       \        R\        P                  R7       R# )zusage:Zfilez2Try fonttools subset --help for more information.
N)rl  	__usage__sysstderrr   r(   r   usager  `  s!    	(ICJJ/	
?cjjQr(   z%make one with everything (TOTAL TIME)c                s   ^ RI Hp ^ RIHp V f   \        P
                  R,          p RV 9   d   \        \        4       ^ # \        4       p VP                  V . R/OR7      p \        T 4      ^8  d   \        4        ^# T! TP                  '       d   \        P                   M\        P"                  R	7       TP$                  '       d/   \&        P(                  P+                  \        P,                  4       MR
\&        P(                  n        T ^ ,          pT R,          p \1        TR7      pRp. p. p	. p
RpRpRpT  EF-  pTR8X  d   R
pK  TP3                  R4      '       d   TR,          pK1  TP3                  R4      '       d   YR,          ,          pKY  TP3                  R4      '       dN   \5        TR,          RR7      ;_uu_ 4       pYP7                  4       P9                  RR4      ,          pRRR4       K  TP3                  R4      '       d6   TR,          R8X  d   R
pM!T
P;                  \=        TR,          4      4       EK	  TP3                  R4      '       dn   \5        TR,          4      ;_uu_ 4       pTP?                  4        F3  pT
P;                  \=        TPA                  R4      ^ ,          4      4       K5  	  RRR4       EK  TP3                  R4      '       d%   T	P;                  \C        TR,          4      4       EK  TP3                  R4      '       dn   \5        TR,          4      ;_uu_ 4       pTP?                  4        F3  pT	P;                  \C        TPA                  R4      ^ ,          4      4       K5  	  RRR4       EKL  TP3                  R4      '       d6   TR ,          R8X  d   R
pM!TP;                  \E        TR ,          4      4       EK  TP3                  R!4      '       dn   \5        TR,          4      ;_uu_ 4       pTP?                  4        F3  pTP;                  \E        TPA                  R4      ^ ,          4      4       K5  	  RRR4       EK  TPG                  T4       EK0  	  TPH                  '       * ;'       d    T'       * pTPJ                  p\M        YSTTR"7      pTfA   TPN                  e"   R#TPN                  PQ                  4       ,           MRp\S        TTR
R$R%7      p\'        R&4      ;_uu_ 4        T'       d    TP;                  TPU                  4       4       T'       d   TR',          PV                   F  pTPY                  4       '       g   K  T
P;                  TPZ                  P]                  4       4       TP^                  ^8X  g   KW  T
P;                  TP`                  P]                  4       4       K  	  RRR4       \b        Pe                  R(T,          4       \b        Pe                  R)T
4       \b        Pe                  R*T4       \b        Pe                  R+T	4       TPg                  YYR,7       TPi                  T4       \k        TYs4       TP                  '       ds   ^ RI6p\b        Pe                  R-TPn                  Pq                  T4      T3,          4       \b        Pe                  R.TPn                  Pq                  T4      T3,          4       TPr                  '       d    TPu                  \        Pv                  4       TPy                  4        R#   TP                   d2   p\        4        \        RT\        P                  R7        Rp?^# Rp?ii ; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL`; i  + '       g   i     EL; i)0z%OpenType font subsetter and optimizer)splitext)configLoggerN:rl   NNz--help)rn  zERROR:r  )ZlevelT)r   Fr   r   z--output-file=:i   NNz--text=:i   NNz--text-file=:i   NNz	utf-8-sig)ZencodingZ
z--unicodes=:i   NNz--unicodes-file=:r.  NNZ#z--gids=z--gids-file=z	--glyphs=:i	   NNz--glyphs-file=)r  re  r  z.subset)Z	extensionZ	overWriteZsuffixzcompile glyph listr  z
Text: '%s'zUnicodes: %sz
Glyphs: %szGids: %s)r%   r  r  r  zInput font:% 7d bytes: %szSubset font:% 7d bytes: %s)	r  z	gids-filer%   zglyphs-filer  z	text-filer  zunicodes-filezoutput-file)=Zos.pathr  	fontToolsr  r  rm  rl  __doc__r@  ro  rD  r  r  r.   r`  loggingZINFOZWARNINGra  r  r)   ZsetLevelZDEBUGZdisabledr}  r  ZopenZreadrk  rW  r  Z	readlinesr  r  r  rw  r  re  r  r\  r  r
   r  r  r  r  rk  r   r!  r  r!   r  r;   r  osZpathZgetsizerb  ZsaveXMLZstdoutZclose)Zargsr  r  r   ZeZfontfileZ	subsetterr  r%   r  r  Zwildcard_glyphsZwildcard_unicodesr  r   r_  Zliner  re  r&   Zextr  r  s   &                      r   mainr  e  sm    !&|xx|4giG!!
 " 
& 4y1}ww||GOOL~~~gmm, $AwH8D'*IGFDHOD8"O<<())fG<<	""bEMD<<''af{33q((r22 4<<&&v}$(!qv 67<<*++afKKMDOON4::c?13E$FG *  <<	""KK
1R5)*<<''afKKMDKK
4::c?1+= >? *  <<$$u|"&l1R512<<())afKKMDMM,tzz#q/A"BC *  aY \ %000??Z<<D.@tD .5nn.HcGNN((**d$tI
 
#	$	$MM$,,./&\((;;==OOAFFKKM2xx2~ 		(89	 )	 
% HH\D !HH^X&HH\6"HHZf(NTdG%,0I8/TTU-1I70SST{{{SZZ JJLe  h

+J 433   $ 
%	$	$si   \ ']$2A]81A^A^ ;/^4+)^47^4-^4]!0&]]!$]58^	^ ^14_	r   rK  r   r   >   rl   rx   ry   r,  r-  r.  r/  r0  )r    FT)r@  r}  r  r  r  r  r  r  )Z
__future__r   r  r   ZfontTools.misc.roundToolsr   r   ZfontTools.ttLib.tablesr   ZfontTools.ttLib.tables.otBaser   ZfontTools.otlLib.maxContextCalcr   ZfontTools.pens.basePenr   ZfontTools.misc.loggingToolsr	   ZfontTools.misc.cliToolsr
   ZfontTools.subset.utilr   r   ZfontTools.subset.cffZfontTools.subset.svgZfontTools.varLibr   r   ZfontTools.ttLib.tables._n_a_m_er   r   ZfontTools.unicodedatar   r  r  Zarrayr  Zcollectionsr   r   Z	functoolsr   Ztypesr   r  r  Z	getLoggerr  r'   r%   r  r,   r4   rr   r6   r9   r;   r=   r   rH   ZSingleSubstrW   rZ   ZMultipleSubstZAlternateSubstZLigatureSubstZReverseChainSingleSubstZDevicer|   ZValueRecordr   Z	SinglePosr   ZPairPosZ
CursivePosZAnchorZMarkBasePosZ
MarkLigPosZMarkMarkPosr   r   ZContextSubstZChainContextSubstZ
ContextPosZChainContextPosr   r  ZExtensionSubstZExtensionPosr2  r1  rV  rX  r]  r  rc  rf  r  rn  rz  r|  rx  r  r  r  r  r  r  r  r  r  r  r  r  r  ZMathGlyphConstructionr  r  r  r  r  r  r  r  r7  r8  r  r@  r}  r  r  r  r  r  r  r  Z__all__r   r(   r   <module>r     s  
 #  -  + ? 6 * - 6 9 " " 4 G * 
    ,  G	 Uc P *+Q S)
 	W&&'?@A%0
 XA  A
 X6  6
 X   X9  9
 X   XS  S X  & XP  P
 X!!"K #K X!!" # X##$# %# X##$ % X$$%Y &Y X$$%! &! X##$ % X##$  %  X--.
5 /
5 X--.5 /5( X__) ) X!!"  #  X 5 !5 X  !> X*5 *5Z X7 7( X  !	5 "	5 X__	 	 X  ! " X!!"$5 #$5N X!!"	 #	 X  !.5 ".5b X  ! " X!!"$5 #$5N X!!"	 #	 $$		 $$ $$

 (1183S3S 	 	W?W?t X""H$>$>?l5 @l5^ 	W5W5t 	&5&5R 	55& X$$%5 &5 X$$%5 &5 X$$h&;&;<5 =5 X$$h&;&;<5 =5 X$$h&;&;<5 =5 X$$h&;&;<5 =5 X__) )( X__
$ 
$ X__  X__) )
 X__I I X__E E X  !N "N
 X  ! " X  !) ") X  ! " X  !" ""* X  X!!"
 #
 X!!" # X!!"# ## X../ 0 X''( ) X''(	 )	 X../	( 0	( X../	( 0	( X''(, )," X''(, )," X$$h&6&67D 8D X$$h&6&67D 8D X$$h&6&67' 8' X__: : X__: : X__0 0 X  !	" "	" X  !	" "	" X  !Y "Y
 U  () * U  () * U  () * U  () *: U  (%*=*=f*EF G U  (%*=*=f*EF9 G9 U  (%*=*=f*EF
 G
, U  (%*=*=f*EF= G= U  (%*=*=f*EF, G,. U  (%*=*=f*EF
 G
$ U  (%*=*=f*EF8 G84 U  (%*=*=f*EF
 G
, U  (%*=*=f*EF+3 G+3\ U  (%*=*=f*EF G U  (%*=*=f*EF2 G2> U  (%*=*=f*EF+ G+\ U  () *D=4 U  () *D U  ()! *! U  ()	! *	! U  () * U  () * U  () * U  ()" *" U  ()* ** U  () *& U  ()@ *@ U  () * U  ()! *! U  ()" *"J U  ()' *'T U  () * U  ()@ *@( U  () * U  () *
 U  ()? *?, U  () *: U  ()0 *0f U  ()9( *9(x X++, - X""# $" U  ()A *A U  ()" *"6 U  ()) *)X U  ()2 *2
 X//0- 1- X--./ // X""#$ $$ X##$	 %	 X""# $ U  () * U!!&)//0 1: U  () *  U  () * U  () *& U  () * U  ()9 *9B U  ()
 *
 U  ()? *?D U  () * U  ()
 *
 4  U  ()! *!HCTL U  () *$g*f g*T@& @&F
 { > >  > 'R
 ./N 0Nb	r(   