ecomfe / fontmin

Minify font seamlessly
http://ecomfe.github.io/fontmin
MIT License
5.72k stars 314 forks source link

Bug? Whitespace trimming #39

Open nicothin opened 8 years ago

nicothin commented 8 years ago

my command:

text="`cat subset.txt`" && node_modules/.bin/fontmin -t "$text" fonts/lato/lato__latofonts_com.ttf > fonts/lato/lato__fontmin.ttf

in subset.txt:

! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~©«»ЁАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюяё‐‑‒–—―‘‚“„…‰™

whitespace character is in the set but when I open the .ttf in FontForge, I see that the space character in the font is missing. 空白字符是集合 但是当我在FontForge打开.TTF,我看到,在字体的空格字符缺失。

grumpy commented 7 years ago

I thought this was strange as well. If you pass trim: false in the opts it will include the space. The downside is that for certain fonts it is replacing the space with some other glyph. This leads to another bug. See https://github.com/ecomfe/fontmin/issues/43