зеркало из https://github.com/mozilla/pjs.git
bug 427084. Use GetGlyphIndiciesW rather than ScriptGetCMap for type1 fonts. r=vlad
This commit is contained in:
Родитель
5f5734cdea
Коммит
13637d3c11
|
@ -1533,12 +1533,20 @@ public:
|
|||
PRUnichar str[1] = { (PRUnichar)ch };
|
||||
WORD glyph[1];
|
||||
|
||||
PRBool hasGlyph = PR_FALSE;
|
||||
if (aFontEntry->mIsType1) {
|
||||
// Type1 fonts and uniscribe APIs don't get along. ScriptGetCMap will return E_HANDLE
|
||||
DWORD ret = GetGlyphIndicesW(dc, str, 1, glyph, GGI_MARK_NONEXISTING_GLYPHS);
|
||||
if (ret != GDI_ERROR && glyph[0] != 0xFFFF)
|
||||
hasGlyph = PR_TRUE;
|
||||
} else {
|
||||
// ScriptGetCMap works better than GetGlyphIndicesW for things like bitmap/vector fonts
|
||||
HRESULT rv = ScriptGetCMap(dc, font->ScriptCache(), str, 1, 0, glyph);
|
||||
if (rv == S_OK)
|
||||
hasGlyph = PR_TRUE;
|
||||
}
|
||||
|
||||
ReleaseDC(NULL, dc);
|
||||
|
||||
if (rv == S_OK) {
|
||||
if (hasGlyph) {
|
||||
aFontEntry->mCharacterMap.set(ch);
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче