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
e5966d74
Commit
e5966d74
authored
May 22, 2018
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 22, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Properly truncate face name to LOGFONT size.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
63bdcf97
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
4 deletions
+20
-4
opentype.c
dlls/dwrite/opentype.c
+13
-2
font.c
dlls/dwrite/tests/font.c
+7
-2
No files found.
dlls/dwrite/opentype.c
View file @
e5966d74
...
...
@@ -1736,8 +1736,19 @@ HRESULT opentype_get_font_facename(struct file_stream_desc *stream_desc, WCHAR *
if
(
!
exists
)
IDWriteLocalizedStrings_FindLocaleName
(
lfnames
,
enusW
,
&
index
,
&
exists
);
if
(
exists
)
IDWriteLocalizedStrings_GetString
(
lfnames
,
index
,
lfname
,
LF_FACESIZE
);
if
(
exists
)
{
UINT32
length
=
0
;
WCHAR
*
nameW
;
IDWriteLocalizedStrings_GetStringLength
(
lfnames
,
index
,
&
length
);
nameW
=
heap_alloc
((
length
+
1
)
*
sizeof
(
WCHAR
));
if
(
nameW
)
{
*
nameW
=
0
;
IDWriteLocalizedStrings_GetString
(
lfnames
,
index
,
nameW
,
length
+
1
);
lstrcpynW
(
lfname
,
nameW
,
LF_FACESIZE
);
heap_free
(
nameW
);
}
}
IDWriteLocalizedStrings_Release
(
lfnames
);
}
...
...
dlls/dwrite/tests/font.c
View file @
e5966d74
...
...
@@ -2515,6 +2515,7 @@ static void get_logfont_from_font(IDWriteFont *font, LOGFONTW *logfont)
if
(
exists
)
{
static
const
WCHAR
enusW
[]
=
{
'e'
,
'n'
,
'-'
,
'u'
,
's'
,
0
};
WCHAR
localeW
[
LOCALE_NAME_MAX_LENGTH
];
WCHAR
nameW
[
256
];
UINT32
index
;
/* Fallback to en-us if there's no string for user locale. */
...
...
@@ -2525,8 +2526,12 @@ static void get_logfont_from_font(IDWriteFont *font, LOGFONTW *logfont)
if
(
!
exists
)
IDWriteLocalizedStrings_FindLocaleName
(
names
,
enusW
,
&
index
,
&
exists
);
if
(
exists
)
IDWriteLocalizedStrings_GetString
(
names
,
index
,
logfont
->
lfFaceName
,
ARRAY_SIZE
(
logfont
->
lfFaceName
));
if
(
exists
)
{
nameW
[
0
]
=
0
;
hr
=
IDWriteLocalizedStrings_GetString
(
names
,
index
,
nameW
,
ARRAY_SIZE
(
nameW
));
ok
(
hr
==
S_OK
,
"Failed to get name string, hr %#x.
\n
"
,
hr
);
lstrcpynW
(
logfont
->
lfFaceName
,
nameW
,
ARRAY_SIZE
(
logfont
->
lfFaceName
));
}
}
IDWriteLocalizedStrings_Release
(
names
);
...
...
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