Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/cff/CFFTop.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ class CFFPrivateOp {
let FontDict = new CFFDict([
// key name type(s) default
[18, 'Private', new CFFPrivateOp, null],
[[12, 38], 'FontName', 'sid', null]
[[12, 38], 'FontName', 'sid', null],
[[12, 7], 'FontMatrix', 'array', [0.001, 0, 0, 0.001, 0, 0]],
[[12, 5], 'PaintType', 'number', 0],
]);

let CFFTopDict = new CFFDict([
Expand Down
12 changes: 9 additions & 3 deletions test/subset.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ describe('font subsetting', function() {
done();
}));
});

it('should re-encode variation glyphs', function(done) {
if (!fs.existsSync('/Library/Fonts/Skia.ttf')) return done();

let font = fontkit.openSync('/Library/Fonts/Skia.ttf', 'Bold');
let subset = font.createSubset();
for (let glyph of font.glyphsForString('e')) {
Expand Down Expand Up @@ -80,7 +80,13 @@ describe('font subsetting', function() {

it('should create a CFFSubset instance', function() {
let subset = font.createSubset();
return assert.equal(subset.constructor.name, 'CFFSubset');
assert.equal(subset.constructor.name, 'CFFSubset');

if (fs.existsSync('/Library/Fonts/PingFang.ttc')) {
let pingfang = fontkit.openSync('/Library/Fonts/PingFang.ttc', 'PingFangTC-Regular');
subset = pingfang.createSubset();
assert.equal(subset.constructor.name, 'CFFSubset');
}
});

it('should produce a subset', function(done) {
Expand Down