From 5138195d335706a59ff19b60bb63ae28ca25b490 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 16 Jan 2021 15:21:03 +0000 Subject: Support finding dingbats by code point --- js/src/index.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'js/src') diff --git a/js/src/index.ts b/js/src/index.ts index b808cba..13b1f3b 100644 --- a/js/src/index.ts +++ b/js/src/index.ts @@ -16,10 +16,14 @@ for (const dingbat of dingbats) { dingbatsByHex[dingbat["Typeface name"] + "_" + dingbat["Dingbat hex"]] = scalarValue; } -export function hex(typeface: string, hex: string): UnicodeScalarValue | undefined { - return dingbatsByHex[typeface + "_" + hex.toUpperCase()]; +export function codePoint(typeface: string, codePoint: number): UnicodeScalarValue | undefined { + return dingbatsByDec[typeface + "_" + codePoint]; } export function dec(typeface: string, dec: string): UnicodeScalarValue | undefined { return dingbatsByDec[typeface + "_" + dec]; } + +export function hex(typeface: string, hex: string): UnicodeScalarValue | undefined { + return dingbatsByHex[typeface + "_" + hex.toUpperCase()]; +} -- cgit v1.2.3