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
03741026
Commit
03741026
authored
May 10, 2011
by
Grazvydas Ignotas
Committed by
Alexandre Julliard
May 12, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Refactor get_facename to retrieve other names too.
parent
86495cea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
freetype.c
dlls/gdi32/freetype.c
+11
-11
No files found.
dlls/gdi32/freetype.c
View file @
03741026
...
@@ -1095,32 +1095,32 @@ static BOOL get_name_table_entry(FT_Face ft_face, FT_SfntName *req)
...
@@ -1095,32 +1095,32 @@ static BOOL get_name_table_entry(FT_Face ft_face, FT_SfntName *req)
return
FALSE
;
return
FALSE
;
}
}
static
WCHAR
*
get_fa
milyname
(
FT_Face
ft_face
)
static
WCHAR
*
get_fa
ce_name
(
FT_Face
ft_face
,
FT_UShort
name_id
,
FT_UShort
language_id
)
{
{
WCHAR
*
family
=
NULL
;
WCHAR
*
ret
=
NULL
;
FT_SfntName
name
;
FT_SfntName
name
;
name
.
platform_id
=
TT_PLATFORM_MICROSOFT
;
name
.
platform_id
=
TT_PLATFORM_MICROSOFT
;
name
.
encoding_id
=
TT_MS_ID_UNICODE_CS
;
name
.
encoding_id
=
TT_MS_ID_UNICODE_CS
;
name
.
language_id
=
GetUserDefaultLCID
()
;
name
.
language_id
=
language_id
;
name
.
name_id
=
TT_NAME_ID_FONT_FAMILY
;
name
.
name_id
=
name_id
;
if
(
get_name_table_entry
(
ft_face
,
&
name
))
if
(
get_name_table_entry
(
ft_face
,
&
name
))
{
{
FT_UInt
i
;
FT_UInt
i
;
/* String is not nul terminated and string_len is a byte length. */
/* String is not nul terminated and string_len is a byte length. */
family
=
HeapAlloc
(
GetProcessHeap
(),
0
,
name
.
string_len
+
2
);
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
name
.
string_len
+
2
);
for
(
i
=
0
;
i
<
name
.
string_len
/
2
;
i
++
)
for
(
i
=
0
;
i
<
name
.
string_len
/
2
;
i
++
)
{
{
WORD
*
tmp
=
(
WORD
*
)
&
name
.
string
[
i
*
2
];
WORD
*
tmp
=
(
WORD
*
)
&
name
.
string
[
i
*
2
];
family
[
i
]
=
GET_BE_WORD
(
*
tmp
);
ret
[
i
]
=
GET_BE_WORD
(
*
tmp
);
}
}
family
[
i
]
=
0
;
ret
[
i
]
=
0
;
TRACE
(
"Got localised name %s
\n
"
,
debugstr_w
(
family
));
TRACE
(
"Got localised name %s
\n
"
,
debugstr_w
(
ret
));
}
}
return
family
;
return
ret
;
}
}
...
@@ -1331,7 +1331,7 @@ static INT AddFontToList(const char *file, void *font_data_ptr, DWORD font_data_
...
@@ -1331,7 +1331,7 @@ static INT AddFontToList(const char *file, void *font_data_ptr, DWORD font_data_
if
(
target_family
)
if
(
target_family
)
{
{
localised_family
=
get_fa
milyname
(
ft_face
);
localised_family
=
get_fa
ce_name
(
ft_face
,
TT_NAME_ID_FONT_FAMILY
,
GetUserDefaultLCID
()
);
if
(
localised_family
&&
strcmpiW
(
localised_family
,
target_family
)
!=
0
)
if
(
localised_family
&&
strcmpiW
(
localised_family
,
target_family
)
!=
0
)
{
{
TRACE
(
"Skipping Index %i: Incorrect Family name for replacement
\n
"
,(
INT
)
face_index
);
TRACE
(
"Skipping Index %i: Incorrect Family name for replacement
\n
"
,(
INT
)
face_index
);
...
@@ -1360,7 +1360,7 @@ static INT AddFontToList(const char *file, void *font_data_ptr, DWORD font_data_
...
@@ -1360,7 +1360,7 @@ static INT AddFontToList(const char *file, void *font_data_ptr, DWORD font_data_
localised_family
=
NULL
;
localised_family
=
NULL
;
if
(
!
fake_family
)
{
if
(
!
fake_family
)
{
localised_family
=
get_fa
milyname
(
ft_face
);
localised_family
=
get_fa
ce_name
(
ft_face
,
TT_NAME_ID_FONT_FAMILY
,
GetUserDefaultLCID
()
);
if
(
localised_family
&&
!
strcmpiW
(
localised_family
,
english_family
))
{
if
(
localised_family
&&
!
strcmpiW
(
localised_family
,
english_family
))
{
HeapFree
(
GetProcessHeap
(),
0
,
localised_family
);
HeapFree
(
GetProcessHeap
(),
0
,
localised_family
);
localised_family
=
NULL
;
localised_family
=
NULL
;
...
...
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