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
33eadd39
Commit
33eadd39
authored
Dec 08, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Don't assume that the font codepages change with the user locale.
Codepages can be set independently with LC_CTYPE.
parent
ec7f2f88
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
14 deletions
+13
-14
freetype.c
dlls/gdi32/freetype.c
+13
-14
No files found.
dlls/gdi32/freetype.c
View file @
33eadd39
...
...
@@ -1558,36 +1558,35 @@ static void add_font_list(HKEY hkey, const struct nls_update_font_list *fl)
static
void
update_font_info
(
void
)
{
char
buf
[
8
0
];
char
buf
[
40
],
cpbuf
[
4
0
];
DWORD
len
,
type
;
HKEY
hkey
=
0
;
UINT
i
,
ansi_cp
=
0
,
oem_cp
=
0
;
LCID
lcid
=
GetUserDefaultLCID
();
if
(
RegOpenKeyA
(
HKEY_CURRENT_USER
,
"Software
\\
Wine
\\
Fonts"
,
&
hkey
)
!=
ERROR_SUCCESS
)
return
;
GetLocaleInfoW
(
LOCALE_USER_DEFAULT
,
LOCALE_IDEFAULTANSICODEPAGE
|
LOCALE_RETURN_NUMBER
|
LOCALE_NOUSEROVERRIDE
,
(
WCHAR
*
)
&
ansi_cp
,
sizeof
(
ansi_cp
)
/
sizeof
(
WCHAR
));
GetLocaleInfoW
(
LOCALE_USER_DEFAULT
,
LOCALE_IDEFAULTCODEPAGE
|
LOCALE_RETURN_NUMBER
|
LOCALE_NOUSEROVERRIDE
,
(
WCHAR
*
)
&
oem_cp
,
sizeof
(
oem_cp
)
/
sizeof
(
WCHAR
));
sprintf
(
cpbuf
,
"%u,%u"
,
ansi_cp
,
oem_cp
);
len
=
sizeof
(
buf
);
if
(
RegQueryValueExA
(
hkey
,
"
Locale
"
,
0
,
&
type
,
(
BYTE
*
)
buf
,
&
len
)
==
ERROR_SUCCESS
&&
type
==
REG_SZ
)
if
(
RegQueryValueExA
(
hkey
,
"
Codepages
"
,
0
,
&
type
,
(
BYTE
*
)
buf
,
&
len
)
==
ERROR_SUCCESS
&&
type
==
REG_SZ
)
{
if
(
strtoul
(
buf
,
NULL
,
16
)
==
lcid
)
/* already set correctly */
if
(
!
strcmp
(
buf
,
cpbuf
)
)
/* already set correctly */
{
RegCloseKey
(
hkey
);
return
;
}
TRACE
(
"updating registry,
locale changed %s -> %08x
\n
"
,
debugstr_a
(
buf
),
lcid
);
TRACE
(
"updating registry,
codepages changed %s -> %u,%u
\n
"
,
buf
,
ansi_cp
,
oem_cp
);
}
else
TRACE
(
"updating registry,
locale changed none -> %08x
\n
"
,
lcid
);
else
TRACE
(
"updating registry,
codepages changed none -> %u,%u
\n
"
,
ansi_cp
,
oem_cp
);
sprintf
(
buf
,
"%08x"
,
lcid
);
RegSetValueExA
(
hkey
,
"Locale"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
buf
,
strlen
(
buf
)
+
1
);
RegSetValueExA
(
hkey
,
"Codepages"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
cpbuf
,
strlen
(
cpbuf
)
+
1
);
RegCloseKey
(
hkey
);
GetLocaleInfoW
(
lcid
,
LOCALE_IDEFAULTANSICODEPAGE
|
LOCALE_RETURN_NUMBER
|
LOCALE_NOUSEROVERRIDE
,
(
WCHAR
*
)
&
ansi_cp
,
sizeof
(
ansi_cp
)
/
sizeof
(
WCHAR
));
GetLocaleInfoW
(
lcid
,
LOCALE_IDEFAULTCODEPAGE
|
LOCALE_RETURN_NUMBER
|
LOCALE_NOUSEROVERRIDE
,
(
WCHAR
*
)
&
oem_cp
,
sizeof
(
oem_cp
)
/
sizeof
(
WCHAR
));
for
(
i
=
0
;
i
<
sizeof
(
nls_update_font_list
)
/
sizeof
(
nls_update_font_list
[
0
]);
i
++
)
{
if
(
nls_update_font_list
[
i
].
ansi_cp
==
ansi_cp
&&
...
...
@@ -1612,7 +1611,7 @@ static void update_font_info(void)
return
;
}
}
FIXME
(
"there is no font defaults for
lcid %04x/ansi_cp %u
\n
"
,
lcid
,
ansi
_cp
);
FIXME
(
"there is no font defaults for
codepages %u,%u
\n
"
,
ansi_cp
,
oem
_cp
);
}
/*************************************************************
...
...
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