Files
intellecton/venv/lib/python3.12/site-packages/fontTools/__pycache__/fontBuilder.cpython-312.pyc
T

280 lines
36 KiB
Plaintext
Raw Normal View History

Ë
zRjè…ãóä—dgZ ddlmZmZddlmZddlmZddlm Z ddl
m Z ddl Z dd l
mZednid
d “d d “d
d“dd“dd“dd“dd“dd“dd“dd“dd“dd“dd“dd“dd“dd“dd“ŽZed dddddddddddddd¬!«Zed"d¬#«Zed$dddddddd¬%« Zednid
d “d&d“d'd“d(d“d)d“d*d“d+d“d,d“d-d“d.d“d/d“d0d“d1d“d2d“d3d“d4d“d5d“ŽZednid
d “d&d“d'd“d(d“d6d“d7d“d8d“d9d“d-d“d.d“d0d“d1d“d2d“d3d“d:d“d4d“d;d“ŽZednid<d“d=d“d>d“d?d“d@dA“dBdC“dDdE“dFdG“dHdI“dJdK“dLdM“dNdO“dPdQ“dRdS“dTdU“dVdW“dXdY“dZd[“d\d]“d^d_“d`da“dbdc“ddde“dfdg“dhdi“ŽZdj„ZGdk„de«Zdl„Zdm„Zy)oÚ FontBuilderé)ÚTTFontÚnewTable)Ú cmap_classes©Ú flagCubic)ÚPanose)Ú timestampNowéN)Ú OrderedDictÚ tableVersiongð?Ú fontRevisionÚcheckSumAdjustmentÚ magicNumberiõ<_ÚflagséÚ
unitsPerEmièÚcreatedÚmodifiedÚxMinÚyMinÚxMaxÚyMaxÚmacStyleÚ
lowestRecPPEMÚfontDirectionHintéÚindexToLocFormatÚglyphDataFormaté)r
Ú numGlyphsÚ maxPointsÚ maxContoursÚmaxCompositePointsÚmaxCompositeContoursÚmaxZonesÚmaxTwilightPointsÚ
maxStorageÚmaxFunctionDefsÚmaxInstructionDefsÚmaxStackElementsÚmaxSizeOfInstructionsÚmaxComponentElementsÚmaxComponentDepthiP)r
r!ç@) Ú
formatTypeÚ italicAngleÚunderlinePositionÚunderlineThicknessÚ isFixedPitchÚ minMemType42Ú maxMemType42Ú minMemType1Ú maxMemType1ÚascentÚdescentÚlineGapÚadvanceWidthMaxÚminLeftSideBearingÚminRightSideBearingÚ
xMaxExtentÚcaretSlopeRiseÚ
caretSlopeRunÚ caretOffsetÚ reserved0Ú reserved1Ú reserved2Ú reserved3ÚmetricDataFormatÚnumberOfHMetricsÚadvanceHeightMaxÚminTopSideBearingÚminBottomSideBearingÚ
yMaxExtentÚ reserved4ÚnumberOfVMetricsÚ copyrightÚ
familyNameÚ styleNameÚuniqueFontIdentifierÚfullNameéÚversionéÚpsNameéÚ trademarkéÚ manufactureréÚdesigneré Ú descriptioné
Ú vendorURLé Ú designerURLé ÚlicenseDescriptioné
ÚlicenseInfoURLéÚtypographicFamilyéÚtypographicSubfamilyéÚcompatibleFullNameéÚ
sampleTextéÚpostScriptCIDFindfontNameéÚ
wwsFamilyNameéÚwwsSubfamilyNameéÚlightBackgroundPaletteéÚdarkBackgroundPaletteéÚvariationsPostScriptNamePrefixécó—td/idd“dd“dd“dd“d d
“d d“d d“d
d“dd“dd“dd“dd“dd“dd“dd“dd“dt«“dd“dd“dd“dd“dd“dd“dd“dd“d d“d!d“d"d“d#d“d$d“d%d“d&d“d'd“d(d“d)d“d*d+“d,d“d-d“d.d“ŽS)0NrUrÚ
xAvgCharWidthr Ú
usWeightClassi�Ú usWidthClassrVÚfsTyperTÚySubscriptXSizeÚySubscriptYSizeÚySubscriptXOffsetÚySubscriptYOffsetÚySuperscriptXSizeÚySuperscriptYSizeÚySuperscriptXOffsetÚySuperscriptYOffsetÚyStrikeoutSizeÚyStrikeoutPositionÚ sFamilyClassÚpanoseÚulUnicodeRange1ÚulUnicodeRange2ÚulUnicodeRange3ÚulUnicodeRange4Ú achVendIDz????Ú fsSelectionÚusFirstCharIndexÚusLastCharIndexÚ
sTypoAscenderÚsTypoDescenderÚ sTypoLineGapÚ usWinAscentÚ usWinDescentÚulCodePageRange1ÚulCodePageRange2ÚsxHeightÚ
sCapHeightÚ
usDefaultCharÚ usBreakCharé Ú usMaxContextÚusLowerOpticalPointSizeÚusUpperOpticalPointSize©)Údictr r¥óúX/home/antigravity/intellecton/venv/lib/python3.12/site-packages/fontTools/fontBuilder.pyÚ_getOS2Defaultsr© s£€Ü ò( Ùð( áð( ñð( ñð ( ñ
ð ( ñ ð
( ñð( ñð( ñð( ñð( ñð( ñð( ñð( ñð( ñð( ñ ð!( ô"Œxð#( ñ$ð%( ñ&ð'( ñ(ð)( ñ*ð+( ñ,ð-( ñ.ð/( ñ0ð1( ñ2ð3( ñ4ð5( ñ6ð7( ñ8ð9( ñ:ð;( ñ<ð=( ñ>ð?( ñ@ðA( ñBðC( ñDðE( ñFðG( ñHðI( ñJðK( ñL!"ðM( ñN!"ðO( ð(r§cóü—eZdZd#d„Zd„Zd„Zd„Zd„Zd„Zd„Z d$d „Z
d%d
„Z d „Z d „Z
d&d
„Zd„Zd%d„Zd„Zd'd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd'd„Zd(d„Zd„Zd„Zd)d„Zd*d„Z d+d „Z! d,d!„Z"d-d"„Z#y).rNcóÈ—|€Ltd¬«|_||_t«}|€J‚|j ||||¬«|j «y|�J‚||_d|v|_y)aÖInitialize a FontBuilder instance.
If the `font` argument is not given, a new `TTFont` will be
constructed, and `unitsPerEm` must be given. If `isTTF` is True,
the font will be a glyf-based TTF; if `isTTF` is False it will be
a CFF-based OTF.
The `glyphDataFormat` argument corresponds to the `head` table field
that defines the format of the TrueType `glyf` table (default=0).
TrueType glyphs historically can only contain quadratic splines and static
components, but there's a proposal to add support for cubic Bezier curves as well
as variable composites/components at
https://github.com/harfbuzz/boring-expansion-spec/blob/main/glyf1.md
You can experiment with the new features by setting `glyphDataFormat` to 1.
A ValueError is raised if `glyphDataFormat` is left at 0 but glyphs are added
that contain cubic splines or varcomposites. This is to prevent accidentally
creating fonts that are incompatible with existing TrueType implementations.
If `font` is given, it must be a `TTFont` instance and `unitsPerEm`
must _not_ be given. The `isTTF` and `glyphDataFormat` arguments will be ignored.
NF)ÚrecalcTimestamp)rrrrÚglyf)rÚfontÚisTTFr
Ú setupHeadÚ setupMaxp)Úselfrr®r¯rÚnows r¨Ú__init__zFontBuilder.__init__9sv€ð, ˆ<ܨuÔ5ˆDŒI؈DŒJÜ“.ˆCØÐ)Ð )Ð)Ø �N‰NØ%ØØØ /ð
ô
ð
�N‰NÕ àÐ%Ð %Ð%؈DŒIØ 4˜ˆD�Jr§có:—|jj|«y)zgSave the font. The 'file' argument can be either a pathname or a
writable file object.
N)r®Úsave)r²Úfiles r¨r¶zFontBuilder.save`s€ð
� ‰ �‰�tÕr§cóΗt|«x}|j|<|j«D]\}}t|||«Œ|j«D]\}}t|||«Œ|S©N)rr®ÚitemsÚsetattr)r²ÚtableTagÚdefaultsÚvaluesÚtableÚkÚvs r¨Ú_initTableWithValuesz FontBuilder._initTableWithValuesfsj€Ü&.¨xÓ&8Ð8ˆ�— ‘ ˜(Ñ#Ø—N‘NÓ$ò !‰DˆAˆqÜ �E˜1˜aÕ ð !à—L‘L“Nò !‰DˆAˆqÜ �E˜1˜aÕ ð !àˆ r§cól—|j|}|j«D]\}}t|||«Œyr¹)r®rºr»)r²r¼r¾r¿rÀrÁs r¨Ú_updateTableWithValuesz"FontBuilder._updateTableWithValuesns5€Ø— ‘ ˜(Ñ#ˆØ—L‘L“Nò !‰DˆAˆqÜ �E˜1˜aÕ ñ !r§c ó2—|jdt|«y)zCreate a new `head` table and initialize it with default values,
which can be overridden by keyword arguments.
ÚheadN)rÂÚ
_headDefaults©r²r¾s r¨r°zFontBuilder.setupHeadsó€ð
×!Ñ! &¬-¸Õ@r§c ó(—|jd|«y)z^Update the head table with the fields and values passed as
keyword arguments.
rÆN)rÄrÈs r¨Ú
updateHeadzFontBuilder.updateHeadys€ð
×#Ñ# F¨FÕ3r§có:—|jj|«y)z!Set the glyph order for the font.N)r®Ú
setGlyphOrder)r²Ú
glyphOrders r¨ÚsetupGlyphOrderzFontBuilder.setupGlyphOrders€à � ‰ ×Ñ 
Õ+r§có.—g}|r t|«nd}|dkDr@td„|j«D««}t|ddd«}|j |«n|}d}t||dd«} | j |j «|j | «t||dd«}
|j |
«|�hi} |D];\} }
}|j| «|k(rd
}|
| vrg| |
<| |
j | |f«Œ=tid dd «}| |_ |j |«td
«|j d
<d|j d
_
||j d
_y
#tj$r!|s td «‚d}t||dd«} Y�ŒwxYw)aµBuild the `cmap` table for the font. The `cmapping` argument should
be a dict mapping unicode code points as integers to glyph names.
The `uvs` argument, when passed, must be a list of tuples, describing
Unicode Variation Sequences. These tuples have three elements:
(unicodeValue, variationSelector, glyphName)
`unicodeValue` and `variationSelector` are integer code points.
`glyphName` may be None, to indicate this is the default variation.
Text processors will then use the cmap to find the glyph name.
Each Unicode Variation Sequence should be an officially supported
sequence, but this is not policed.
r iÿÿc3ó6K—|]\}}|dksŒ ||f–—Œy­w)r Nr¥)Ú.0rÀrÁs r¨ú <genexpr>z0FontBuilder.setupCharacterMap.<locals>.<genexpr>“sèø€ÒS©4¨1¨aÀqÈ7Ã{  A¤ÑSùs‚
� rdrr`rTrzFcmap format 4 subtable overflowed; sort glyph order by unicode to fix.NrhrVÚcmap)Úmaxr¦rºÚbuildCmapSubTableÚappendÚcompiler®ÚstructÚerrorÚ
ValueErrorÚgetÚuvsDictrr
Útables)r²ÚcmappingÚuvsÚ
allowFallbackÚ subTablesÚhighestUnicodeÚ cmapping_3_1Ú
subTable_3_10ÚformatÚ subTable_3_1Ú subTable_0_3rÝÚ unicodeValueÚvariationSelectorÚ glyphNameÚ uvsSubTables r¨ÚsetupCharacterMapzFontBuilder.setupCharacterMapƒs¶€ðˆ Ù*2œ˜Xœ¸ˆØ ˜FÒ "ÜÑS°8·>±>Ó3CÔSÓSˆLÜ-¨h¸¸A¸rÓBˆMØ × Ñ ˜]Õ +à#ˆL؈Ü(¨°v¸qÀ!ÓDˆ ð IØ × Ñ  §¡Ô +ð ×јÔ&Ü(¨°v¸qÀ!ÓDˆ Ø×јÔ&à ˆ?؈GØ>Aò
MÑ:� Ð/°Ø—<‘<  Ó-°Ò:à $�IØ$¨GÑ3Ø13�GÐ-Ñ.ØÐ)Ñ*×1Ñ1°<ÀÐ2KÕLð

Mô,¨B°°A°qÓ9ˆKØ")ˆKÔ Ø × Ñ ˜[Ô )ä$ VÓ,ˆ� ‰ �&ÑØ)*ˆ� ‰ �&ÑÔ&Ø#,ˆ� ‰ �&ÑÕ øô7�|‰|ò Iá Ü Ø\óððˆFÜ,¨\¸6À1ÀaÓH‹Lð IúsÁ*E Å 0FÆFcó&—td«x}|jd<g|_|j«D]]\}}t |t
«r|}n t |}t |t«r t|¬«}|j||j|||¬«Œ_y)aÞCreate the `name` table for the font. The `nameStrings` argument must
be a dict, mapping nameIDs or descriptive names for the nameIDs to name
record values. A value is either a string, or a dict, mapping language codes
to strings, to allow localized name table entries.
By default, both Windows (platformID=3) and Macintosh (platformID=1) name
records are added, unless any of `windows` or `mac` arguments is False.
The following descriptive names are available for nameIDs:
copyright (nameID 0)
familyName (nameID 1)
styleName (nameID 2)
uniqueFontIdentifier (nameID 3)
fullName (nameID 4)
version (nameID 5)
psName (nameID 6)
trademark (nameID 7)
manufacturer (nameID 8)
designer (nameID 9)
description (nameID 10)
vendorURL (nameID 11)
designerURL (nameID 12)
licenseDescription (nameID 13)
licenseInfoURL (nameID 14)
typographicFamily (nameID 16)
typographicSubfamily (nameID 17)
compatibleFullName (nameID 18)
sampleText (nameID 19)
postScriptCIDFindfontName (nameID 20)
wwsFamilyName (nameID 21)
wwsSubfamilyName (nameID 22)
lightBackgroundPalette (nameID 23)
darkBackgroundPalette (nameID 24)
variationsPostScriptNamePrefix (nameID 25)
Úname©Úen)ÚttFontÚnameIDÚwindowsÚmacN)
rr®ÚnamesrºÚ
isinstanceÚintÚ_nameIDsÚstrr¦ÚaddMultilingualName)r²Ú nameStringsrôrõÚ nameTableÚnameNameÚ nameValuerós r¨ÚsetupNameTablezFontBuilder.setupNameTable¹s‘€ôJ)1°Ó(8Ð8ˆ �D—I‘I˜fÑ%؈ Œà#.×#4Ñ#4Ó#6ò Ñ ˆH�iܘ(¤CÔ(Ø!‘ä! (Ñ+�ܘ)¤SÔ)Ü  IÔ.� Ø × )Ñ )Ø $§)¡)°FÀGÐQTð
*õ
ñ r§c ó^—|jdt«|«d|vr=d|jvsJd«‚|jdj|j«d|vsMd|vsHd|vsCd|vs>d|jvsJd «‚|jdj |j«y
y
y
y
y
) zCreate a new `OS/2` table and initialize it with default values,
which can be overridden by keyword arguments.
zOS/2r~Úhmtxz6the 'hmtx' table must be setup before the 'OS/2' tablerŽr�r�rÔz6the 'cmap' table must be setup before the 'OS/2' tableN)rÂr©r®ÚrecalcAvgCharWidthÚrecalcUnicodeRangesrÈs r¨ÚsetupOS2zFontBuilder.setupOS2ìsÉ€ð
×!Ñ! &¬/Ó*;¸VÔDØ  &Ñ (à˜$Ÿ)™)Ñ#ð
HàGó
HØ#à �I‰I�fÑ × 0Ñ 0°·±Ô ;à  Ñ 'Ø  FÑ*Ø  FÑ*Ø  FÑ*ð˜$Ÿ)™)Ñ#ð
HàGó
HØ#à �I‰I�fÑ × 1Ñ 1°$·)±)Õ <ð +ð+ð+ð
(r§có’—ddlm}m}m}m}m} m}
|jrJ‚d|j_ |«} d| _
d| _ |j| _ |g| _
|«| _| «} | | _|
«}
|j!«D]\}}t#|
||«Œd}d}|«}|jj%«|_|
|_| j|_|j!«D]\}}t#|||«Œd|vr)d|jdj*z }|dd|ddg|_|d|j&| |
||«}|j!«D]\}}|
|_| |_|||<Œ||_| jj3|«t5d«|jd<| |jd_y)Nr)Ú
CFFFontSetÚ TopDictIndexÚTopDictÚ CharStringsÚGlobalSubrsIndexÚ PrivateDictÚOTTOr Ú
FontMatrixrÆzCFF )ÚcffLibrrr r
r r r¯r®Ú sfntVersionÚmajorÚminorÚotFontÚ fontNamesÚ topDictIndexÚ GlobalSubrsrºr»Ú
getGlyphOrderÚcharsetÚPrivaterrÚprivateÚ globalSubrsr×rÚcff)r²rWÚfontInfoÚcharStringsDictÚ privateDictrrr r
r r ÚfontSetrrÚkeyÚvalueÚfdSelectÚfdArrayÚtopDictÚscaleÚ charStringsrëÚ
charStrings r¨ÚsetupCFFzFontBuilder.setupCFFsÅ€÷
÷
ð—:’:Ј~Ø &ˆ� ‰ ÔÙ“,ˆØˆŒ
؈Œ
ØŸ™ˆŒØ#˜HˆÔÙ+›~ˆÔá&Ó(ˆ Ø)ˆÔÙ“-ˆØ%×+Ñ+Ó-ò )‰JˆC�Ü �G˜S %Õ (ð )àˆØˆá“)ˆØŸ)™)×1Ñ1Ó3ˆŒØ!ˆŒØ%×1Ñ1ˆÔØ"Ÿ.™.Ó*ò )‰JˆC�Ü �G˜S %Õ (ð )à ˜xÑ 'ؘŸ ™  &Ñ)×4Ñ4Ñ4ˆEØ"'¨¨A¨u°a¸Ð!;ˆGÔ á!Ø �'—/‘/ ;°¸À7ó
ˆ ð&5×%:Ñ%:Ó%<ò 0Ñ !ˆI�zØ!(ˆJÔ Ø%0ˆJÔ "Ø%/ˆK˜ Ò "ð 0ð*ˆÔà×Ñ×#Ñ# GÔ,ä$ VÓ,ˆ� ‰ �&ÑØ 'ˆ� ‰ �&ÑÕr§cóÆ—ddlm}m}m}m}m}m} m}
m} |jrJ‚d|j_ |«} d| _ d| _
|jj}
|d|
d«| _|«}|| _|€ig}d}|
«}d|_||_|D]^}| «}|j%d«| «}|j'«D]\}}t)|||«Œ||_|j-|«Œ`|«}|
|_||_d|jdj2z }|dd|ddg|_|dj*}|dd||||«}|j'«D]\}}||_||_|||<Œ||_| jj-|«t;d«|jd<| |jd_|r|j?|«yy) Nr)rrr r
r r Ú FDArrayIndexÚFontDictr
rr TrÆÚCFF2) rrrr r
r r r+r,r¯r®rrrrrrÚstringsÚsetCFF2rºr»rr×Úcff2GetGlyphOrderÚFDArrayrrrrrrÚsetupCFF2Regions)r²rÚ fdArrayListÚregionsrrr r
r r r+r,r r0rr#r$rÚfontDictrr!r"r%r&r'rër(s r¨Ú setupCFF2zFontBuilder.setupCFF24sù€÷
÷
ó
ð—:’:Ј~Ø &ˆ� ‰ ÔÙ“,ˆØˆŒ
؈Œ
à ŸI™I×3Ñ3ÐÙ+¨DÐ2CÀTÓJˆÔá&Ó(ˆ Ø)ˆÔà Рؘ$ˆK؈ٓ.ˆØˆŒØ)ˆÔØ&ò %ˆKÙ“zˆHØ × Ñ ˜TÔ "Ù!“mˆGØ)×/Ñ/Ó1ò
-‘
��Uܘ  eÕ,ð
-à&ˆHÔ Ø �N‰N˜8Õ $ð %ñ“)ˆØ$5ˆÔ!Ø!ˆŒØ�D—I‘I˜fÑ%×0Ñ0Ñ0ˆØ# Q¨¨5°!°QÐ7ˆÔà˜!‘*×$Ñ$ˆÙ! $¨¨k¸7ÀHÈgÓVˆ Ø%4×%:Ñ%:Ó%<ò 0Ñ !ˆI�zØ!(ˆJÔ Ø%0ˆJÔ "Ø%/ˆK˜ Ò "ð 0ð*ˆÔà×Ñ×#Ñ# GÔ,ä$ VÓ,ˆ� ‰ �&ÑØ 'ˆ� ‰ �&ÑÔá Ø × !Ñ ! 'Õ *ð r§c ó—ddlm}m}m}ddlm}d|j vsJd«‚d|j vsJd«‚|j djD�cgc]}|j‘Œ}}|||«}|ttt|«««dd¬ «} ||| g«}
||
¬
«} |j djjd } | | _| jD]}
| |
j _Œycc}w) Nr)ÚbuildVarRegionListÚ buildVarDataÚ
buildVarStore)Ú VarStoreDataÚfvarzfvar must to be set up firstr-zCFF2 must to be set up firstF)Úoptimize)Ú
otVarStorer )ÚvarLib.builderr8r9r:rr;r®ÚaxesÚaxisTagÚlistÚrangeÚlenrrÚVarStorer1rÚvstore)r²r4r8r9r:r;ÚaÚaxisTagsÚ
varRegionListÚvarDataÚvarStorerFr%r5s r¨r2zFontBuilder.setupCFF2Regionsqsî€ßSÑSÝ(à˜Ÿ™Ñ"ÐBÐ$BÓBÐ"ؘŸ™Ñ"ÐBÐ$BÓBÐ"Ø'+§y¡y°Ñ'8×'=Ñ'=Ö> !�A—I“IÐ>ˆÐ>Ù*¨7°HÓ=ˆ
Ùœt¤E¬#¨g«,Ó$7Ó8¸$ÈÔOˆÙ  °° Ó:ˆÙ¨Ô2ˆØ—)‘)˜FÑ#×'Ñ'×4Ñ4°QÑ7ˆØ!ˆÔØŸ™ò -ˆHØ&,ˆH× Ñ Õ #ñ -ùò?sÁC=có,—|jsJ‚|ro|jdjdk(rS|j«D]@\}}|jdkDsŒt d„|j D««sŒ3td|›d�«‚td«|jd<td«|jd<||jd_ t|jd«r(|jj|jd_ |r|j«y y )
a­Create the `glyf` table from a dict, that maps glyph names
to `fontTools.ttLib.tables._g_l_y_f.Glyph` objects, for example
as made by `fontTools.pens.ttGlyphPen.TTGlyphPen`.
If `calcGlyphBounds` is True, the bounds of all glyphs will be
calculated. Only pass False if your glyph objects already have
their bounding box values set.
If `validateGlyphFormat` is True, raise ValueError if any of the glyphs contains
cubic curves or is a variable composite but head.glyphDataFormat=0.
Set it to False to skip the check if you know in advance all the glyphs are
compatible with the specified glyphDataFormat.
rÆr c3ó.K—|]
}|tz–—Œy­wr¹r)rÒÚfs r¨rÓz(FontBuilder.setupGlyf.<locals>.<genexpr>“sèø€Ò1QÀA°!´iµ-Ñ1Qùs‚zGlyph zt has cubic Bezier outlines, but glyphDataFormat=0; either convert to quadratics with cu2qu or set glyphDataFormat=1.Úlocar­rÎN)
r¯r®rrºÚnumberOfContoursÚanyrrÛrÚglyphsÚhasattrrÎÚcalcGlyphBounds)r²rRrTÚvalidateGlyphFormatrïÚgs r¨Ú setupGlyfzFontBuilder.setupGlyf�s÷€ð�zŠzЈzá  4§9¡9¨VÑ#4×#DÑ#DÈÒ#IØ!Ÿ<™<›>ò
‘��aØ×%Ñ%¨Ó)¬cÑ1QÈÏÉÔ1QÕ.QÜ$Ø   ð)\ð\óðð
ô% VÓ,ˆ� ‰ �&ÑÜ$ VÓ,ˆ� ‰ �&ÑØ#)ˆ� ‰ �&ÑÔ Ü �4—9‘9˜lÔ +Ø+/¯9©9×+?Ñ+?ˆD�I‰I�fÑ Ô (Ù Ø × Ñ Õ "ð r§có2—t|j||«y)a¯Adds an font variations table to the font.
Args:
axes (list): See below.
instances (list): See below.
``axes`` should be a list of axes, with each axis either supplied as
a py:class:`.designspaceLib.AxisDescriptor` object, or a tuple in the
format ```tupletag, minValue, defaultValue, maxValue, name``.
The ``name`` is either a string, or a dict, mapping language codes
to strings, to allow localized name table entries.
```instances`` should be a list of instances, with each instance either
supplied as a py:class:`.designspaceLib.InstanceDescriptor` object, or a
dict with keys ``location`` (mapping of axis tags to float values),
``stylename`` and (optionally) ``postscriptfontname``.
The ``stylename`` is either a string, or a dict, mapping language codes
to strings, to allow localized name table entries.
N)ÚaddFvarr®)r²r@Ú instancess r¨Ú setupFvarzFontBuilder.setupFvar¡s€ô* �— ‘ ˜4 Õ+r§cóþ—ddlm}d|jvr td«‚|jdjD�cgc]}|j
‘Œ}}t
t|««}||j|||«ycc}w)z˜Adds an axis variations table to the font.
Args:
axes (list): A list of py:class:`.designspaceLib.AxisDescriptor` objects.
r)Ú _add_avarr<z*'fvar' table is missing; can't add 'avar'.N)ÚvarLibr]r®ÚKeyErrorr@rAr Ú enumerate)r²r@Úmappingsr]ÚaxisrHs r¨Ú setupAvarzFontBuilder.setupAvar¸sk€õ &à ˜Ÿ™Ñ "ÜÐGÓHÐ Hà-1¯Y©Y°vÑ->×-CÑ-CÖD T�D—L“LÐDˆÐDÜœ9 T›?Ó+ˆÙ�$—)‘)˜T 8¨XÕ6ùòEs»A:cób—td«x}|jd<d|_d|_||_y)NÚgvarrr ©rr®rUÚreservedÚ
variations©r²rhres r¨Ú setupGvarzFontBuilder.setupGvarÇó/€Ü#+¨FÓ#3Ð3ˆˆt�y‰y˜Ñ ؈Œ ؈Œ
Ø$ˆ�r§cób—td«x}|jd<d|_d|_||_y)NÚGVARrr rfris r¨Ú setupGVARzFontBuilder.setupGVARÍrkr§có‚—|jd}|jj«D]}|j|«Œy)z†Calculate the bounding boxes of all glyphs in the `glyf` table.
This is usually not called explicitly by client code.
r­N)r®rRr¾Ú recalcBounds)r²Ú
glyphTableÚglyphs r¨rTzFontBuilder.calcGlyphBoundsÓs>€ð—Y‘Y˜vÑ&ˆ
Ø×&Ñ&×-Ñ-Ó/ò +ˆEØ × Ñ ˜zÕ *ñ +r§có(—|jd|«y)z­Create a new `hmtx` table, for horizontal metrics.
The `metrics` argument must be a dict, mapping glyph names to
`(width, leftSidebearing)` tuples.
rN©Ú setupMetrics©r²Úmetricss r¨ÚsetupHorizontalMetricsz"FontBuilder.setupHorizontalMetricsÛó€ð
×ј& 'Õ*r§có(—|jd|«y)z­Create a new `vmtx` table, for horizontal metrics.
The `metrics` argument must be a dict, mapping glyph names to
`(height, topSidebearing)` tuples.
ÚvmtxNrtrvs r¨ÚsetupVerticalMetricsz FontBuilder.setupVerticalMetricsãryr§cóÊ—|dvsJ‚t|«x}|j|<i}|D]5}||\}}tt|««tt|««f||<Œ7||_y)z<See `setupHorizontalMetrics()` and `setupVerticalMetrics()`.)rr{N)rr®røÚroundrw)r²r¼rwÚmtxTableÚroundedMetricsÚgnÚwÚlsbs r¨ruzFontBuilder.setupMetricsësu€àÐ+Ñ+Ð+Ð+Ü)1°(Ó);Ð;ˆ�4—9‘9˜XÑ&؈Øò @ˆBؘR‘[‰FˆAˆsÜ!$¤U¨1£X£´´E¸#³J³Ð!?ˆN˜2Ò ð @ð*ˆÕr§c ó2—|jdt|«y)z{Create a new `hhea` table initialize it with default values,
which can be overridden by keyword arguments.
ÚhheaN)rÂÚ
_hheaDefaultsrÈs r¨ÚsetupHorizontalHeaderz!FontBuilder.setupHorizontalHeaderõrÉr§c ó2—|jdt|«y)z{Create a new `vhea` table initialize it with default values,
which can be overridden by keyword arguments.
ÚvheaN)rÂÚ
_vheaDefaultsrÈs r¨ÚsetupVerticalHeaderzFontBuilder.setupVerticalHeaderûrÉr§có‡—|€9iŠ|D]}||}|‰vrd‰|<Œ‰|xxdz
cc<Œ t‰ˆfd„d¬«d}|jditi|¬««|jd}d|_d|_|D]
}||||<Œ y) aYCreate a new `VORG` table. The `verticalOrigins` argument must be
a dict, mapping glyph names to vertical origin values.
The `defaultVerticalOrigin` argument should be the most common vertical
origin value. If omitted, this value will be derived from the actual
values in the `verticalOrigins` argument.
Nrcó•—‰|Sr¹r¥)ÚvorgÚbags €r¨ú<lambda>z2FontBuilder.setupVerticalOrigins.<locals>.<lambda>s ø€ c¨$¡i€r§T)r!Úreverser ÚVORG)ÚVOriginRecordsÚdefaultVertOriginY)ÚsortedrÂr¦r®Ú majorVersionÚ minorVersion)r²ÚverticalOriginsÚdefaultVerticalOriginr�rŽÚ vorgTabler�s @r¨ÚsetupVerticalOriginsz FontBuilder.setupVerticalOriginssÁø€ð !Ð (àˆCØ%ò
#�Ø& rÑ*�ؘs‘?Ø !�C˜’Ià˜“I ‘N”Ið 
#ô %+ØÓ/¸ô%àñ%Ð !ð
×!Ñ!Ø Ø Ü  Ð7LÔ Mô
ð
—I‘I˜fÑ%ˆ Ø!"ˆ ÔØ!"ˆ ÔØ!ò 0ˆBØ+¨BÑ/ˆI�bŠMñ 0r§c ó¨—d|jv}|jdt|«}|js|r|rd|_g|_i|_yd|_y)zCreate a new `post` table and initialize it with default values,