bug 427084. Use GetGlyphIndiciesW rather than ScriptGetCMap for type1 fonts. r=vlad

This commit is contained in:
pavlov%pavlov.net 2008-04-08 07:32:38 +00:00
Родитель 5f5734cdea
Коммит 13637d3c11
1 изменённых файлов: 11 добавлений и 3 удалений

Просмотреть файл

@ -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;
}