+
    iŎ                     .   R t ^ RIt^ RIt^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
Ht ^ RIHt ^ RIHt ]P"                  ! R4      t. ROtR tR	 t ! R
 R]P,                  4      t ! R R4      tRR lt]R8X  d   ^ RIt]P8                  ! ]! 4       4       R# R# )u6  MS VOLT ``.vtp`` to AFDKO ``.fea`` OpenType Layout converter.

Usage
-----

To convert a VTP project file:


.. code-block:: sh

    $ fonttools voltLib.voltToFea input.vtp output.fea

It is also possible convert font files with `TSIV` table (as saved from Volt),
in this case the glyph names used in the Volt project will be mapped to the
actual glyph names in the font files when written to the feature file:

.. code-block:: sh

    $ fonttools voltLib.voltToFea input.ttf output.fea

The ``--quiet`` option can be used to suppress warnings.

The ``--traceback`` can be used to get Python traceback in case of exceptions,
instead of suppressing the traceback.


Limitations
-----------

* Not all VOLT features are supported, the script will error if it it
  encounters something it does not understand. Please report an issue if this
  happens.
* AFDKO feature file syntax for mark positioning is awkward and does not allow
  setting the mark coverage. It also defines mark anchors globally, as a result
  some mark positioning lookups might cover many marks than what was in the VOLT
  file. This should not be an issue in practice, but if it is then the only way
  is to modify the VOLT file or the generated feature file manually to use unique
  mark anchors for each lookup.
* VOLT allows subtable breaks in any lookup type, but AFDKO feature file
  implementations vary in their support; currently AFDKO’s makeOTF supports
  subtable breaks in pair positioning lookups only, while FontTools’ feaLib
  support it for most substitution lookups and only some positioning lookups.
N)StringIO)TopologicalSorter)ast)TTFont
TTLibError)ParserzfontTools.voltLib.voltToFeac                    . p\        V \        \        34      '       d&   V  F  pVP                  \	        V4      4       K  	  V# \        V R 4      '       d'   VP                  \	        V P                  4      4       V# VP                  V 4       V# )enum)
isinstancetuplelistextend_flatten_grouphasattrr	   append)groupretitems   &  {/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/fontTools/voltLib/voltToFea.pyr   r   =   sx    
C%%''DJJ~d+,  J	 
		

>%**-. J 	

5J    c                    V  Uu/ uF  qP                   P                  4       VbK  	  ppV  UUu/ uFq  pVP                   P                  4       \        V4       Uu. uF?  p\        V\        P
                  4      '       g   K%  VP                  P                  4       NKA  	  upbKs  	  ppp\        V4      pVP                  4        Uu. uF  qbV,          NK  	  up# u upi u upi u uppi u upi N)	namelowerr   r
   VAst	GroupNamer   r   static_order)groupsr   	group_mapxgraphsorterr   s   &      r   sort_groupsr"   L   s    8>?u!!#U*I?  E 	

