GithubHelp home page GithubHelp logo

Comments (8)

qdsang avatar qdsang commented on June 25, 2024

@aui 抱歉, 弄了个残疾上去
1.已经修复
2.残疾

from ttf2svg.

aui avatar aui commented on June 25, 2024

方正兰亭超细黑简体

我也在做字体自动化压缩的工具,完善后将开源,到时候可以一起交流。

from ttf2svg.

qdsang avatar qdsang commented on June 25, 2024

https://github.com/qdsang/fonts-streamline
先前弄了个只支持svg格式字体的优化

from ttf2svg.

aui avatar aui commented on June 25, 2024

修改 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.

qdsang avatar qdsang commented on June 25, 2024

我也是这么尝试了下,发现生成后的字体库存在重复的,并且unicode部分错误。

题外话: 米厂也再在大量使用方正兰亭超细,不知道是巧还是大势

from ttf2svg.

aui avatar aui commented on June 25, 2024

如果字体是被精简后的版本(缺乏字符),工具无法转换
--- 已经帮修复

from ttf2svg.

aui avatar aui commented on June 25, 2024

lib/Font.js 的 42 行getMeta方法错误,没有获取到预期返回结果,导致输出的 svg 文件缺失idfont-family字段。

from ttf2svg.

qdsang avatar qdsang commented on June 25, 2024

font-family 取值有些问题
image

使用fontforge 生成的svg字体只有2.9M
使用ttf2svg 生成4.4M, 感觉像是某个区块重复了

family取值的修改已经提交了

from ttf2svg.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.