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
6ee7182e
Commit
6ee7182e
authored
Oct 12, 2007
by
Huw Davies
Committed by
Alexandre Julliard
Oct 15, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Factor out the code to call FT_Load_Sfnt_Table.
parent
b4678b7b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
39 deletions
+56
-39
freetype.c
dlls/gdi32/freetype.c
+56
-39
No files found.
dlls/gdi32/freetype.c
View file @
6ee7182e
...
...
@@ -944,6 +944,58 @@ static WCHAR *get_familyname(FT_Face ft_face)
}
/*****************************************************************
* load_sfnt_table
*
* Wrapper around FT_Load_Sfnt_Table to cope with older versions
* of FreeType that don't export this function.
*
*/
static
FT_Error
load_sfnt_table
(
FT_Face
ft_face
,
FT_ULong
table
,
FT_Long
offset
,
FT_Byte
*
buf
,
FT_ULong
*
len
)
{
FT_Error
err
;
/* If the FT_Load_Sfnt_Table function is there we'll use it */
if
(
pFT_Load_Sfnt_Table
)
{
err
=
pFT_Load_Sfnt_Table
(
ft_face
,
table
,
offset
,
buf
,
len
);
}
#ifdef HAVE_FREETYPE_INTERNAL_SFNT_H
else
/* Do it the hard way */
{
TT_Face
tt_face
=
(
TT_Face
)
ft_face
;
SFNT_Interface
*
sfnt
;
if
(
FT_Version
.
major
==
2
&&
FT_Version
.
minor
==
0
)
{
/* 2.0.x */
sfnt
=
*
(
SFNT_Interface
**
)((
char
*
)
tt_face
+
528
);
}
else
{
/* A field was added in the middle of the structure in 2.1.x */
sfnt
=
*
(
SFNT_Interface
**
)((
char
*
)
tt_face
+
532
);
}
err
=
sfnt
->
load_any
(
tt_face
,
table
,
offset
,
buf
,
len
);
}
#else
else
{
static
int
msg
;
if
(
!
msg
)
{
MESSAGE
(
"This version of Wine was compiled with freetype headers later than 2.2.0
\n
"
"but is being run with a freetype library without the FT_Load_Sfnt_Table function.
\n
"
"Please upgrade your freetype library.
\n
"
);
msg
++
;
}
err
=
FT_Err_Unimplemented_Feature
;
}
#endif
return
err
;
}
#define ADDFONT_EXTERNAL_FONT 0x01
#define ADDFONT_FORCE_BITMAP 0x02
static
INT
AddFontToList
(
const
char
*
file
,
void
*
font_data_ptr
,
DWORD
font_data_size
,
char
*
fake_family
,
const
WCHAR
*
target_family
,
DWORD
flags
)
...
...
@@ -4564,50 +4616,15 @@ DWORD WineEngGetFontData(GdiFont *font, DWORD table, DWORD offset, LPVOID buf,
(
table
>>
8
&
0xff00
)
|
(
table
<<
8
&
0xff0000
);
}
/* If the FT_Load_Sfnt_Table function is there we'll use it */
if
(
pFT_Load_Sfnt_Table
)
{
/* make sure value of len is the value freetype says it needs */
if
(
buf
&&
len
)
{
FT_ULong
needed
=
0
;
err
=
pFT_Load_Sfnt_Table
(
ft_face
,
table
,
offset
,
NULL
,
&
needed
);
if
(
!
err
&&
needed
<
len
)
len
=
needed
;
}
err
=
pFT_Load_Sfnt_Table
(
ft_face
,
table
,
offset
,
buf
,
&
len
);
}
#ifdef HAVE_FREETYPE_INTERNAL_SFNT_H
else
{
/* Do it the hard way */
TT_Face
tt_face
=
(
TT_Face
)
ft_face
;
SFNT_Interface
*
sfnt
;
if
(
FT_Version
.
major
==
2
&&
FT_Version
.
minor
==
0
)
{
/* 2.0.x */
sfnt
=
*
(
SFNT_Interface
**
)((
char
*
)
tt_face
+
528
);
}
else
if
(
buf
&&
len
)
{
/* A field was added in the middle of the structure in 2.1.x */
sfnt
=
*
(
SFNT_Interface
**
)((
char
*
)
tt_face
+
532
);
}
/* make sure value of len is the value freetype says it needs */
if
(
buf
&&
len
)
{
FT_ULong
needed
=
0
;
err
=
sfnt
->
load_any
(
t
t_face
,
table
,
offset
,
NULL
,
&
needed
);
err
=
load_sfnt_table
(
f
t_face
,
table
,
offset
,
NULL
,
&
needed
);
if
(
!
err
&&
needed
<
len
)
len
=
needed
;
}
err
=
sfnt
->
load_any
(
tt_face
,
table
,
offset
,
buf
,
&
len
);
}
#else
else
{
static
int
msg
;
if
(
!
msg
)
{
MESSAGE
(
"This version of Wine was compiled with freetype headers later than 2.2.0
\n
"
"but is being run with a freetype library without the FT_Load_Sfnt_Table function.
\n
"
"Please upgrade your freetype library.
\n
"
);
msg
++
;
}
err
=
FT_Err_Unimplemented_Feature
;
}
#endif
err
=
load_sfnt_table
(
ft_face
,
table
,
offset
,
buf
,
&
len
);
if
(
err
)
{
TRACE
(
"Can't find table %c%c%c%c
\n
"
,
/* bytes were reversed */
...
...
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