【发布时间】:2020-11-02 11:37:14
【问题描述】:
我正在尝试按照https://github.com/danmarshall/google-font-to-svg-path 的示例将 Google 字体创建为 svg。我的代码如下:
opentype.load('https://fonts.googleapis.com/css2?family=' + 'ABeeZee', (err, font) => {
const textModel = new makerjs.models.Text(font, 'Test', 20, false, false, 1);
const svg = makerjs.exporter.toSVG(textModel);
console.log(svg);
});
我不断收到错误消息:ERROR TypeError: Cannot read property 'forEachGlyph' of null,我该如何解决?我的代码基于此处的示例:https://github.com/danmarshall/google-font-to-svg-path/blob/master/index.ts#L73-L97。
【问题讨论】:
标签: javascript svg opentype