Add pre-opentype font pages detection code (#986)

As Khaled's finding on #981 this is the way Uniscribe detects those fonts. This is its detection part.
This commit is contained in:
Ebrahim Byagowi 2018-04-17 09:36:52 +04:30 committed by GitHub
parent 277e328986
commit 6771e79bcc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 0 deletions

View File

@ -125,6 +125,24 @@ struct os2
*max_cp = max;
}
enum font_page_t {
HEBREW_FONT_PAGE = 0xB100, // Hebrew Windows 3.1 font page
SIMP_ARABIC_FONT_PAGE = 0xB200, // Simplified Arabic Windows 3.1 font page
TRAD_ARABIC_FONT_PAGE = 0xB300, // Traditional Arabic Windows 3.1 font page
OEM_ARABIC_FONT_PAGE = 0xB400, // OEM Arabic Windows 3.1 font page
SIMP_FARSI_FONT_PAGE = 0xBA00, // Simplified Farsi Windows 3.1 font page
TRAD_FARSI_FONT_PAGE = 0xBB00, // Traditional Farsi Windows 3.1 font page
THAI_FONT_PAGE = 0xDE00 // Thai Windows 3.1 font page
};
// https://github.com/Microsoft/Font-Validator/blob/520aaae/OTFontFileVal/val_OS2.cs#L644-L681
inline font_page_t get_font_page () const
{
if (version != 0)
return (font_page_t) 0;
return (font_page_t) (fsSelection & 0xFF00);
}
public:
HBUINT16 version;