a
    èÝEb¡	  ã                   @   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r€d 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r¸dn|jrÂd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.ÚDEBUGÚ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_modeÚsaver   )Úargsr   r   ÚparserZlogging_groupÚoptionsr   © r,   úb/home/ja/django-apps/lartica_env/lib/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ÚexitÚdoctestÚtestmodÚfailedr,   r,   r,   r-   Ú<module>   s   
5