Skip to content

Commit

Permalink
Support version 0 of OS/2 tables
Browse files Browse the repository at this point in the history
  • Loading branch information
Sonia Seddiki committed Feb 4, 2022
1 parent 992f098 commit bc0a0a1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ function ttf2eot(arr) {

if (tableEntry.tag === 'OS/2') {
haveOS2 = true;
var OS2Version = table.readUint16BE();

for (j = 0; j < 10; ++j) {
out.writeUint8 (table.readUint8 (SFNT_OFFSET.OS2_FONT_PANOSE + j), EOT_OFFSET.FONT_PANOSE + j);
Expand All @@ -153,11 +154,14 @@ function ttf2eot(arr) {
EOT_OFFSET.UNICODE_RANGE + j * 4);
}

for (j = 0; j < 2; ++j) {
out.writeUint32LE (table.readUint32BE (SFNT_OFFSET.OS2_CODEPAGE_RANGE + j * 4),
EOT_OFFSET.CODEPAGE_RANGE + j * 4);
if (OS2Version >= 1) {
for (j = 0; j < 2; ++j) {
out.writeUint32LE (table.readUint32BE (SFNT_OFFSET.OS2_CODEPAGE_RANGE + j * 4),
EOT_OFFSET.CODEPAGE_RANGE + j * 4);
}
}


} else if (tableEntry.tag === 'head') {

haveHead = true;
Expand Down

0 comments on commit bc0a0a1

Please sign in to comment.