)Ej`dZddlmZddlmZmZmZddlZddl m Z m Z m Z m Z ddlmZmZmZddlmZddZddZddZddZd dZdS)!zFExtra methods for DesignSpaceDocument to generate its STAT table data.) annotations)DictListUnionN)AxisLabelDescriptorDesignSpaceDocumentDesignSpaceDocumentErrorLocationLabelDescriptor)RegiongetVFUserRegionlocationInRegion)TTFontttFontrdocrvfNamestrreturnNonec|D]}|j|krntd|t||}t dt |dddD}tjj |t||t|||j |j nd|S) aBuild the STAT table for the variable font identified by its name in the given document. Knowing which variable we're building STAT data for is needed to subset the STAT locations to only include what the variable font actually ships. .. versionadded:: 5.0 .. seealso:: - :func:`getStatAxes()` - :func:`getStatLocations()` - :func:`fontTools.otlLib.builder.buildStatTable()` z&Cannot find the variable font by name c3,K|]}|jdkVdS)N) platformID).0nrs GC:\PYTHON\MyICR_Suite\python\Lib\site-packages\fontTools/varLib/stat.py z#buildVFStatTable..,s:! namenamesN)macNames)getVariableFontsrr r anygetattrget fontToolsotlLibbuilderbuildStatTable getStatAxesgetStatLocationselidedFallbackName)rrrvfregionr"s rbuildVFStatTabler0s""$$   7f   E ' =V = =   S" % %F%,VZZ-?-?"%M%MH   # 2 2C  f%%"%"8"D! 3  r userRegionr List[Dict]ctd|jDd}g}|jD]>}|j||j$|dz }||?fdt |j|DS)zReturn a list of axis dicts suitable for use as the ``axes`` argument to :func:`fontTools.otlLib.builder.buildStatTable()`. .. versionadded:: 5.0 c32K|]}|j |jVdS)N) axisOrderingraxiss rrzgetStatAxes..Bs-QQt43D3P 3P3P3P3PQQr)defaultNrc g|]=\}tjdjij|fdjD>S)encfg|]-}tj|jit|.Sr )r r userValue_axisLabelToStatLocation)rlabelr7r1s r z*getStatAxes...QsJ#TY$@*MM(//r)tagrorderingvalues)dictrAr labelNames axisLabels)rrBr7r1s @rr@zgetStatAxes..Ls    D(  5T_5!_    r)maxaxesr5appendzip)rr1 maxOrdering axisOrderingsr7s ` rr+r+9sQQsxQQQKM..   (  !2 3 3 3 3 1 K   - - - -    "#(M::    rcTdjDfdjDS)zReturn a list of location dicts suitable for use as the ``locations`` argument to :func:`fontTools.otlLib.builder.buildStatTable()`. .. versionadded:: 5.0 ci|] }|j| Sr )rr6s r z$getStatLocations..as777d$)T777rc g|]}t|%td|ji|jfd|Dt |S)r;c2i|]\}}|j|Sr )rA)rrvalue axesByNames rrOz/getStatLocations...gs7D%4 $er)rlocationflags)r getFullUserLocationrDrrEitems _labelToFlags)rr?rSrr1s rr@z$getStatLocations..bs     E55c::J G G   7e&67#(#<#r>{s??$$L %* 1 0 1D % EqU_EBBBBq/-     q      (#(#4C   (#(#4C  9 : ::r)rrrrrrrr)rrr1r rr2)r?rZrr[)r?rrr)__doc__ __future__rtypingrrrfontTools.otlLib.builderr'fontTools.designspaceLibrrr r fontTools.designspaceLib.typesr r r fontTools.ttLibrr0r+r,rXr>r rrrss&LL""""""$$$$$$$$$$ UTTTTTTTTT""""""$$$$ND.;;;;;;r