Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
04e8b00a
Commit
04e8b00a
authored
Mar 07, 2014
by
Akihiro Sagawa
Committed by
Alexandre Julliard
Mar 12, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Improve the font enumeration order for complex script locales.
parent
a07966db
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
6 deletions
+19
-6
freetype.c
dlls/gdi32/freetype.c
+10
-1
font.c
dlls/gdi32/tests/font.c
+9
-5
No files found.
dlls/gdi32/freetype.c
View file @
04e8b00a
...
...
@@ -5527,12 +5527,20 @@ static INT load_script_name( UINT id, WCHAR buffer[LF_FACESIZE] )
return
i
;
}
static
inline
BOOL
is_complex_script_ansi_cp
(
UINT
ansi_cp
)
{
return
(
ansi_cp
==
874
/* Thai */
||
ansi_cp
==
1255
/* Hebrew */
||
ansi_cp
==
1256
/* Arabic */
);
}
/***************************************************
* create_enum_charset_list
*
* This function creates charset enumeration list because in DEFAULT_CHARSET
* case, the ANSI codepage's charset takes precedence over other charsets.
* Above rule doesn't apply if the ANSI codepage uses complex script (e.g. Thai).
* This function works as a filter other than DEFAULT_CHARSET case.
*/
static
DWORD
create_enum_charset_list
(
DWORD
charset
,
struct
enum_charset_list
*
list
)
...
...
@@ -5553,7 +5561,8 @@ static DWORD create_enum_charset_list(DWORD charset, struct enum_charset_list *l
/* Set the current codepage's charset as the first element. */
acp
=
GetACP
();
if
(
TranslateCharsetInfo
((
DWORD
*
)(
INT_PTR
)
acp
,
&
csi
,
TCI_SRCCODEPAGE
)
&&
if
(
!
is_complex_script_ansi_cp
(
acp
)
&&
TranslateCharsetInfo
((
DWORD
*
)(
INT_PTR
)
acp
,
&
csi
,
TCI_SRCCODEPAGE
)
&&
csi
.
fs
.
fsCsb
[
0
]
!=
0
)
{
list
->
element
[
n
].
mask
=
csi
.
fs
.
fsCsb
[
0
];
list
->
element
[
n
].
charset
=
csi
.
ciCharset
;
...
...
dlls/gdi32/tests/font.c
View file @
04e8b00a
...
...
@@ -2957,7 +2957,7 @@ static INT CALLBACK enum_multi_charset_font_proc(const LOGFONTA *lf, const TEXTM
if
(
TranslateCharsetInfo
(
ULongToPtr
(
target
->
lfCharSet
),
&
csi
,
TCI_SRCCHARSET
))
{
fs
=
ntm
->
ntmFontSig
.
fsCsb
[
0
]
&
valid_bits
;
if
((
fs
&
csi
.
fs
.
fsCsb
[
0
])
&&
(
fs
&
~
csi
.
fs
.
fsCsb
[
0
]))
{
if
((
fs
&
csi
.
fs
.
fsCsb
[
0
])
&&
(
fs
&
~
csi
.
fs
.
fsCsb
[
0
])
&&
(
fs
&
FS_LATIN1
)
)
{
*
target
=
*
lf
;
return
FALSE
;
}
...
...
@@ -2998,13 +2998,13 @@ static void test_EnumFontFamiliesEx_default_charset(void)
{
struct
enum_font_data
efd
;
LOGFONTA
target
,
enum_font
;
DWORD
ret
;
UINT
acp
;
HDC
hdc
;
CHARSETINFO
csi
;
ret
=
GetACP
();
if
(
!
TranslateCharsetInfo
(
ULongToPtr
(
ret
),
&
csi
,
TCI_SRCCODEPAGE
))
{
skip
(
"TranslateCharsetInfo failed for code page %
d.
\n
"
,
ret
);
acp
=
GetACP
();
if
(
!
TranslateCharsetInfo
(
ULongToPtr
(
acp
),
&
csi
,
TCI_SRCCODEPAGE
))
{
skip
(
"TranslateCharsetInfo failed for code page %
u.
\n
"
,
acp
);
return
;
}
...
...
@@ -3018,6 +3018,10 @@ static void test_EnumFontFamiliesEx_default_charset(void)
skip
(
"suitable font isn't found for charset %d.
\n
"
,
enum_font
.
lfCharSet
);
return
;
}
if
(
acp
==
874
||
acp
==
1255
||
acp
==
1256
)
{
/* these codepage use complex script, expecting ANSI_CHARSET here. */
target
.
lfCharSet
=
ANSI_CHARSET
;
}
efd
.
total
=
0
;
memset
(
&
enum_font
,
0
,
sizeof
(
enum_font
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment