Skip to content

Commit ab5c2c2

Browse files
authored
add glyph, htmlCode, cssCode to glyph inspector.
1 parent a769436 commit ab5c2c2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

docs/glyph-inspector.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,12 @@ <h1>Free Software</h1>
130130
}
131131
var glyph = font.glyphs.get(glyphIndex),
132132
html = '<dl>';
133-
html += '<dt>name</dt><dd>'+glyph.name+'</dd>';
133+
html += '<dt>glyphName</dt><dd>'+glyph.name+'</dd>';
134+
var char = String.fromCodePoint.apply(null, glyph.unicodes);
135+
html += '<dt>glyph</dt><dd>'+char+'</dd>';
136+
var hex = char.codePointAt(0).toString(16);
137+
html += '<dt>htmlCode</dt><dd>&amp;#x'+hex+';</dd>';
138+
html += '<dt>cssCode</dt><dd>content: \'\\'+hex+'\';</dd>';
134139

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

0 commit comments

Comments
 (0)