#E*
*!T^^, AGGMMO*
 	

  
  u%F(.(;(;(=>(=dOO(=>> @
 ?s(   #C+C$"CCC$C*C$c                   6   a a ] tR t^Zt oRV 3R lltRtVtV ;t# )Lookupc                6   < \         SV `  WV4       . V n        R # r   )super__init__chained)selfr   use_extensionlocation	__class__s   &&&&r   r'   Lookup.__init__[   s    h7r   )r(   )FN)__name__
__module____qualname____firstlineno__r'   __static_attributes____classdictcell____classcell__)r,   __classdict__s   @@r   r$   r$   Z   s      r   r$   c                     a  ] tR t^`t o ]P
                  ! R4      t]P
                  ! R4      tRR ltR t	R t
RR ltR tRR	 ltR
 tR tR tRR ltR tR tR tR tRR ltR tR tR tR tR tR tR tR tRtV t R# )	VoltToFeaz[^A-Za-z_0-9.]z[^A-Za-z_0-9.\-]Nc                V   \        V\        P                  4      '       d   VR uV n        V n        MR VuV n        V n        W n        / V n        R V n        / V n        / V n	        / V n
        / V n        \        4       V n        / V n        / V n        / V n        / V n        / V n        / V n        R # r   )r
   r   VoltFile_doc_file_or_path_font
_glyph_map_glyph_order_gdef_glyphclasses	_features_lookupsset_marks
_ligatures_markclasses_anchors	_settings_lookup_names_class_names)r)   file_or_pathfonts   &&&r   r'   VoltToFea.__init__d   s    lDMM22,8$)DIt),0,)DIt)
 
er   c                    WP                   9  dT   V P                  P                  R V4      pW P                   P                  4       9   d   VR ,          pK)  W P                   V&   V P                   V,          # _)rI   _NOT_LOOKUP_NAME_REsubvaluesr)   r   ress   && r   _lookupNameVoltToFea._lookupName~   sc    )))**..sD9C++2244s
'*t$!!$''r   c                    WP                   9  dT   V P                  P                  R V4      pW P                   P                  4       9   d   VR ,          pK)  W P                   V&   V P                   V,          # rO   )rJ   _NOT_CLASS_NAME_RErR   rS   rT   s   && r   
_classNameVoltToFea._className   sc    ((())--c48C**1133s
&)d#  &&r   c                z   VP                    F6  p\        V\        P                  4      '       g   K%  V P	                  V4       K8  	  VP                    Uu. uF'  p\        V\        P
                  4      '       g   K%  VNK)  	  pp\        V4       F  pV P                  V4       K  	  VP                    EF  p\        V\        P                  4      '       d   R V9   d   V P                  V4       K>  K@  \        V\        P                  4      '       d   V P                  WC4       Ks  \        V\        P                  \        P
                  34      '       d   K  \        V\        P                  4      '       d   V P                  V4       K  \        V\        P                  4      '       d   K  \        V4      h	  VP                    Fl  p\        V\        P                  4      '       g   K%  VP                   '       d
   R V9  d   K@  VP"                  '       d
   RV9  d   K[  V P%                  V4       Kn  	  R# u upi )GPOSGSUBN)
statementsr
   r   GlyphDefinition_glyphDefinitionGroupDefinitionr"   _groupDefinitionAnchorDefinition_anchorDefinitionSettingDefinition_settingDefinitionScriptDefinition_scriptDefinitionLookupDefinitionNotImplementedErrorposrR   _lookupDefinition)r)   doctablesignore_unsupported_settings	statementsr   r   s   &&&&    r   _collectStatementsVoltToFea._collectStatements   s   I)T%9%9::%%i0 ( !^^S^z!T=Q=Q/R!!^S (E!!%( ) I)T%:%:;;V#**95 $It'='=>>''	OI(<(<d>R>R'STTIt'<'<==&&y1	4+@+@AA))44 ( I)T%:%:;;===V6%9===V6%9&&y1 (' Ts   "H8<H8c           
     Z   \         P                  ! 4       pVP                  pV P                  '       dO   VP	                  \         P
                  ! R 4      4       VP                  V P                  P                  4       4       V P                  '       d_   VP	                  \         P
                  ! R4      4       VP                  R \        V P                  P                  4       4       4       4       V P                  '       ds   VP	                  \         P
                  ! R4      4       V P                  P                  4        F/  pVP                  VP                  4       VP	                  V4       K1  	  V P                  P                  4       pV F  pWV,          pV F~  pWx,          p	V	 F=  p
W,           Uu. uF%  qP                  4       V P                  9   g   K#  VNK'  	  upW&   K?  	  V	P                  4        UUu/ uF  w  rV'       g   K  WbK  	  uppWx&   K  	  VP                  4        UUu/ uF  w  rV'       g   K  WbK  	  uppWV&   K  	  VP                  4        UUu/ uF  w  rV'       g   K  WbK  	  pppV'       Ed   VP	                  \         P
                  ! R4      4       VP                  4        EF  w  rg\         P                   ! V4      p\        VR R7      pVR8X  d/   \#        V4      ^8  d   \$        P'                  R4       VR	,          pV EFF  pVR8w  d0   VP                  P	                  \         P(                  ! V4      4       \        Wx,          R
 R7      pVR8X  d/   \#        V4      ^8  d   \$        P'                  R4       VR	,          pV F  p
VR8w  dL   V
R8X  d   RMRpVP                  P	                  \         P*                  ! V
P-                  ^4      VR7      4       Wx,          V
,           FU  pV P                  VP                  4       ,          p\         P.                  ! V4      pVP                  P	                  V4       KW  	  K  	  EKI  	  VP	                  V4       EK  	  V P0                  '       Ed    RV9   d   . pR F  pVV P0                  9   dx   RVP                  4       ,           p\         P2                  ! VV P0                  V,          4      pVP	                  V4       VP	                  \         P4                  ! V4      4       K  VP	                  R4       K  	  \         P6                  ! R4      pVP                  P	                  \         P8                  ! V!  4       VP	                  V4       V# u upi u uppi u uppi u uppi )z# Glyph classesz
# Mark classesc              3   2   "   T F  q^,          x  K  	  R# 5i   N ).0cs   & r   	<genexpr>.VoltToFea._buildFeatureFile.<locals>.<genexpr>   s     N,Mqdd,Ms   z

# Lookupsz
# Featuresc                     V R 8X  d   ^ # ^# )DFLTry   ks   &r   <lambda>-VoltToFea._buildFeatureFile.<locals>.<lambda>   s    fA<SRS<Sr   )keyaaltzvFEA syntax does not allow script statements in 'aalt' feature, so only lookups from the first script will be included.:Nrx   Nc                     V R 8X  d   ^ # ^# )dfltry   r   s   &r   r   r      s    1;a&=A&=r   zzFEA syntax does not allow language statements in 'aalt' feature, so only lookups from the first language will be included.r   TF)include_defaultGDEFGDEF_NBASEMARKLIGATURE	COMPONENT)r   FeatureFiler_   r@   r   Commentr   rS   rF   sorteditemsrB   r(   rA   copyr   FeatureBlocklenlogwarningScriptStatementLanguageStatementljustLookupReferenceStatementr?   GlyphClassDefinitionGlyphClassName
TableBlockGlyphClassDefStatement)r)   ro   rn   r_   lookupfeaturesfeature_tagscripts
script_taglangslanguage_tagltrr   ffeaturescript_tagslanguage_tagsr   r   	lookuprefclasses	classname
glyphclassgdefs   &&                       r   _buildFeatureFileVoltToFea._buildFeatureFile   sl   oo^^
ckk*;<=d00779:ckk*<=>NF43D3D3J3J3L,MNN===ckk-89--..0!!&..1!!&) 1
 >>&&(#K+G%
+$)L#(#6+#6a'')t}}:T#6+E' %* 9>&Ktqt&K# & 7>mmo$KodaTQTo$KH! $ &.^^%5;%5TQDAD%5;8ckk,78(0(8$**;7$W2ST&(S-=-AKKR #.b/K"-J"f,**11#2E2Ej2QR$*+=%M #f,]1Ca1GX )6b(9(5&&06Bf6LdRWO#..55 # 5 5$0$6$6q$94C!" %,$7$E$ED%)]]4::<%@F(+(D(DV(LI#..55i@ %F )6 #.4 !!'*G )9J :::&F*GA4::% '$**, 6I!$!9!9)TZZPTEU!VJ%%j1NN3#5#5j#ABNN4( B >>&)DOO""3#=#=w#GHd#
{+ 'L$K;s0   9 V
V
 V
V
4V!V!(V'9V'c                Z   V P                   f)   \        V P                  4      P                  4       V n         V P                   pVf   \        pV P
                  e    V P
                  P                  4       V n        V P                  W1V4       V P                  V4      pVP                  4       # r   )r:   
VoltParserr;   parseTABLESr<   getGlyphOrderr>   rs   r   asFea)r)   ro   rp   rn   feas   &&&  r   convertVoltToFea.convert
  s    99"4#5#56<<>DIii>F::! $

 8 8 :D-HI$$V,yy{r   c                     VP                   p\        P                  ! V P                  P                  W"4      4      #   \         d    Tp L>i ; ir   )glyphAttributeErrorr   	GlyphNamer=   get)r)   r   r   s   && r   
_glyphNameVoltToFea._glyphName  sF    	;;D }}T__00<==  	D	s   = AAc                     VP                   p\        P                  ! V P                  VP                  4       ,          4      #   \         d    Tp LDi ; ir   )r   r   r   r   r@   r   )r)   r   r   s   && r   
_groupNameVoltToFea._groupName  sJ    	;;D !!$"4"4TZZ\"BCC  	D	s   A AAc                    VP                  4        Uu. uF<  p\        V\        \        P                  34      '       d   V P                  V4      MTNK>  	  up# u upi r   )glyphSetr
   strr   r   r   )r)   r   r   s   && r   	_glyphSetVoltToFea._glyphSet&  sR     ]]_
