diff --git a/README.md b/README.md index d172e9c..bda20a9 100644 --- a/README.md +++ b/README.md @@ -36,8 +36,10 @@ const font = Font.create(buffer, { type: 'ttf', // only read `a`, `b` glyphs subset: [65, 66], - // save font hinting + // read font hinting tables, default false hinting: true, + // read font kerning tables, default false + kerning: true, // transform ttf compound glyph to simple compound2simple: true, // inflate function for woff @@ -71,8 +73,10 @@ console.log(Object.keys(fontObject)); const buffer = font.write({ // support ttf, woff, woff2, eot, svg type: 'woff', - // save font hinting, default false - hinting: true, + // save font hinting tables, default false + hinting: false, + // save font kerning tables, default false + kerning: false, // write glyf data when simple glyph has no contours, default false writeZeroContoursGlyfData: false, // deflate function for woff, eg. pako.deflate diff --git a/demo/js/ttfmin.js b/demo/js/ttfmin.js index fc8b635..019c2e4 100644 --- a/demo/js/ttfmin.js +++ b/demo/js/ttfmin.js @@ -17,12 +17,12 @@ function onUpFileChange(e) { let file = e.target.files[0]; let reader = new FileReader(); reader.onload = function (e) { - let ttfReader = new TTFReader({ - hinting: true + hinting: true, + kerning: true, }); curttfData = ttfReader.read(e.target.result); - + console.log(curttfData); ttfmin(); }; @@ -69,7 +69,8 @@ function ttfmin() { let family = 'font-with-hitting'; ttf.get().name.fontFamily = family; let writer = new TTFWriter({ - hinting: true + hinting: true, + kerning: true, }); let buffer = writer.write(ttf.get()); setFont({ diff --git a/demo/ttfmin.html b/demo/ttfmin.html index bd469f6..86602dc 100644 --- a/demo/ttfmin.html +++ b/demo/ttfmin.html @@ -17,9 +17,13 @@ div { padding: 10px; } - + .text-title { + display: inline-block; + width: 140px; + } .ttf-text { font-size: 14px; + letter-spacing: 1px; } .ttf-min-with-hitting { @@ -39,16 +43,24 @@