From aba63696387f216fc510d6d5eba1ba1361a5817b Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Fri, 27 Dec 2024 14:06:14 +0100 Subject: [PATCH] Remove the unused `glyphNameMap` parameter from `Type2Compiled` 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. --- src/core/font_renderer.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/font_renderer.js b/src/core/font_renderer.js index 37342fc30..8c37b916e 100644 --- a/src/core/font_renderer.js +++ b/src/core/font_renderer.js @@ -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); @@ -931,7 +931,7 @@ class FontRendererFactory { fontMatrix ); } - return new Type2Compiled(cff, cmap, font.fontMatrix, font.glyphNameMap); + return new Type2Compiled(cff, cmap, font.fontMatrix); } }