How to use the fonteditor-core/ttf/ttf function in fonteditor-core

To help you get started, we’ve selected a few fonteditor-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kekee000 / fonteditor-core / demo / js / ttf2svg.js View on Github external
function showTTFGlyf(ttfData) {
    let ttf = new TTF(ttfData);
    let codes = ttf.codes();

    let str = '';
    // 获取unicode字符
    codes.forEach(function (item) {
        str += '<li data-code="' + item + '">'
            + '<span class="i-font">' + String.fromCharCode(item) + '</span>'
            +   (item &gt; 255 ? '\\u' + Number(item).toString(16) : item)
            + '</li>';
    });
    $('#font-list').html(str);
}
github kekee000 / fonteditor-core / demo / js / ttf2eot.js View on Github external
function showTTFGlyf(ttfData) {
    let ttf = new TTF(ttfData);
    let codes = ttf.codes();

    let str = '';
    // 获取unicode字符
    codes.forEach(function (item) {
        str += '<li data-code="' + item + '">'
            + '<span class="i-font">' + String.fromCharCode(item) + '</span>'
            +   (item &gt; 255 ? '\\u' + Number(item).toString(16) : item)
            + '</li>';
    });
    $('#font-list').html(str);
}
github kekee000 / fonteditor-core / demo / js / glyfsvg.js View on Github external
function showTTFGlyf(ttfData) {

    ttf = new TTF(ttfData);
    let codes = ttf.codes();

    let str = '';

    // 获取unicode字符
    codes.forEach(function (item) {
        str += '<li data-code="' + item + '">'
            + '<span class="i-font">' + String.fromCharCode(item) + '</span>'
            +   (item &gt; 255 ? '\\u' + Number(item).toString(16) : item)
            + '</li>';
    });

    $('#font-list').html(str);

    $('#font-list li:nth-child(4)').click();
}
github kekee000 / fonteditor-core / demo / js / glyfcanvas.js View on Github external
function showTTFGlyf(ttfData) {

    ttf = new TTF(ttfData);
    let codes = ttf.codes();

    let str = '';
    // 获取unicode字符
    codes.forEach(function (item) {
        str += '<li data-code="' + item + '">'
            + '<span class="i-font">' + String.fromCharCode(item) + '</span>'
            +   (item &gt; 255 ? '\\u' + Number(item).toString(16) : item)
            + '</li>';
    });
    $('#font-list').html(str);
    $('#font-list li:nth-child(4)').click();
}
github kekee000 / fonteditor-core / demo / js / ttf2woff.js View on Github external
function showTTFGlyf(ttfData) {
    let ttf = new TTF(ttfData);
    let codes = ttf.codes();

    let str = '';
    // 获取unicode字符
    codes.forEach(function (item) {
        str += '<li data-code="' + item + '">'
            + '<span class="i-font">' + String.fromCharCode(item) + '</span>'
            +   (item &gt; 255 ? '\\u' + Number(item).toString(16) : item)
            + '</li>';
    });
    $('#font-list').html(str);
}
github kekee000 / fonteditor-core / demo / js / otfreader.js View on Github external
function showOTFGlyf(otfData) {
    ttf = new TTF(otfData);
    let codes = ttf.codes();

    let str = '';
    // 获取unicode字符
    codes.forEach(function (item) {
        str += '<li data-code="' + item + '">'
            + '<span class="i-font">' + String.fromCharCode(item) + '</span>'
            +   (item &gt; 255 ? '\\u' + Number(item).toString(16) : item)
            + '</li>';
    });
    $('#font-list').html(str);
    $('#font-list li:nth-child(4)').click();
}