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
2f8f3fac
Commit
2f8f3fac
authored
Sep 18, 2008
by
Huw Davies
Committed by
Alexandre Julliard
Sep 18, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Factor out the name table lookup into a separate function.
parent
995835e1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
19 deletions
+48
-19
freetype.c
dlls/gdi32/freetype.c
+48
-19
No files found.
dlls/gdi32/freetype.c
View file @
2f8f3fac
...
...
@@ -1026,11 +1026,19 @@ static void LoadSubstList(void)
}
}
static
WCHAR
*
get_familyname
(
FT_Face
ft_face
)
/*****************************************************************
* get_name_table_entry
*
* Supply the platform, encoding, language and name ids in req
* and if the name exists the function will fill in the string
* and string_len members. The string is owned by FreeType so
* don't free it. Returns TRUE if the name is found else FALSE.
*/
static
BOOL
get_name_table_entry
(
FT_Face
ft_face
,
FT_SfntName
*
req
)
{
WCHAR
*
family
=
NULL
;
FT_SfntName
name
;
FT_UInt
num_names
,
name_index
,
i
;
FT_UInt
num_names
,
name_index
;
if
(
FT_IS_SFNT
(
ft_face
))
{
...
...
@@ -1040,28 +1048,49 @@ static WCHAR *get_familyname(FT_Face ft_face)
{
if
(
!
pFT_Get_Sfnt_Name
(
ft_face
,
name_index
,
&
name
))
{
if
((
name
.
name_id
==
TT_NAME_ID_FONT_FAMILY
)
&&
(
name
.
language_id
==
GetUserDefaultLCID
()
)
&&
(
name
.
platform_id
==
TT_PLATFORM_MICROSOFT
)
&&
(
name
.
encoding_id
==
TT_MS_ID_UNICODE_CS
))
if
((
name
.
platform_id
==
req
->
platform_id
)
&&
(
name
.
encoding_id
==
req
->
encoding_id
)
&&
(
name
.
language_id
==
req
->
language_id
)
&&
(
name
.
name_id
==
req
->
name_id
))
{
/* String is not nul terminated and string_len is a byte length. */
family
=
HeapAlloc
(
GetProcessHeap
(),
0
,
name
.
string_len
+
2
);
for
(
i
=
0
;
i
<
name
.
string_len
/
2
;
i
++
)
{
WORD
*
tmp
=
(
WORD
*
)
&
name
.
string
[
i
*
2
];
family
[
i
]
=
GET_BE_WORD
(
*
tmp
);
}
family
[
i
]
=
0
;
TRACE
(
"Got localised name %s
\n
"
,
debugstr_w
(
family
));
return
family
;
req
->
string
=
name
.
string
;
req
->
string_len
=
name
.
string_len
;
return
TRUE
;
}
}
}
}
req
->
string
=
NULL
;
req
->
string_len
=
0
;
return
FALSE
;
}
return
NULL
;
static
WCHAR
*
get_familyname
(
FT_Face
ft_face
)
{
WCHAR
*
family
=
NULL
;
FT_SfntName
name
;
name
.
platform_id
=
TT_PLATFORM_MICROSOFT
;
name
.
encoding_id
=
TT_MS_ID_UNICODE_CS
;
name
.
language_id
=
GetUserDefaultLCID
();
name
.
name_id
=
TT_NAME_ID_FONT_FAMILY
;
if
(
get_name_table_entry
(
ft_face
,
&
name
))
{
int
i
;
/* String is not nul terminated and string_len is a byte length. */
family
=
HeapAlloc
(
GetProcessHeap
(),
0
,
name
.
string_len
+
2
);
for
(
i
=
0
;
i
<
name
.
string_len
/
2
;
i
++
)
{
WORD
*
tmp
=
(
WORD
*
)
&
name
.
string
[
i
*
2
];
family
[
i
]
=
GET_BE_WORD
(
*
tmp
);
}
family
[
i
]
=
0
;
TRACE
(
"Got localised name %s
\n
"
,
debugstr_w
(
family
));
}
return
family
;
}
...
...
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