diff options
author | Christopher Zimmermann <madroach@gmerlin.de> | 2020-06-16 18:43:12 +0200 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2020-09-22 22:00:38 +0000 |
commit | f8fa7919397659fb0ac5dade75152343d57f20ce (patch) | |
tree | a29a7c12c01d158fbc374b2c02af44665992a955 | |
parent | 1df352c9e862686692ac053b838d76a36d721805 (diff) |
correctly set OS2 fsSelection for italic and bold fonts
-rw-r--r-- | write.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -1013,7 +1013,14 @@ writeOS2(FILE* out, FontPtr font) writeULONG(out, 0x03FF); /* ulUnicodeRange3; */ writeULONG(out, 0U); /* ulUnicodeRange4; */ writeULONG(out, font->foundry); /* achVendID[4]; */ - writeUSHORT(out, 0x0040); /* fsSelection; */ + i = 0; + if (font->flags & FACE_ITALIC) + i |= 1 << 0; + if (font->flags & FACE_BOLD) + i |= 1 << 5; + if (!i) + i |= 1 << 6; + writeUSHORT(out, i); /* fsSelection; */ writeUSHORT(out, 0x20); /* usFirstCharIndex; */ writeUSHORT(out, 0xFFFD); /* usLastCharIndex; */ writeUSHORT(out, FONT_UNITS_CEIL(max_y)); /* sTypoAscender; */ |