$ $.a#t~~1F#G#GT__QQN$
 	
 
s   AAc                "   . pV EF  p\        V\        P                  4      '       d#   VP                  V P	                  V4      4       KF  \        V\        P
                  4      '       d#   VP                  V P                  V4      4       K  \        V\        P                  4      '       da   V P                  VP                  R R7      pV'       d   VP                  V4       K  VP                  \        P                  ! V4      4       EK  \        V\        P                  4      '       dV   V P                  V4      pV'       d   VP                  V4       EKU  VP                  \        P                  ! V4      4       EK}  \        V4      h	  V# Tflatten)r
   r   r   r   r   r   r   Enum	_coverager	   r   r   
GlyphClassRanger   rk   )r)   coverager   r   r   s   &&&  r   r   VoltToFea._coverage,  s    D$//T__T23D$..11T__T23D$)),,~~dii~>LL&LL!56D$**--~~d+LL&LL!56)$//% & r   c                    . pV FW  pV P                  VR R7      p\        V4      ^8  d   \        P                  ! V4      pM	V^ ,          pVP	                  V4       KY  	  V# r   )r   r   r   r   r   )r)   contextoutr   r   s   &&   r   _contextVoltToFea._contextC  sY    D~~dD~9H8}q >>(3#A;JJx   
r   c                .   V P                  VP                  4      pV P                  VP                  P                  R R7      p\        P
                  ! V4      p\        P                  ! W$4      pWPP                  VP                  P                  4       &   R# )Tr   N)	rZ   r   r   r	   r   r   r   r@   r   )r)   r   r   glyphsr   classdefs   &&    r   rc   VoltToFea._groupDefinitionN  sg    uzz*

