You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
439 B

'use strict';
// See documentation here: http://www.microsoft.com/typography/otspec/hmtx.htm
var _ = require('lodash');
var ByteBuffer = require('microbuffer');
function createHtmxTable(font) {
var buf = new ByteBuffer(font.glyphs.length * 4);
_.forEach(font.glyphs, function (glyph) {
buf.writeUint16(glyph.width); //advanceWidth
buf.writeInt16(glyph.xMin); //lsb
});
return buf;
}
module.exports = createHtmxTable;