Skip to content

Commit

Permalink
Remove responsibility from OpenTypeBuilder for creating layers for CO…
Browse files Browse the repository at this point in the history
…LR fonts.
  • Loading branch information
robmeek committed Jan 9, 2025
1 parent 53eb5a6 commit d4de5b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
9 changes: 8 additions & 1 deletion src/fonthx/examples/pixelfonter/PixelFonter.hx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import fonthx.opentype.BuildOptions;
import fonthx.services.FeatureSpecParser;
import fonthx.opentype.OpenTypeBuilder;
import fonthx.model.color.RGBAColor;
import fonthx.model.font.IContourGlyph;
using StringTools;
using Lambda;

Expand Down Expand Up @@ -88,7 +89,13 @@ class PixelFonter {
font.addDefaultGlyphs();

if (opts.includeCOLR) {

for (i in 0...font.glyphs.length) {
var g:IContourGlyph = font.glyphs[i];
var layers = g.getLayers();
for (l in layers) {
font.glyphs.push(l);
}
}
}

if (opts.useComposites) {
Expand Down
10 changes: 0 additions & 10 deletions src/fonthx/opentype/OpenTypeBuilder.hx
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,6 @@ class OpenTypeBuilder {
return null;
}

if (options.includeCOLR) {
for (i in 0...font.glyphs.length) {
var g:IContourGlyph = font.glyphs[i];
var layers = g.getLayers();
for (l in layers) {
font.glyphs.push(l);
}
}
}

if (options.sortGlyphs) {
font.sortGlyphs();
}
Expand Down

0 comments on commit d4de5b6

Please sign in to comment.