>^^F+
++D=195::++-.r   c                    V P                   VP                  ,          V P                  VP                  &   VP
                  R9   d   VP
                  V P                  9  d-   \        P                  ! 4       V P                  VP
                  &   V P                  VP
                  ,          P                  P                  V P                  VP                  4      4       VP
                  R8X  d(   V P                  P                  VP                  4       R# VP
                  R8X  d&   VP                  V P                  VP                  &   R# R#   \         d     EL%i ; i)r   r   r   Nr   )r>   idr=   r   	TypeErrortyper?   r   r   r   r   r   rD   add
componentsrE   )r)   r   s   &&r   ra   VoltToFea._glyphDefinitionU  s    	*.*;*;EHH*EDOOEJJ' ::BBzz+),)9

5::&JJuzz"))001LM::KKOOEJJ'ZZ:%*/*:*:DOOEJJ' &  		s   4E EEc                4   VP                   pVP                   F  pVP                   pVP                   F  pVP                   Uu/ uF  qfP	                  R 4      ^ ,          RbK  	  ppVP                   pWP
                  9  d   / V P
                  V&   W P
                  V,          9  d   / V P
                  V,          V&   W@P
                  V,          V,          9  g   Q hVP                  4       V P
                  V,          V,          V&   K  	  K  	  R# u upi )\TN)tagr   r   lookupssplitrA   keys)	r)   scriptstaglangltagr   r   r   ftags	   &&       r   ri   VoltToFea._scriptDefinitione  s    zzLLD88D==;B??K?a774=+T1?K{{~~-+-DNN4(~~d3313DNN4(.>>$#7#====3:<<>t$T*40 ) ! Ls   !Dc                    VP                   P                  R 4      '       d&   VP                  V P                  VP                   &   R# V'       g%   \        P                  RVP                    24       R# R# )	COMPILER_zUnsupported setting ignored: N)r   
startswithvaluerH   r   r   )r)   settingignore_unsupporteds   &&&r   rg   VoltToFea._settingDefinitions  sM    <<"";//+2==DNN7<<(#KK7~FG $r   c           	        Vw  r#rErgT;'       d    VP                  4       ;'       g    R pT;'       d    VP                  4       ;'       g    R p	T;'       d    VP                  4       ;'       g    R p
\        P                  ! VVVV	V
VR7      # )N)
xPlacement
yPlacementxAdvance
xPlaDevice
yPlaDevice
xAdvDevice)r   r   ValueRecord)r)   
adjustmentadvdxdyadv_adjust_bydx_adjust_bydy_adjust_by
adv_device	dx_device	dy_devices   &&         r   _adjustmentVoltToFea._adjustmenty  s    AK>L"<<}':':'<DD
 99\%7%7%9AAT	 99\%7%7%9AAT	  !
 	
r   c                6   Vw  r#rErgV'       d   Q hT;'       d    VP                  4       ;'       g    R pT;'       d    VP                  4       ;'       g    R p	\        P                  ! T;'       g    ^ T;'       g    ^ T;'       g    R T	;'       g    R R7      # )N)xDeviceTableyDeviceTable)r   r   Anchor)
r)   r  r  r  r  r  r  r  r
  r  s
   &&        r   _anchorVoltToFea._anchor  s    AK>L    99\%7%7%9AAT	 99\%7%7%9AAT	zzGG!GG!"**d"**d	
 	
