L is vddlmZddlmZmZmZmZddlmZm Z ddl m Z ddl m Z mZddlmZGddeZy ) ) annotations)AnyDictListTuple)commandsToProgramspecializeCommands) T2CharString)otRound roundFunc)BasePenceZdZdZ d d fd Zd dZd dZd dZ ddZddZ ddZ d dd Z xZ S)T2CharStringPenaPen to draw Type 2 CharStrings. The 'roundTolerance' argument controls the rounding of point coordinates. It is defined as the maximum absolute difference between the original float and the rounded integer value. The default tolerance of 0.5 means that all floats are rounded to integer; a value of 0 disables rounding; values in between will only round floats which are close to their integral part within the tolerated range. ctt| |t||_||_||_g|_d|_y)N)rr) superr__init__r round_CFF2_width _commands_p0)selfwidthglyphSetroundToleranceCFF2 __class__s d/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/fontTools/pens/t2CharStringPen.pyrzT2CharStringPen.__init__s< ot-h7~.   @Bc|j}|j|d|j|dfx}|_|d|dz |d|dz gS)Nr)rr)rptp0s r_pzT2CharStringPen._p'sY XXBqE*DJJr!u,=>>TX11 r!ur!u}--rc\|jjd|j|fy)Nrmovetorappendr$rr"s r_moveTozT2CharStringPen._moveTo,! y$''"+67rc\|jjd|j|fy)Nrlinetor'r)s r_lineTozT2CharStringPen._lineTo/r+rc|j}|jjd||||z||zfy)N rrcurveto)r$rr()rpt1pt2pt3r$s r _curveToOnezT2CharStringPen._curveToOne2s: WW {BsGbg,=3,GHIrcyNrs r _closePathzT2CharStringPen._closePath; rcyr6r7r8s r_endPathzT2CharStringPen._endPath>r:rcR|j}|r|jsdnd}t|d|}t|}|j8|jrJd|j dt |j|js|jdt|||}|S) N0iF)generalizeFirstmaxstackz7CFF2 does not allow encoding glyph width in CharString.rendchar)programprivate globalSubrs) rrr rrinsertr r(r )rrCrDoptimizecommandsr@rB charStrings r getCharStringzT2CharStringPen.getCharStringAs >> !%rH)%(H$H- ;; "JJ IH I NN1gdkk2 3zz NN9 %!W+ r)g?F) rz float | NonerzDict[str, Any] | NonerfloatrboolreturnNone)r"Tuple[float, float]rLz List[float])r"rNrLrM)r1rNr2rNr3rNrLrM)rLrM)NNT)rCz Dict | NonerDz List | NonerFrKrLr ) __name__ __module__ __qualname____doc__rr$r*r.r4r9r<rI __classcell__)rs@rrrs!$  (      . 88J J!J! J  J  $#' !   rrN) __future__rtypingrrrrfontTools.cffLib.specializerrr fontTools.misc.psCharStringsr fontTools.misc.roundToolsr r fontTools.pens.basePenr rr7rrrZs*#))N58*JgJr