a
    <`	                     @   s   d dl mZ d dlmZ d dlmZ d dlmZmZ d
ddZ	e
dkrd dlZeejd	krhee	  d dlZee j dS )    )RawTextHelpFormatter)dedent)TTFont)compactGPOS_COMPACT_MODE_DEFAULTNc                 C   s   ddl m} ddlm} |dtjtd}|d |jddd	d
dd |jdtdt	 dt
t	ttdt
d |jdd}|jddddd |jddddd || }||jrdn|jrdndd t|j}t|t|j ||jp|j d
S ) z/Optimize the layout tables of an existing font.r   )ArgumentParser)configLoggerzotlLib.optimize)progdescriptionformatter_classfontz-oZ
OUTPUTFILEoutfileNzoutput file)metavardestdefaulthelpz--gpos-compact-modea              GPOS Lookup type 2 (PairPos) compaction mode:
                0 = do not attempt to compact PairPos lookups;
                1 to 8 = create at most 1 to 8 new subtables for each existing
                    subtable, provided that it would yield a 50%% file size saving;
                9 = create as many new subtables as needed to yield a file size saving.
            Default: a  .

            This compaction aims to save file size, by splitting large class
            kerning subtables (Format 2) that contain many zero values into
            smaller and denser subtables. It's a trade-off between the overhead
            of several subtables versus the sparseness of one big subtable.

            See the pull request: https://github.com/fonttools/fonttools/pull/2326
            
   )r   r   choicestypeF)requiredz-vz	--verbose
store_truezRun more verbosely.)actionr   z-qz--quietzTurn verbosity off.DEBUGZERRORINFO)level)argparser   Z	fontToolsr   main__doc__r   add_argumentr   r   intlistrangeadd_mutually_exclusive_group
parse_argsverbosequietr   r   r   strZgpos_compact_modeZsaver   )argsr   r   parserZlogging_groupoptionsr    r*   Alib/python3.9/site-packages/fontTools/otlLib/optimize/__init__.pyr      s@    




r   __main__   )N)r   r   textwrapr   ZfontTools.ttLibr   ZfontTools.otlLib.optimize.gposr   r   r   __name__syslenargvexitZdoctestZtestmodZfailedr*   r*   r*   r+   <module>   s   
5