r   c                   VP                   pVP                  pV P                  VP                  4      pW0P                  9  d   / V P                  V&   VP                  R 4      '       d'   VR,          VR,          P                  4       ,           pMVP                  4       pW P                  V,          9  d   / V P                  V,          V&   W@P                  V,          V,          VP                  &   R# )MARK_:N   N:r  NNN)r   
glyph_namer  rl   rG   r   r   	component)r)   	anchordef
anchorname	glyphnameanchors   &&   r   re   VoltToFea._anchorDefinition  s    ^^
((	imm,MM)')DMM)$  ))#B*R.*>*>*@@J#))+J]]95535DMM)$Z0DJi ,Y-@-@Ar   c                  a  VP                   pVP                  p\        V\        P                  4      '       Ed5   VP
                  P                  4        EF  w  w  rVw  rxVP                  V^,
          ,          p	VP                  V^,
          ,          p
RpW,            F'  p\        V\        P                  4      '       d   K%  RpK)  	  S P                  V	4      pS P                  V
4      pS P                  V4      pS P                  V4      p\        V4      ^8X  g   Q h\        V4      ^8X  g   Q hVP                  \        P                  ! V^ ,          W^ ,          VVR7      4       EK  	  R	# \        V\        P                   4      '       d   VP"                   Fl  w  ppS P                  V4      pS P                  V4      p\        V4      ^8X  g   Q hVP                  \        P$                  ! V^ ,          V3.. . R4      4       Kn  	  R	# \        V\        P&                  4      '       Ed   / p\)        4       pVP*                   EF  w  ppS P-                  V RVP.                   24      p\        P0                  ! V4      pVP3                  4       p\)        4       pV F"  pVP5                  VP7                  4       4       K$  	  VP9                  V4      '       g   VP;                  V4       V'       g   K  VP5                  V4       V Fa  pS P=                  V4      pS P>                  V,          RV 2,          ^,          p\        P@                  ! VVV4      p V S PB                  VV3&   Kc  	  VPD                   FR  p!V!P7                  4        F;  p"V"V9  d   . VV"&   VV3VV",          9  g   K!  VV",          P                  VV34       K=  	  KT  	  EK  	  \F        ;QJ d    V 3R lV 4       F  '       d   K   RM	  RM! V 3R lV 4       4      p#\F        ;QJ d    V 3R lV 4       F  '       d   K   RM	  RM! V 3R lV 4       4      p$V EFh  p"^p%V#'       d   S PH                  V",          p%\K        V%4       U&u. uF  p&. NK  	  pp&VV",           F  w  pp\        P0                  ! V4      p\K        ^V%^,           4       Ff  p'V'S P>                  V",          V,          9   g   K$  S P>                  V",          V,          V',          pVV'^,
          ,          P                  VV34       Kh  	  K  	  S P=                  V"4      p!V$'       d    \        PL                  ! V!V^ ,          4      pM>V#'       d   \        PN                  ! V!V4      pM\        PP                  ! V!V^ ,          4      pVP                  V4       EKk  	  R	# \        V\        PR                  4      '       Ed   . p(VPT                   F4  pV F+  p!V!P7                  4        F  p"V(P                  V"4       K  	  K-  	  K6  	  . p)VPV                   F4  pV F+  p!V!P7                  4        F  p"V)P                  V"4       K  	  K-  	  K6  	  V( F  p"S P=                  V"4      pS P>                  V",          R,          ^,          p*R	p+V"V)9   dB   S P>                  V",          R
,          ^,          p+V)PY                  V)P[                  V"4      4       VP                  \        P\                  ! VV*V+4      4       K  	  V) F\  p"S P=                  V"4      pS P>                  V",          R
,          ^,          p+VP                  \        P\                  ! VR	V+4      4       K^  	  R	# \_        V4      hu up&i )rx   FT)
enumerated.r  c              3   @   <"   T F  qSP                   9   x  K  	  R # 5ir   )rE   rz   nr)   s   & r   r|   (VoltToFea._gposLookup.<locals>.<genexpr>  s     DGq4??2G   c              3   @   <"   T F  qSP                   9   x  K  	  R # 5ir   )rD   r"  s   & r   r|   r$    s     <Gqt{{*Gr%  entryNexit)0r_   rl   r
   r   PositionAdjustPairDefinitionadjust_pairr   coverages_1coverages_2r   r   r  r   r   r   PairPosStatementPositionAdjustSingleDefinitionadjust_singleSinglePosStatementPositionAttachDefinitionrC   coverage_torZ   r   	MarkClassr   updater   
isdisjointdifference_updater   rG   MarkClassDefinitionrF   r   allrE   rangeMarkMarkPosStatementMarkLigPosStatementMarkBasePosStatementPositionAttachCursiveDefinitioncoverages_entercoverages_exitpopindexCursivePosStatementrk   ),r)   r   	fealookupr_   rl   idx1idx2pos1pos2
coverage_1
coverage_2r  r   glyphs1glyphs2record1record2abr   recordanchorsallmarksr   r  r   	markclassmarksmarkr  r   r  markdefbaser   is_ligatureis_markr   rP   r  enter_coverageexit_coverager'  r(  s,   f&&                                         r   _gposLookupVoltToFea._gposLookup  s   ))
jjc4<<==.1oo.C.C.E*lt __TAX6
 __TAX6
 #
&33D%dDNN;;%)
 4 ..4..4**40**407|q(((7|q(((!!((
GQZZ# /F, T@@AA))1*))!,6{a'''!!**VAY,?+@"b%P	 * T::;;GuH(+$* !OOzl!FKK=,IJ	MM)4	 (--/
 $DLL1 %''11++H5  &!&I OOI6E!]]95j\6JKANF!55iOG@GD%%y)&<=	 "'  LLD $w.,.GDM&	2'$-G#DM00*i1HI	 !0 )C )8P #DGD###DGDDKc<G<ccc<G<<G
!%!6J%*:%67%6%67'.t}}OD) #i 8I%*1j1n%=	$d(;D(AA%)]]4%8%>y%IF!)a-0778KL &> (5 t,33D%(CD 224?D33D%(CD!!$')  * TAABBN//$D $&--d3 !0 % 0 M..$D $%,,T2 !0 % / '-d+G4Q7=(==.v6q9D!%%m&9&9$&?@!!#"9"9%"MN ' &-}}T*6215!!#"9"9%t"LM &
 &c**] 8s   :^c                   VP                   pVP                  p\        V\        P                  4      '       d   VP
                  P                  4        F  w  w  rw  rV P                  VP                  V	^,
          ,          4      pV P                  VP                  V
^,
          ,          4      p\        V4      ^8X  g   Q h\        V4      ^8X  g   Q hV^ ,          V^ ,          3pV'       d   \        P                  ! W/V3.4      pM\        P                  ! W/W6V.4      pVP                  V4       K  	  R# \        V\        P                  4      '       d   \        P                   ! 4       .pVP"                   F/  w  ppV^ ,          P%                  V P                  VRR7      4       K1  	  V'       d   \        P                  ! W/V3.4      pM\        P                  ! W/W6.4      pVP                  V4       R# \        V\        P&                  4      '       d   \        P                   ! 4       .pVP(                   F/  w  ppV^ ,          P%                  V P                  VRR7      4       K1  	  V'       d   \        P                  ! W/V3.4      pM\        P                  ! W/W6.4      pVP                  V4       R# \+        V4      h)rx   Tr   N)r_   rl   r
   r   r)  r*  r   r   r+  r,  r   r   IgnorePosStatementChainContextPosStatementr   r.  r   r/  r   r1  r2  rk   )r)   r   prefixsuffixignorerC  r(   r_   rl   rD  rE  rF  rG  rJ  rK  r   rq   rN  rP   r   s   &&&&&&&             r   _gposContextLookupVoltToFea._gposContextLookup+  s8   ))
