ExtTextOutW with symbol fonts works with chars in the ranges

0x0000 -- 0x00ff and 0xf000 -- 0xf0ff and not, for example, with
chars in the Unicode Greek range.
This commit is contained in:
Huw D M Davies 2001-10-23 19:54:27 +00:00 committed by Alexandre Julliard
parent f3d962226f
commit 8bf8021f94
4 changed files with 38 additions and 4 deletions

View file

@ -364,6 +364,30 @@ static XChar2b* X11DRV_unicode_to_char2b_cp950( fontObject* pfo,
return str2b;
}
static XChar2b* X11DRV_unicode_to_char2b_symbol( fontObject* pfo,
LPCWSTR lpwstr, UINT count )
{
XChar2b *str2b;
UINT i;
char ch = pfo->fs->default_char;
if (!(str2b = HeapAlloc( GetProcessHeap(), 0, count * sizeof(XChar2b) )))
return NULL;
for (i = 0; i < count; i++)
{
str2b[i].byte1 = 0;
if(lpwstr[i] >= 0xf000 && lpwstr[i] < 0xf100)
str2b[i].byte2 = lpwstr[i] - 0xf000;
else if(lpwstr[i] < 0x100)
str2b[i].byte2 = lpwstr[i];
else
str2b[i].byte2 = ch;
}
return str2b;
}
static void X11DRV_DrawString_normal( fontObject* pfo, Display* pdisp,
Drawable d, GC gc, int x, int y,
@ -700,4 +724,13 @@ const X11DRV_CP X11DRV_cptable[X11DRV_CPTABLE_COUNT] =
X11DRV_TextExtents_dbcs_2fonts,
X11DRV_GetTextMetricsA_cp932,
},
{ /* SYMBOL */
X11DRV_enum_subfont_charset_normal,
X11DRV_unicode_to_char2b_symbol,
X11DRV_DrawString_normal,
X11DRV_TextWidth_normal,
X11DRV_DrawText_normal,
X11DRV_TextExtents_normal,
X11DRV_GetTextMetricsA_normal,
}
};

View file

@ -141,8 +141,8 @@ static const SuffixCharset sufch_microsoft[] = {
{ "cp1255", HEBREW_CHARSET, 1255, X11DRV_CPTABLE_SBCS },
{ "cp1256", ARABIC_CHARSET, 1256, X11DRV_CPTABLE_SBCS },
{ "cp1257", BALTIC_CHARSET, 1257, X11DRV_CPTABLE_SBCS },
{ "fontspecific", SYMBOL_CHARSET, CP_SYMBOL, X11DRV_CPTABLE_SBCS },
{ "symbol", SYMBOL_CHARSET, CP_SYMBOL, X11DRV_CPTABLE_SBCS },
{ "fontspecific", SYMBOL_CHARSET, CP_SYMBOL, X11DRV_CPTABLE_SYMBOL },
{ "symbol", SYMBOL_CHARSET, CP_SYMBOL, X11DRV_CPTABLE_SYMBOL },
{ NULL, ANSI_CHARSET, 1252, X11DRV_CPTABLE_SBCS }};
static const SuffixCharset sufch_tcvn[] = {

View file

@ -80,6 +80,7 @@ enum X11DRV_CPTABLE
X11DRV_CPTABLE_CP936,
X11DRV_CPTABLE_CP949,
X11DRV_CPTABLE_CP950,
X11DRV_CPTABLE_SYMBOL,
X11DRV_CPTABLE_COUNT
};

View file

@ -43,8 +43,8 @@ LPWSTR FONT_mbtowc(HDC hdc, LPCSTR str, INT count, INT *plenW, UINT *pCP)
cp = csi.ciACP;
else {
switch(charset) {
case SYMBOL_CHARSET:
cp = CP_SYMBOL;
case SYMBOL_CHARSET: /* We don't want any translation here */
cp = GetACP();
break;
case OEM_CHARSET:
cp = GetOEMCP();