Module: Fontisan::Stitcher::GlyphSignature
- Defined in:
- lib/fontisan/stitcher/glyph_signature.rb
Overview
Stateless signature computation for a Ufo::Glyph's visual identity.
Two glyphs with the same signature are visually interchangeable and can share a gid in the output font. The signature captures advance width, every contour's points (x, y, type), and every component reference (base glyph + transform presence).
Used by Deduplicator to merge identical outlines from different donors, reducing the glyph count below the TrueType 65,535 cap.
Class Method Summary collapse
-
.for(glyph) ⇒ String
SHA-256 hex digest of the glyph's outline identity.
Class Method Details
.for(glyph) ⇒ String
Returns SHA-256 hex digest of the glyph's outline identity.
19 20 21 |
# File 'lib/fontisan/stitcher/glyph_signature.rb', line 19 def self.for(glyph) Digest::SHA256.hexdigest(canonical_representation(glyph)) end |