L i dddlmZmZddlmZddlmZmZddgZGddeZ GddeZ y) )noRoundotRound) Transform) FilterPenFilterPointPen RoundingPenRoundingPointPencFeZdZdZeeffd ZdZdZdZ dZ dZ xZ S)rag Filter pen that rounds point coordinates and component XY offsets to integer. For rounding the component transform values, a separate round function can be passed to the pen. >>> from fontTools.pens.recordingPen import RecordingPen >>> recpen = RecordingPen() >>> roundpen = RoundingPen(recpen) >>> roundpen.moveTo((0.4, 0.6)) >>> roundpen.lineTo((1.6, 2.5)) >>> roundpen.qCurveTo((2.4, 4.6), (3.3, 5.7), (4.9, 6.1)) >>> roundpen.curveTo((6.4, 8.6), (7.3, 9.7), (8.9, 10.1)) >>> roundpen.addComponent("a", (1.5, 0, 0, 1.5, 10.5, -10.5)) >>> recpen.value == [ ... ('moveTo', ((0, 1),)), ... ('lineTo', ((2, 3),)), ... ('qCurveTo', ((2, 5), (3, 6), (5, 6))), ... ('curveTo', ((6, 9), (7, 10), (9, 10))), ... ('addComponent', ('a', (1.5, 0, 0, 1.5, 11, -10))), ... ] True c@t||||_||_yNsuper__init__ roundFunctransformRoundFuncselfoutPenrr __class__s `/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/fontTools/pens/roundingPen.pyrzRoundingPen.__init__!  ""4c|jj|j|d|j|dfyNr)_outPenmoveTorrpts rrzRoundingPen.moveTo&3 T^^BqE2DNN2a54IJKrc|jj|j|d|j|dfyr)rlineTorrs rr"zRoundingPen.lineTo)r rcJjjfd|Dy)Nc3hK|])\}}j|j|f+ywr r.0xyrs r z&RoundingPen.curveTo..., HAt~~a $.."34 H/2)rcurveTorpointss` rr-zRoundingPen.curveTo,s  H H rcJjjfd|Dy)Nc3hK|])\}}j|j|f+ywr r%r&s rr*z'RoundingPen.qCurveTo..3r+r,)rqCurveTor.s` rr2zRoundingPen.qCurveTo1s  H H rc |\}}}}}}|jj|t|j||j||j||j||j ||j |yr r addComponentrrr) r glyphNametransformationxxxyyxyydxdys rr5zRoundingPen.addComponent6s!/BBB !!  ''+''+''+''+r"r"   r) __name__ __module__ __qualname____doc__rrrrr"r-r2r5 __classcell__rs@rrr s/.*1W5 LL   rc:eZdZdZeeffd Z ddZddZxZ S)r a Filter point pen that rounds point coordinates and component XY offsets to integer. For rounding the component scale values, a separate round function can be passed to the pen. >>> from fontTools.pens.recordingPen import RecordingPointPen >>> recpen = RecordingPointPen() >>> roundpen = RoundingPointPen(recpen) >>> roundpen.beginPath() >>> roundpen.addPoint((0.4, 0.6), 'line') >>> roundpen.addPoint((1.6, 2.5), 'line') >>> roundpen.addPoint((2.4, 4.6)) >>> roundpen.addPoint((3.3, 5.7)) >>> roundpen.addPoint((4.9, 6.1), 'qcurve') >>> roundpen.endPath() >>> roundpen.addComponent("a", (1.5, 0, 0, 1.5, 10.5, -10.5)) >>> recpen.value == [ ... ('beginPath', (), {}), ... ('addPoint', ((0, 1), 'line', False, None), {}), ... ('addPoint', ((2, 3), 'line', False, None), {}), ... ('addPoint', ((2, 5), None, False, None), {}), ... ('addPoint', ((3, 6), None, False, None), {}), ... ('addPoint', ((5, 6), 'qcurve', False, None), {}), ... ('endPath', (), {}), ... ('addComponent', ('a', (1.5, 0, 0, 1.5, 11, -10)), {}), ... ] True c@t||||_||_yr r rs rrzRoundingPointPen.__init__crrc |jj|j|d|j|dff||||d|y)Nrr) segmentTypesmoothname identifier)raddPointr)rrrGrHrIrJkwargss rrKzRoundingPointPen.addPointhsU   ^^BqE "DNN2a5$9 : #!    rc &|\}}}}} } |jj|t|j||j||j||j||j | |j | fd|i|y)NrJr4) r baseGlyphNamer7rJrLr8r9r:r;r<r=s rr5zRoundingPointPen.addComponentts!/BBB! !!  ''+''+''+''+r"r"   "  r)NFNNr ) r>r?r@rArrrrKr5rBrCs@rr r Es%:*1W5 IM   rN) fontTools.misc.roundToolsrrfontTools.misc.transformrfontTools.pens.filterPenrr__all__rr rrrTs46.> , -9 )9 x= ~= r