Skip to content

Commit

Permalink
add glyph, htmlCode, cssCode to glyph inspector.
Browse files Browse the repository at this point in the history
  • Loading branch information
ahaoboy authored Dec 21, 2023
1 parent a769436 commit ab5c2c2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion docs/glyph-inspector.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,12 @@ <h1>Free Software</h1>
}
var glyph = font.glyphs.get(glyphIndex),
html = '<dl>';
html += '<dt>name</dt><dd>'+glyph.name+'</dd>';
html += '<dt>glyphName</dt><dd>'+glyph.name+'</dd>';
var char = String.fromCodePoint.apply(null, glyph.unicodes);
html += '<dt>glyph</dt><dd>'+char+'</dd>';
var hex = char.codePointAt(0).toString(16);
html += '<dt>htmlCode</dt><dd>&amp;#x'+hex+';</dd>';
html += '<dt>cssCode</dt><dd>content: \'\\'+hex+'\';</dd>';

if (glyph.unicodes.length > 0) {
html += '<dt>unicode</dt><dd>'+ glyph.unicodes.map(formatUnicode).join(', ') +'</dd>';
Expand Down

0 comments on commit ab5c2c2

Please sign in to comment.