-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Newest version of restructure doesn't support all string encodings #331
Comments
Can you reproduce this here? Noting that this may be related to diegomura/react-pdf#2675 |
Repro!var fontkit = require('fontkit');
// open a font synchronously
var font = fontkit.openSync('src/arial-bold.ttf');
// layout a string, using default shaping features.
// returns a GlyphRun, describing glyphs and positions.
var run = font.layout('hello world!');
// get an SVG path for a glyph
var svg = run.glyphs[0].path.toSVG();
// create a font subset
var subset = font.createSubset();
run.glyphs.forEach(function(glyph) {
subset.includeGlyph(glyph);
});
console.log('name:'+font.getName());
console.log('fullname:'+font.fullName);
let buffer = subset.encode();
console.dir({buffer}); fullnae is |
also repro:
|
Here https://github.com/foliojs/fontkit/blob/master/src/tables/name.js#L13 Is where random encodings are passed to restructure. |
Thanks, you beat me to it. That was essentially my repro. I should have posted it at the beginning. |
Fixed by foliojs/restructure#62 |
It appears that the newest version of
restructure
does not support all string encodings. When I tried to open a font file on my mac, the font name fields were all null becauserestructure
does not support thex-mac-roman
encoding. Perhaps fontkit should depend strictly onrestructure
v3.0.0 untilrestructure
updates?foliojs/restructure#60 (comment)
The text was updated successfully, but these errors were encountered: