a
    nã^eé  ã                   @   sž   U d Z ddlZddlZddlZddlmZ ddlZddlm	Z	 ddl
mZ G dd„ de	ƒZG d	d
„ d
eƒZeƒ ZG dd„ deƒZeƒ ZeegZee	 ed< dS )z5This module defines all fonts packaged with LilyPond.é    N)ÚListé   )ÚPackage)ÚConfigc                   @   s   e Zd ZdZedœdd„ZdS )ÚFontPackagez,A package representing a font of .otf files.©Úcc                 C   sV   |   |¡}|  |¡}tj|dd tj |dd¡}tj|ddD ]}t ||¡ q@dS )NT)Úexist_okz**z*.otf)Ú	recursive)	Úsrc_directoryÚinstall_directoryÚosÚmakedirsÚpathÚjoinÚglobÚshutilÚcopy)Úselfr   r   r   Zotf_globZotf_file© r   úA/home/jjbenham/public_html/lilypond/release/binaries/lib/fonts.pyÚbuild(   s    

zFontPackage.buildN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   !   s   r   c                   @   s˜   e Zd Zeedœdd„ƒZeedœdd„ƒZeedœdd„ƒZeedœdd	„ƒZeedœd
d„ƒZ	e
dœdd„Zeee dœdd„ƒZedœdd„ZdS )ÚTeXGyre©Úreturnc                 C   s   dS )Nz2.501r   ©r   r   r   r   Úversion7   s    zTeXGyre.versionc                 C   s   | j  dd¡}d|› dS )NÚ.Ú_ÚtgZotf)r    Úreplace)r   Zdirectory_versionr   r   r   Ú	directory;   s    zTeXGyre.directoryc                 C   s   | j › dS ©Nz.zip)r%   r   r   r   r   Úarchive@   s    zTeXGyre.archivec                 C   s   d| j › S )Nz:https://www.gust.org.pl/projects/e-foundry/tex-gyre/whole/©r'   r   r   r   r   Údownload_urlD   s    
ÿzTeXGyre.download_urlc                 C   s   dS )z:The license file that will be downloaded in apply_patches.zGUST-FONT-LICENSE.txtr   r   r   r   r   Úlicense_fileJ   s    zTeXGyre.license_filer   c                 C   s@   d| j › }tj |  |¡| j ¡}tj |¡s<tj ||¡ d S )Nz4https://www.gust.org.pl/projects/e-foundry/licenses/)	r*   r   r   r   r   ÚexistsÚurllibÚrequestÚurlretrieve)r   r   Zlicense_urlZlicense_pathr   r   r   Úapply_patchesO   s
    
ÿzTeXGyre.apply_patchesc                 C   s   | j gS )N)r*   r   r   r   r   Úlicense_filesY   s    zTeXGyre.license_filesc                 C   s   d| j › S )Nz	TeX Gyre ©r    r   r   r   r   Ú__str__]   s    zTeXGyre.__str__N)r   r   r   ÚpropertyÚstrr    r%   r'   r)   r*   r   r/   r   r0   r2   r   r   r   r   r   6   s   
r   c                   @   sx   e Zd Zeedœdd„ƒZeedœdd„ƒZeedœdd„ƒZeedœdd	„ƒZee	e dœd
d„ƒZ
edœdd„ZdS )Ú	UrwBase35r   c                 C   s   dS )NZ20200910r   r   r   r   r   r    e   s    zUrwBase35.versionc                 C   s   d| j › S )Nzurw-base35-fonts-r1   r   r   r   r   r%   i   s    zUrwBase35.directoryc                 C   s   | j › dS r&   r1   r   r   r   r   r'   m   s    zUrwBase35.archivec                 C   s   d| j › S )NzFhttps://github.com/ArtifexSoftware/urw-base35-fonts/archive/refs/tags/r(   r   r   r   r   r)   q   s    zUrwBase35.download_urlc                 C   s   ddgS )NÚLICENSEÚCOPYINGr   r   r   r   r   r0   v   s    zUrwBase35.license_filesc                 C   s   d| j › S )Nz(URW)++ base 35 fonts r1   r   r   r   r   r2   z   s    zUrwBase35.__str__N)r   r   r   r3   r4   r    r%   r'   r)   r   r0   r2   r   r   r   r   r5   d   s   r5   Ú	all_fonts)r   r   r   r   Útypingr   Úurllib.requestr,   r   r   Úconfigr   r   r   Ztexgyrer5   Z	urwbase35r8   Ú__annotations__r   r   r   r   Ú<module>   s   +þ