Iosevka/font-src/gen/otd-conv/name.js
be5invis 7c78329244 * Replace autoRef with semantic inclusion for more stable results.
* Move files around to make repository organized better.
2020-10-17 15:45:00 -07:00

20 lines
473 B
JavaScript

const { Ot } = require("ot-builder");
module.exports = convertName;
function convertName(otdName) {
const name = new Ot.Name.Table();
for (const entry of otdName) {
name.records.push({
platformID: entry.platformID,
encodingID: entry.encodingID,
languageID: entry.languageID,
nameID: entry.nameID,
value:
entry.platformID === 3 && entry.encodingID === 1
? entry.nameString
: Buffer.from(entry.nameString, "utf-8")
});
}
return name;
}