Skip to content

Commit

Permalink
feat: make findUnicodeGlyphsMap public
Browse files Browse the repository at this point in the history
  • Loading branch information
Romashine committed Jul 6, 2021
1 parent 94efd69 commit 7e249a6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Font.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class Font extends BaseClass {
this.warnings = parameters.warnings || [];
}

private findUnicodeGlyphsMap(): GlyphMap | null {
public findUnicodeGlyphsMap(): GlyphMap | null {
const cmap: Tables.CMAP = this.tables.get(Tables.CMAP.tag);

// find unicode table (platform 0 or platform 3-1 or 3-10)
Expand All @@ -112,7 +112,7 @@ export class Font extends BaseClass {
* Returns glyph by letter or unicode
* @param value One letter or unicode
*/
public findGlyphByUnicode(value: string | number): Tables.Glyph | null {
public findUnicodeGlyph(value: string | number): Tables.Glyph | null {
const map = this.findUnicodeGlyphsMap();
if (!map) {
return null;
Expand Down
2 changes: 1 addition & 1 deletion test/Font.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ context("Font", () => {
hexstring: Buffer.from(fontB64, "base64").toString("hex"),
});
const font = fontjs.Font.fromStream(stream);
const glyph = font.findGlyphByUnicode(" ");
const glyph = font.findUnicodeGlyph(" ");
assert(glyph);
});

Expand Down

0 comments on commit 7e249a6

Please sign in to comment.