Refactor into geometry tree
This commit is contained in:
parent
f17710b0a4
commit
a81c477fab
6 changed files with 207 additions and 121 deletions
|
@ -3,6 +3,7 @@
|
|||
const TypoGeom = require("typo-geom");
|
||||
const Point = require("../../support/point");
|
||||
const CurveUtil = require("../../support/curve-util");
|
||||
const util = require("util");
|
||||
|
||||
module.exports = finalizeGlyphs;
|
||||
function finalizeGlyphs(para, glyphStore) {
|
||||
|
@ -16,7 +17,7 @@ function finalizeGlyphs(para, glyphStore) {
|
|||
|
||||
function suppressNaN(glyphStore) {
|
||||
for (const g of glyphStore.glyphs()) {
|
||||
if (g.geometry) g.geometry.suppressNaN();
|
||||
// if (g.geometry) g.geometry.suppressNaN();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,7 +29,7 @@ function regulateGlyphStore(skew, glyphStore) {
|
|||
if (!regulateCompositeGlyph(glyphStore, g)) {
|
||||
const cs = g.geometry.asContours();
|
||||
g.clearGeometry();
|
||||
for (const c of cs) g.geometry.addContour(c);
|
||||
g.includeContours(cs, 0, 0);
|
||||
}
|
||||
}
|
||||
for (const g of glyphStore.glyphs()) {
|
||||
|
@ -55,7 +56,7 @@ function regulateSimpleGlyph(g, skew) {
|
|||
for (const contour of cs) for (const z of contour) z.x += z.y * skew;
|
||||
|
||||
g.clearGeometry();
|
||||
for (const c of cs) g.geometry.addContour(c);
|
||||
g.includeContours(cs, 0, 0);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue