L iiddZddlmZddlmZmZmZmZddlm Z ddl Z ddl Z ddl mZddlmZe j"dZd d fd Zdd Zed k(r`ddlZeej0dkDrej2eddlZej2ej6j8yy)z: Interpolate OpenType Layout tables (GDEF / GPOS / GSUB). )TTFont)models VarLibErrorload_designspace load_masters)InstancerMergerN)deepcopy)pformatz#fontTools.varLib.interpolate_layoutc|SNss i/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/fontTools/varLib/interpolate_layout.pyrsFcnt|drnddlm}|j|}t |}t j dt j dt||}t||j}t j dt||s?|jD cic]$\}} ||j|j| &}}} t j dt|tj||j }t j dt|tj"|j$} d| j&|jk(sJt)|| |} t j d | j+||d g|Scc} }w) a Interpolate GPOS from a designspace file and location. If master_finder is set, it should be a callable that takes master filename as found in designspace file and map it to master font binary as to be opened (eg. .ttf or .otf). If mapped is False (default), then location is mapped using the map element of the axes in designspace file. If mapped is True, it is assumed that location is in designspace's internal space and no mapping is performed. sourcesr)DesignSpaceDocumentzBuilding interpolated fontzLoading master fontsz Location: %szInternal location: %szNormalized location: %szBuilding interpolated tablesGPOS)hasattrfontTools.designspaceLibrfromfilerloginforr base_idxr itemsaxes map_forwardrnormalizeLocationinternal_axis_supportsVariationModelnormalized_master_locsmappingr mergeTables) designspaceloc master_findermappedrds master_fontsfontnamevmodelmergers rinterpolate_layoutr1s\{I& @)22;? + &BHH )*HH #$ ];L L- .DHH^WS\* ADMgdAtRWWT]..q11MMHH $gcl3  " "3(A(A BCHH & 5  ! !"";"; Interpolate GDEF/GPOS/GSUB tables for a point on a designspacer) configLoggerNz#fonttools varLib.interpolate_layout) descriptiondesignspace_filename DESIGNSPACEzInput TTF files)metavarhelp locationsLOCATION+zAxis locations (e.g. wdth=120)r7typenargsr8z-oz--outputOUTPUTz=Output font file (defaults to -instance.ttf)z-lz --loglevelLEVELINFOz Logging level (defaults to INFO))r7defaultr8z -instance.ttf)levelcF|jddjddS)N master_ufomaster_ttf_interpolatablez.ufoz.ttf)replacers rrzmain..gs"qyy/JKSSr=zSaving font %s) fontToolsr3argparsesysArgumentParsermain__doc__ add_argumentstr parse_argsoutputospathsplitextr5loglevelr9splitfloatr1rrsave) argsr3rIrJparserfinderr'argtagvalr,s rrLrL>ss&  $ $-LL%F  S:C d77f EDHH t{{+IIdkkr__main__r )rMfontTools.ttLibrfontTools.varLibrrrrfontTools.varLib.mergerros.pathrRloggingcopyr pprintr getLoggerrr1rL__name__rJlenargvexitdoctesttestmodfailedr rrrps#PP3g=>8C5+\4n z 388}q CHH_W__  % %&r