зеркало из https://github.com/mozilla/gecko-dev.git
Don't call GDI 'A' functions for non-ASCII strings. Bug 378859, r+sr=roc
This commit is contained in:
Родитель
2c4edbd812
Коммит
24d8224dff
|
@ -592,15 +592,23 @@ gfxWindowsFontGroup::MakeTextRun(const PRUint8 *aString, PRUint32 aLength,
|
|||
const PRBool isComplex = textRun->IsRightToLeft();
|
||||
#endif
|
||||
|
||||
if (isComplex) {
|
||||
/* We can only call GDI "A" functions if this is a true 7bit ASCII string,
|
||||
because they interpret code points from 0x80-0xFF as if they were
|
||||
in the system code page. */
|
||||
if (!isComplex && (aParams->mFlags & TEXT_IS_ASCII)) {
|
||||
InitTextRunGDI(aParams->mContext, textRun,
|
||||
reinterpret_cast<const char*>(aString), aLength);
|
||||
}
|
||||
else {
|
||||
nsDependentCSubstring cString(reinterpret_cast<const char*>(aString),
|
||||
reinterpret_cast<const char*>(aString + aLength));
|
||||
nsAutoString utf16;
|
||||
AppendASCIItoUTF16(cString, utf16);
|
||||
InitTextRunUniscribe(aParams->mContext, textRun, utf16.get(), aLength);
|
||||
} else {
|
||||
InitTextRunGDI(aParams->mContext, textRun,
|
||||
reinterpret_cast<const char*>(aString), aLength);
|
||||
if (isComplex) {
|
||||
InitTextRunUniscribe(aParams->mContext, textRun, utf16.get(), aLength);
|
||||
} else {
|
||||
InitTextRunGDI(aParams->mContext, textRun, utf16.get(), aLength);
|
||||
}
|
||||
}
|
||||
|
||||
return textRun;
|
||||
|
|
Загрузка…
Ссылка в новой задаче