Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
3 2øªj|ã@s:dZddlmZddlmZmZdgZGdd„deƒZdS)zUfontTools.pens.pointInsidePen -- Pen implementing "point inside" testing for shapes. é)ÚBasePen)ÚsolveQuadraticÚ solveCubicÚPointInsidePenc@sleZdZdZddd„Zddd„Zdd„Zd d „Zd d „Zd d„Z dd„Z dd„Z dd„Z dd„Z dd„ZdS)ra:This pen implements "point inside" testing: to test whether a given point lies inside the shape (black) or outside (white). Instances of this class can be recycled, as long as the setTestPoint() method is used to set the new point to test. Typical usage: pen = PointInsidePen(glyphSet, (100, 200)) outline.draw(pen) isInside = pen.getResult() Both the even-odd algorithm and the non-zero-winding-rule algorithm are implemented. The latter is the default, specify True for the evenOdd argument of __init__ or setTestPoint to use the even-odd algorithm. FcCstj||ƒ|j||ƒdS)N)rÚ__init__Ú setTestPoint)ÚselfZglyphSetÚ testPointÚevenOdd©r úB/tmp/pip-build-_d5lkt3n/fonttools/fontTools/pens/pointInsidePen.pyr)s zPointInsidePen.__init__cCs||_||_d|_d|_dS)zASet the point to test. Call this _before_ the outline gets drawn.Nr)r r Ú firstPointÚintersectionCount)rr r r r r r-szPointInsidePen.setTestPointcCs|jdk r|jƒ|jS)N)r Ú closePathr)rr r r Ú getWinding4s zPointInsidePen.getWindingcCs*|jƒ}|jr|d}n |jdk}| S)z‡After the shape has been drawn, getResult() returns True if the test point lies within the (black) shape, and False if it doesn't. ér)rr r)rZwindingÚresultr r r Ú getResult;s   zPointInsidePen.getResultcCs,|js |r|jd7_n|jd8_dS)Né)r r)rZgoingUpr r r Ú_addIntersectionFs zPointInsidePen._addIntersectioncCs|jdk r|jƒ||_dS)N)r r)rÚpointr r r Ú_moveToLs zPointInsidePen._moveToc Cs |j\}}|jƒ\}}|\}}||kr2||kr2dS||krF||krFdS||krZ||krZdS||}||} ||| } || |} | |krŽdS|j||kƒdS)N)r Ú_getCurrentPointr) rrÚxÚyÚx1Úy1Úx2Úy2ÚdxÚdyÚtÚixr r r Ú_lineToSs     zPointInsidePen._lineToc CsP|j\}}|jƒ\}}|\}} |\} } |\} } ||krR||krR| |krR| |krRdS||krv| |krv| |krv| |krvdS||krš| |krš| |krš| |kršdS|}| |d}| | d|}| |||}tt|||||ƒƒ}dd„|Dƒ}|södS|}||d}| |d|}| |||}||k}d}�x|D�] }||k�rN�q:|}||}||}d||d|||}|dk}}|dk�rÐd||d|}|dk}| }|dk�rÐ|}|dk}}|||||||}||k�rú�q:|d k�r|�sF|j|ƒn0|dk�r2|�rF|j|ƒn||k�r:|j|ƒ�q:WdS) Ng@cSs(g|] }d|kodknr|‘qS)ggð?g€r )Ú.0r!r r r ú zsz.PointInsidePen._curveToOne..érçégð?ç€)r'r))r rÚsortedrr) rZbcp1Zbcp2rrrrrrrÚx3Úy3Zx4Zy4r ÚcyZbyZayÚ solutionsrZcxZbxZaxZaboveZlastTr!Út2Út3Ú directionZincomingGoingUpZoutgoingGoingUpZxtr r r Ú _curveToOnegsf                  zPointInsidePen._curveToOnecCsp|j\}}|jƒ\}}|\}}|\} } |} || d} | | | } tt| | | |ƒƒ}dd„|Dƒ}|sldSdS)Ng@cSs(g|] }t|kotknr|‘qSr )ZZERO_MINUS_EPSILONZONE_PLUS_EPSILON)r$r!r r r r%²sz:PointInsidePen._qCurveToOne_unfinished..)r rr*r)rZbcprrrrrrrr+r,ÚcÚbÚar.r r r Ú_qCurveToOne_unfinished¦s    z&PointInsidePen._qCurveToOne_unfinishedcCs$|jƒ|jkr|j|jƒd|_dS)N)rr ZlineTo)rr r r Ú _closePath·s zPointInsidePen._closePathcCst‚dS)z,Insideness is not defined for open contours.N)ÚNotImplementedError)rr r r Ú_endPath¼szPointInsidePen._endPathN)F)F)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrrrrrr#r2r6r7r9r r r r r s   ?N)r=ZfontTools.pens.basePenrZfontTools.misc.bezierToolsrrÚ__all__rr r r r Ús