U
    i2e                     @   sN   d dl Z d dlmZmZ d dlT d dlmZ dddZedkrJe 	e  dS )	    N)
TTLibErrorTTLibFileIsCollectionError)*)TTCollectionc              	   C   s  ddl m} | dkr"tjdd } ddl}|jdddd}|jd	d	d
dd |jdddddd |jddddd |jddddd |jddddd |jdd dd!d" || }|jdk	rt	|jnd}|j
}|j}|j}g }	|jD ]P}
zt|
||d#}|	| W q tk
r4   t|
|d$}|	|j Y qX q|dk	rt|	dkrj||	d _|	d | n(|dk	r|td%t }|	|_|| dS )&a  Open/save fonts with TTFont() or TTCollection()

      ./fonttools ttLib [-oFILE] [-yNUMBER] files...

    If multiple files are given on the command-line,
    they are each opened (as a font or collection),
    and added to the font list.

    If -o (output-file) argument is given, the font
    list is then saved to the output file, either as
    a single font, if there is only one font, or as
    a collection otherwise.

    If -y (font-number) argument is given, only the
    specified font from collections is opened.

    The above allow extracting a single font from a
    collection, or combining multiple fonts into a
    collection.

    If --lazy or --no-lazy are give, those are passed
    to the TTFont() or TTCollection() constructors.
    r   )configLoggerN   zfonttools ttLibz/Open/save fonts with TTFont() or TTCollection()a"  
		If multiple files are given on the command-line,
		they are each opened (as a font or collection),
		and added to the font list.

		The above, when combined with -o / --output,
		allows for extracting a single font from a
		collection, or combining multiple fonts into a
		collection.
		)descriptionepilogfontr   z
Font file.)metavarnargshelpz-oz--outputFILEzOutput file.)r   defaultr   z-yNUMBERz%Font number to load from collections.z--lazy
store_truezLoad fonts lazily.)actionr   r   z	--no-lazylazystore_falsezLoad fonts immediately.)destr   r   z--flavorflavorz)Flavor of output font. 'woff' or 'woff2'.)r   r   r   )
fontNumberr   )r   z"Cannot set flavor for collections.)Z	fontToolsr   sysargvargparseArgumentParseradd_argument
parse_argsyintoutputr   r   r
   ZTTFontappendr   r   extendfontslensaver   )argsr   r   parseroptionsr   ZoutFiler   r   r$   fr
   Z
collection r+   </tmp/pip-unpacked-wheel-txsm8jh_/fontTools/ttLib/__main__.pymain   s~                 




r-   __main__)N)
r   ZfontTools.ttLibr   r   ZfontTools.ttLib.ttFontZfontTools.ttLib.ttCollectionr   r-   __name__exitr+   r+   r+   r,   <module>   s   
\