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øªjW ã@s4ddlZddlmZddlmZGdd„deƒZdS)éN)ÚMissingComponentError)ÚAbstractPointPenc@sLeZdZdZddd„Zedd„ƒZddd „Zd d „Zdd d„Z ddd„Z dS)Ú HashPointPena‰ This pen can be used to check if a glyph's contents (outlines plus components) have changed. Components are added as the original outline plus each composite's transformation. Example: You have some TrueType hinting code for a glyph which you want to compile. The hinting code specifies a hash value computed with HashPointPen that was valid for the glyph's outlines at the time the hinting code was written. Now you can calculate the hash for the glyph's current outlines to check if the outlines have changed, which would probably make the hinting code invalid. > glyph = ufo[name] > hash_pen = HashPointPen(glyph.width, ufo) > glyph.drawPoints(hash_pen) > ttdata = glyph.lib.get("public.truetype.instructions", None) > stored_hash = ttdata.get("id", None) # The hash is stored in the "id" key > if stored_hash is None or stored_hash != hash_pen.hash: > logger.error(f"Glyph hash mismatch, glyph '{name}' will have no instructions in font.") > else: > # The hash values are identical, the outline has not changed. > # Compile the hinting code ... > pass rNcCs||_dt|dƒg|_dS)Nzw%sé )ÚglyphsetÚroundÚdata)ÚselfZ glyphWidthZglyphSet©r ú@/tmp/pip-build-_d5lkt3n/fonttools/fontTools/pens/hashPointPen.pyÚ__init__$szHashPointPen.__init__cCs0dj|jƒ}t|ƒdkr,tj|jdƒƒjƒ}|S)NÚé€Úascii)ÚjoinrÚlenÚhashlibÚsha512ÚencodeÚ hexdigest)r rr r r Úhash(s  zHashPointPen.hashcKsdS)Nr )r Ú identifierÚkwargsr r r Ú beginPath/szHashPointPen.beginPathcCs|jjdƒdS)Nú|)rÚappend)r r r r ÚendPath2szHashPointPen.endPathFcKs>|dkrd}n|d}|jj|›|dd›|dd›�ƒdS)NÚorÚgéz+g)rr)r ÚptZ segmentTypeZsmoothÚnamerrZpt_typer r r ÚaddPoint5s zHashPointPen.addPointc Ksjdjdd„|Dƒƒ}|jjdƒy|j|j|ƒWntk rPt|ƒ‚YnX|jjd|›d�ƒdS)Nr cSsg|] }|d›‘qS)ú+r )Ú.0Útr r r ú Gsz-HashPointPen.addComponent..ú[ú(z)])rrrrZ drawPointsÚKeyErrorr)r Z baseGlyphNameZtransformationrrÚtrr r r Ú addComponentDs zHashPointPen.addComponent)rN)N)NFNN)N) Ú__name__Ú __module__Ú __qualname__Ú__doc__r Úpropertyrrrr"r+r r r r rs    r)rZfontTools.pens.basePenrZfontTools.pens.pointPenrrr r r r Ús