diff --git a/docs/glyph-inspector.html b/docs/glyph-inspector.html index cc49e23e..138a75ee 100644 --- a/docs/glyph-inspector.html +++ b/docs/glyph-inspector.html @@ -5,7 +5,8 @@ - + +

opentype.js

@@ -143,9 +144,13 @@

Free Software

} var glyph = font.glyphs.get(glyphIndex), html = '
'; - html += '
name
'+glyph.name+'
'; - + html += '
glyphName
'+glyph.name+'
'; if (glyph.unicodes.length > 0) { + const char = String.fromCodePoint.apply(null, glyph.unicodes); + html += '
glyph
'+char+'
'; + const hex = char.codePointAt(0).toString(16); + html += '
htmlCode
&#x'+hex+';
'; + html += '
cssCode
content: \'\\'+hex+'\';
'; html += '
unicode
'+ glyph.unicodes.map(formatUnicode).join(', ') +'
'; } html += '
index
'+glyph.index+'
'; @@ -338,7 +343,7 @@

Free Software

options, { fill: typeof paletteIndex !== 'undefined' ? window.font.palettes.getColor(paletteIndex, window.fontOptions.usePalette) : '#000000' } ); - + if (/(^#ffffff)|(00$)/.test(overwriteOptions.fill)) { overwriteOptions.fill = '#000000'; } @@ -399,7 +404,7 @@

Free Software

updateVariationOptions(); } const selectedPage = document.querySelector('.page-selected'); - const pageIndex = Array.from(selectedPage.parentElement.children).indexOf(selectedPage); + const pageIndex = Array.from(selectedPage.parentElement.children).indexOf(selectedPage); displayGlyphPage(pageIndex); const glyphIndex = document.querySelector('[data-glyph-index]')?.dataset.glyphIndex; if(glyphIndex) { @@ -558,10 +563,19 @@

Free Software

} catch (err) { showErrorMessage('Error loading font from localStorage'); error = err; - } + } onFontLoaded(opentype.parse(isWoff2 ? Module.decompress(data) : data, { lowMemory: true })); if ( !error ) showErrorMessage(''); + const styleTag = document.getElementById("OpentypeCustomFontTag"); + const blob = new Blob([data], { type: 'application/octet-stream' }); + const url = URL.createObjectURL(blob); + styleTag.innerHTML = ` + @font-face { + font-family: 'OpentypeCustomFont'; + src: url(${url}); + } + `.trim(); } catch (err) { showErrorMessage(err.toString()); throw err;