Skip to content

Commit

Permalink
Remove the unused glyphNameMap parameter from Type2Compiled
Browse files Browse the repository at this point in the history
As part of the changes in PR 4259, which landed over ten years ago, the `glyphNameMap` property on `Font`-instances was removed.
The reason that this didn't cause any bugs is that we always fallback on `getGlyphsUnicode`, and when using that data we also rely on `StandardEncoding`, hence we should just remove the unused parameter from the `Type2Compiled` constructor.
  • Loading branch information
Snuffleupagus committed Dec 27, 2024
1 parent 4547f23 commit aba6369
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/font_renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -870,14 +870,14 @@ class TrueTypeCompiled extends CompiledFont {
}

class Type2Compiled extends CompiledFont {
constructor(cffInfo, cmap, fontMatrix, glyphNameMap) {
constructor(cffInfo, cmap, fontMatrix) {
super(fontMatrix || [0.001, 0, 0, 0.001, 0, 0]);

this.glyphs = cffInfo.glyphs;
this.gsubrs = cffInfo.gsubrs || [];
this.subrs = cffInfo.subrs || [];
this.cmap = cmap;
this.glyphNameMap = glyphNameMap || getGlyphsUnicode();
this.glyphNameMap = getGlyphsUnicode();

this.gsubrsBias = getSubroutineBias(this.gsubrs);
this.subrsBias = getSubroutineBias(this.subrs);
Expand Down Expand Up @@ -931,7 +931,7 @@ class FontRendererFactory {
fontMatrix
);
}
return new Type2Compiled(cff, cmap, font.fontMatrix, font.glyphNameMap);
return new Type2Compiled(cff, cmap, font.fontMatrix);
}
}

Expand Down

0 comments on commit aba6369

Please sign in to comment.