jjc4<<==.1oo.C.C.E*lt..)BC..)BC7|q(((7|q(((!!*gaj1 # 6 68P7Q RI # < <'0B!I !!), /F T@@AAnn&'F))1q	  4!@A * 22VV4L3MN	88FI	 i(T::;;nn&'F"!q	  $!GH  / 22VV4L3MN	88FI	 i(%c**r   c                
  a VP                   pVP                  p\        V\        P                  4      '       Ed   / pVP
                  P                  4        EF	  w  rgV'       d	   V'       g0   VP                  w  rp
\        P                  V R V	 R V
 R24       KE  V P                  V4      pV P                  V4      p\        V4      ^8X  g   Q h\        V^ ,          P                  4       V^ ,          P                  4       4       FV  w  rVP                  \        V P!                  V4      4      . 4      P#                  \        V P!                  V4      4      4       KX  	  EK  	  VP                  4        FC  w  r\$        P&                  ! . V. \$        P(                  ! V4      4      pVP#                  V4       KE  	  R# VP
                  P                  4        EFU  w  rgV'       d	   V'       g0   VP                  w  rp
\        P                  V R V	 R V
 R24       KE  V P                  V4      pV P                  V4      p\        V\        P*                  4      '       dO   \        V4      ^8X  g   Q h\        V4      ^8X  g   Q hVP#                  \$        P,                  ! W. . R4      4       K  \        V\        P.                  4      '       d   K  \        V\        P0                  4      '       dE   \        V4      ^8X  g   Q hVP#                  \$        P2                  ! . V^ ,          . V4      4       EK[  \        V\        P4                  4      '       Ed   \        V4      ^8X  g   Q h\$        P6                  ! . V. V^ ,          R4      p\9        R V 4       4      oS^8  Edq   \:        ;QJ d    V3R lV 4       F  '       d   K   RM	  RM! V3R lV 4       4      '       g   Q hV Uu. uF  pVP                  4       NK  	  ppV Uu. uF&  p\        V4      ^8X  d   V^ ,          .S,          MTNK(  	  ppV^ ,          P                  4       p\        V4      ^8X  d   V^ ,          .S,          p\        V4      S8  g   Q hVP#                  \$        P<                  ! RV 24      4       \        . VOVN5!   FV  pV Uu. uF  pV P!                  V4      NK  	  ppVP#                  \$        P6                  ! . VRR . VR,          R4      4       KX  	  EK9  VP#                  V4       EKM  \?        V4      h	  R# u upi u upi u upi )	:: Ignoring empty substitutionNFc              3   T   "   T F  p\        VP                  4       4      x  K   	  R # 5ir   r   r   )rz   r   s   & r   r|   (VoltToFea._gsubLookup.<locals>.<genexpr>  s     :6aAJJL))6s   &(c              3   `   <"   T F#  p\        VP                  4       4      S^39   x  K%  	  R# 5irw   rj  )rz   r   r#  s   & r   r|   rk    s%     KFqs1::<0QF:Fs   +.T# ) r_   rR   r
   r   SubstitutionAlternateDefinitionmappingr   r+   r   r   r   r   zipr   
setdefaultr   r   r   r   AlternateSubstStatementr   SubstitutionSingleDefinitionSingleSubstStatement+SubstitutionReverseChainingSingleDefinitionSubstitutionMultipleDefinitionMultipleSubstStatementSubstitutionLigatureDefinitionLigatureSubstStatementmaxr8  r   rk   )r)   r   rC  r_   rR   
alternatesr   valpathlinecolumnr   replacements	src_glyph
repl_glyphr   rq   r   replacementzippedr#  s   &&&                 @r   _gsubLookupVoltToFea._gsubLookupY  sU   ))
jj
 c4??@@JKK--/#),&DKK4&$q8U VW,#~~c26{a'''-01I&&(,q/*B*B*D.)I ))#dooi.H*I2NUUDOOJ78. 0 (2'7'7'9#77r3>>,#?	 !!),	 (:
 ))+HCc%(\\"FtfAdV1VH4QRS^^C(F>>#.L#t@@AA6{a'''<(A---!!,,V2r5Q C!Q!QRRC!D!DEE6{a'''!!..r6!9b,O C!D!DEE<(A---66LOU	 :6::q53KFK333KFKKKKK4:;FqajjlFF;JPQ&QSVq[!vza?&FQ #/q/":":"<K;'1,'21~&6&:{+q000 %%ckkByk2B&CD"%";v";{";>D!Ef$//!"4f!E"))66 "F3BKVBZ #< %%i0)#..{ ,F <Q  "Fs   'T4,T9;T>c           	        VP                   pVP                  p\        V\        P                  4      '       d   VP
                  P                  4        F  w  rV	'       d	   V
'       g0   VP                  w  rp\        P                  V R V R V R24       KD  V P                  V	4      pV P                  V
4      pVP                  \        P                  ! W#W4      4       K  	  . Vn        R# \        V\        P                  \        P                   \        P"                  \        P$                  34      '       g   \'        \)        V4      4      h. pVP
                  P                  4        Ff  w  rV	'       d	   V
'       g0   VP                  w  rp\        P                  V R V R V R24       KD  VP+                  V P                  V	RR7      4       Kh  	  \-        V4      ^8  d   \        P.                  ! V4      .pV'       d+   VP                  \        P0                  ! W.V3.4      4       R# VP                  \        P2                  ! W.W6.4      4       R# )rg  rh  NTr   )r_   rR   r
   r   rv  rp  r   r+   r   r   r   r   r    ReverseChainSingleSubstStatementr(   rt  rw  ry  ro  rk   r   r   r   r   IgnoreSubstStatementChainContextSubstStatement)r)   r   ra  rb  rc  rC  r(   r_   rR   r   r}  r~  r  r  r   r  s   &&&&&&&         r   _gsubContextLookupVoltToFea._gsubContextLookup  s   ))
jjc4KKLLKK--/#),&DKK4&$q8U VW,#~~c2!!88 0 !#I11333344	
 
 &d3i00))+HCc%(\\"FtfAdV1VH4QRSMM$..d.;< , v;?nnV,-Fc668P7QRS..vvyQr   c           	     0
   R pR p^ pVP                   R8X  d
   V^,          pVP                  '       g
   V^,          pVP                  '       g   V^,          pMe\        VP                  \        4      '       d   V P                  VP                  4      pM)VP                  e   V P                  VP                  4      pR pV'       g	   Vf   Ve   \        P                  ! WBV4      pRpV P                  P                  R4      '       d   RpRVP                  9   Edj   VP                  P                  R4      ^ ,          pVP                  4       V P                  9  d}   \        V P!                  V4      VR7      pVe   VP"                  P%                  V4       VP"                  P%                  \        P&                  ! RVP                  ,           4      4       MV P                  VP                  4       ,          pVP"                  P%                  \        P(                  ! 4       4       VP"                  P%                  \        P&                  ! RVP                  ,           4      4       WP                  VP                  4       &   Mk\        V P!                  VP                  4      VR7      pVe   VP"                  P%                  V4       WP                  VP                  P                  4       &   VP*                  eA   VP"                  P%                  \        P&                  ! RVP*                  ,           4      4       . p	VP,                   F  p
V P/                  V
P0                  4      pV P/                  V
P2                  4      pV
P4                  R8H  pV	P%                  WV.4       V'       g   Ke  \7        VP,                  4      ^8X  g   K  V	P%                  . . R.4       K  	  V	'       d   \        P8                  ! V P!                  VP                  R	,           4      VR7      pVP:                  P%                  V4       VP<                  e   V P?                  W4       MVP@                  e   V PC                  W4       V	 FL  w  rpVP<                  e   V PE                  WWW4       K)  VP@                  f   K9  V PG                  WWW4       KN  	  R # VP<                  e   V P?                  W4       R # VP@                  e   V PC                  W4       R # R # )
NRTLFCOMPILER_USEEXTENSIONLOOKUPSTr   )r*   rm  EXCEPT_CONTEXTz chained)$	directionprocess_baseprocess_marksr
   r   r   mark_glyph_setr   LookupFlagStatementrH   r   r   r   r   rB   r$   rV   r_   r   r   SubtableStatementcommentsr   r   leftrightex_or_inr   LookupBlockr(   rR   r  rl   r\  r  rd  )r)   r   mark_attachementmark_filteringflagslookupflagsr*   r   rC  contextsr   ra  rb  rc  r(   s   &&             r   rm   VoltToFea._lookupDefinition  s   u$QJE"""QJE ###QJE,,c22#v/C/CD"".!__V-B-BCN$0N4N11K >><== M6;; ;;$$T*1-Dzz|4==0"$$T*"/	 *((//<$$++CKKv{{8J,KL MM$**,7	$$++C,A,A,CD$$++CKKv{{8J,KL*3MM$**,'  -+I &$$++K81:MM&++++-.??&  ''D6??4J(KL~~G]]7<<0F]]7==1F%%)99FOOVV45 v#fnn-2R0 & oo  z!9:+G $$W-zz%  1'  1*2&::)++	 ZZ+++	 +3 zz%  3'  3 (r   )rG   rJ   r:   rA   r;   r<   r?   r=   r>   r@   rE   rI   rB   rF   rD   rH   r   )F)NF)!r.   r/   r0   r1   recompilerQ   rY   r'   rV   rZ   rs   r   r   r   r   r   r   r   rc   ra   ri   rg   r  r  re   r\  rd  r  r  rm   r2   r3   )r5   s   @r   r7   r7   `   s     **%67$784('"2HVp>D
.	:; BH
 
KC+J,+\]/~0d]4 ]4r   r7   c           
        ^ RI p^ RIHp ^ RIHp VP                  R\        P                  R7      pVP                  RRVRR	7       VP                  R
RVRR	7       VP                  RRR\        RRR7       VP                  RRRRR7       VP                  RRRR7       VP                  V 4      pT! VP                  '       d   RMRR7       VP                  pRp \        V4      pRV9   d-   \        VR,          P                  P!                  R4      4      pM\"        P%                  R4       ^# \)        Wg4      p VP+                  VP,                  4      p	\7        TP8                  R%4      ;_uu_ 4       pTP;                  T	4       RRR4       R#   \&         d     Lni ; i  \.         d   p
TP0                  '       d   h \3        T
P4                  ^ ,          R R4      pR!T
 R"2pT'       d'   Tw  rp\"        P%                  T R#T R#T R$T 24       M\"        P%                  T4        Rp
?
^# Rp
?
ii ; i  + '       g   i     R# ; i)&z'Convert MS VOLT to AFDKO feature files.N)Path)configLoggerzfonttools voltLib.voltToFea)descriptioninputINPUTzinput font/VTP file to process)metavarr   helpfeaturefileOUTPUTzoutput feature filez-tz--tabler   ro   z:List of tables to write, by default all tables are written)actionchoicesdestr  z-qz--quiet
store_truezSuppress non-error messages)r  r  z--tracebacku   Don’t catch exceptionsERRORINFO)levelTSIVzutf-8z6"TSIV" table is missing, font was not saved from VOLT?r+   "z" is not supportedrg  z: w)argparsepathlibr  	fontToolsr  ArgumentParsermain__doc__add_argumentr   
parse_argsquietr  r   r   datadecoder   errorr   r7   r   ro   rk   	tracebackgetattrargsopenr  write)r  r  r  r  parseroptionsrK   rL   	converterr   er+   messager~  r  r  feafiles   &                r   r  r  J  s7    &$$%4<< % F t2R   xd9N   I   i3P   l1K   %G7===f>==LDl#T>#DL$5$5$<$<W$EFLIINO ,-I/ 
g!!3	'	'7c 
(	'#    
166!9j$7aS*+!)DIIavQvhb	:;IIg
 
(	'	's=   =F F >F$ 7H7F! F!$H4/A:H//H47I	__main__)r   r^   r]   r   )r  loggingr  ior   graphlibr   fontTools.feaLibr   fontTools.ttLibr   r   fontTools.voltLibr   fontTools.voltLib.parserr   r   	getLoggerr   r   r   r"   r  r$   r7   r  r.   sysr(  ry   r   r   <module>r     s   +Z  	  &   . ) 956	!	?S__ g4 g4T?D zHHTV r   