MindMap/frontend/node_modules/dingbat-to-unicode
lixinran 5b73857835 Initial commit: AI思维导图生成器项目
- 基于Django + Vue.js的智能思维导图生成和管理系统
- 支持AI驱动的文档分析和可视化思维导图创建
- 包含完整的前后端代码和文档
2025-09-04 13:47:42 +08:00
..
dist Initial commit: AI思维导图生成器项目 2025-09-04 13:47:42 +08:00
README.md Initial commit: AI思维导图生成器项目 2025-09-04 13:47:42 +08:00
package.json Initial commit: AI思维导图生成器项目 2025-09-04 13:47:42 +08:00

README.md

dingbat-to-unicode

Mapping from Dingbat fonts, such as Symbol, Webdings and Wingdings, to Unicode code points.

The following fonts are supported:

  • Symbol
  • Webdings
  • Wingdings 1
  • Wingdings 2
  • Wingdings 3

Note that in some cases, such as docx files, the dingbat code point may have 0xF000 added to it to shift the code point into the Unicode private use area. You should subtract 0xF000 from the code point before passing it into this library.

Installation

npm install dingbat-to-unicode

Usage

Import using require or import:

const dingbatToUnicode = require("dingbat-to-unicode");
// or
import * as dingbatToUnicode from "dingbat-to-unicode";

You can then call one of the following functions, depending on the representation you have the dingbat code point in:

  • dingbatToUnicode.codePoint(typeface: string, codePoint: number): UnicodeScalarValue | undefined

  • dingbatToUnicode.dec(typeface: string, dec: string): UnicodeScalarValue | undefined

  • dingbatToUnicode.hex(typeface: string, hex: string): UnicodeScalarValue | undefined

UnicodeScalarValue is an object with two properties:

  • codePoint: a number representing the Unicode code point
  • string: a string representing the code point as a string

Examples

const result = dingbatToUnicode.codePoint("Wingdings", 41)!!;
assert.strictEqual(result.codePoint, 0x2706);
const result = dingbatToUnicode.dec("Wingdings", "41")!!;
assert.strictEqual(result.codePoint, 0x2706);
const result = dingbatToUnicode.hex("Wingdings", "29")!!;
assert.strictEqual(result.codePoint, 0x2706);
const result = dingbatToUnicode.hex("Wingdings", "3E")!!;
assert.strictEqual(result.codePoint, 0x2707);
const result = dingbatToUnicode.hex("Wingdings", "3e")!!;
assert.strictEqual(result.codePoint, 0x2707);
const result = dingbatToUnicode.hex("Wingdings", "29")!!;
assert.strictEqual(result.string, "\u2706");
const result = dingbatToUnicode.hex("Wingdings", "28")!!;
assert.strictEqual(result.string, "🕿");