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
40d9a2b6
Commit
40d9a2b6
authored
Jan 26, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 26, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Make sure we don't have duplicates in locale/value pairs for font names.
parent
6b0623fb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
1 deletion
+33
-1
main.c
dlls/dwrite/main.c
+19
-1
opentype.c
dlls/dwrite/opentype.c
+14
-0
No files found.
dlls/dwrite/main.c
View file @
40d9a2b6
...
...
@@ -383,14 +383,32 @@ HRESULT create_localizedstrings(IDWriteLocalizedStrings **strings)
HRESULT
add_localizedstring
(
IDWriteLocalizedStrings
*
iface
,
const
WCHAR
*
locale
,
const
WCHAR
*
string
)
{
struct
localizedstrings
*
This
=
impl_from_IDWriteLocalizedStrings
(
iface
);
UINT32
i
;
/* make sure there's no duplicates */
for
(
i
=
0
;
i
<
This
->
count
;
i
++
)
if
(
!
strcmpW
(
This
->
data
[
i
].
locale
,
locale
))
return
S_OK
;
if
(
This
->
count
==
This
->
alloc
)
{
void
*
ptr
;
ptr
=
heap_realloc
(
This
->
data
,
2
*
This
->
alloc
*
sizeof
(
struct
localizedpair
));
if
(
!
ptr
)
return
E_OUTOFMEMORY
;
This
->
alloc
*=
2
;
This
->
data
=
heap_realloc
(
This
->
data
,
This
->
alloc
*
sizeof
(
struct
localizedpair
))
;
This
->
data
=
ptr
;
}
This
->
data
[
This
->
count
].
locale
=
heap_strdupW
(
locale
);
This
->
data
[
This
->
count
].
string
=
heap_strdupW
(
string
);
if
(
!
This
->
data
[
This
->
count
].
locale
||
!
This
->
data
[
This
->
count
].
string
)
{
heap_free
(
This
->
data
[
This
->
count
].
locale
);
heap_free
(
This
->
data
[
This
->
count
].
string
);
return
E_OUTOFMEMORY
;
}
This
->
count
++
;
return
S_OK
;
...
...
dlls/dwrite/opentype.c
View file @
40d9a2b6
...
...
@@ -1194,6 +1194,14 @@ HRESULT opentype_get_font_strings_from_id(const void *table_data, DWRITE_INFORMA
if
(
FAILED
(
hr
))
return
hr
;
header
=
table_data
;
switch
(
header
->
format
)
{
case
0
:
break
;
default:
FIXME
(
"unsupported NAME format %d
\n
"
,
header
->
format
);
}
storage_area
=
(
LPBYTE
)
table_data
+
GET_BE_WORD
(
header
->
stringOffset
);
count
=
GET_BE_WORD
(
header
->
count
);
...
...
@@ -1219,6 +1227,12 @@ HRESULT opentype_get_font_strings_from_id(const void *table_data, DWRITE_INFORMA
continue
;
}
/* Skip such entries for now, as it's not clear which locale is implied when
unicode platform is used. Also fonts tend to duplicate those strings as
WIN platform entries. */
if
(
platform
==
OPENTYPE_PLATFORM_UNICODE
)
continue
;
lang_id
=
GET_BE_WORD
(
record
->
languageID
);
length
=
GET_BE_WORD
(
record
->
length
);
offset
=
GET_BE_WORD
(
record
->
offset
);
...
...
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