Comments (8)
@aui 抱歉, 弄了个残疾上去
1.已经修复
2.残疾
from ttf2svg.
方正兰亭超细黑简体
我也在做字体自动化压缩的工具,完善后将开源,到时候可以一起交流。
from ttf2svg.
https://github.com/qdsang/fonts-streamline
先前弄了个只支持svg格式字体的优化
from ttf2svg.
修改 lib/Font.js 98 行后可以支持中文字体
this.cmap.cmaps.forEach(function (item, index) {
item.glyphIndexArray.forEach(function (glyphIndex, code) {
glyphIndex = index + glyphIndex;
var glyph = self.glyf.glyphs[glyphIndex];
var char = toChar(code);
if (!!glyphIndex && !!glyph && char) {
glyphs.push({
unicode: char,
boundingBox: glyph.boundingBox,
path: glyph.toSVGPath()
});
}
});
});
但是,仍然有另外一个问题没有解决:
如果字体是被精简后的版本(缺乏字符),工具无法转换
from ttf2svg.
我也是这么尝试了下,发现生成后的字体库存在重复的,并且unicode部分错误。
题外话: 米厂也再在大量使用方正兰亭超细,不知道是巧还是大势
from ttf2svg.
如果字体是被精简后的版本(缺乏字符),工具无法转换
--- 已经帮修复
from ttf2svg.
lib/Font.js 的 42 行getMeta
方法错误,没有获取到预期返回结果,导致输出的 svg 文件缺失id
与font-family
字段。
from ttf2svg.
使用fontforge 生成的svg字体只有2.9M
使用ttf2svg 生成4.4M, 感觉像是某个区块重复了
family取值的修改已经提交了
from ttf2svg.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ttf2svg.