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
b5115f77
Commit
b5115f77
authored
Mar 27, 2012
by
Huw Davies
Committed by
Alexandre Julliard
Mar 27, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Add a helper to retrieve the fontsignature.
parent
45d79fea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
48 deletions
+64
-48
freetype.c
dlls/gdi32/freetype.c
+64
-48
No files found.
dlls/gdi32/freetype.c
View file @
b5115f77
...
@@ -1605,6 +1605,69 @@ static inline int get_bitmap_internal_leading( FT_Face ft_face )
...
@@ -1605,6 +1605,69 @@ static inline int get_bitmap_internal_leading( FT_Face ft_face )
return
internal_leading
;
return
internal_leading
;
}
}
static
inline
void
get_fontsig
(
FT_Face
ft_face
,
FONTSIGNATURE
*
fs
)
{
TT_OS2
*
os2
;
FT_UInt
dummy
;
CHARSETINFO
csi
;
FT_WinFNT_HeaderRec
winfnt_header
;
int
i
;
memset
(
fs
,
0
,
sizeof
(
*
fs
)
);
os2
=
pFT_Get_Sfnt_Table
(
ft_face
,
ft_sfnt_os2
);
if
(
os2
)
{
fs
->
fsUsb
[
0
]
=
os2
->
ulUnicodeRange1
;
fs
->
fsUsb
[
1
]
=
os2
->
ulUnicodeRange2
;
fs
->
fsUsb
[
2
]
=
os2
->
ulUnicodeRange3
;
fs
->
fsUsb
[
3
]
=
os2
->
ulUnicodeRange4
;
if
(
os2
->
version
==
0
)
{
if
(
pFT_Get_First_Char
(
ft_face
,
&
dummy
)
<
0x100
)
fs
->
fsCsb
[
0
]
=
FS_LATIN1
;
else
fs
->
fsCsb
[
0
]
=
FS_SYMBOL
;
}
else
{
fs
->
fsCsb
[
0
]
=
os2
->
ulCodePageRange1
;
fs
->
fsCsb
[
1
]
=
os2
->
ulCodePageRange2
;
}
}
else
{
if
(
!
pFT_Get_WinFNT_Header
(
ft_face
,
&
winfnt_header
))
{
TRACE
(
"pix_h %d charset %d dpi %dx%d pt %d
\n
"
,
winfnt_header
.
pixel_height
,
winfnt_header
.
charset
,
winfnt_header
.
vertical_resolution
,
winfnt_header
.
horizontal_resolution
,
winfnt_header
.
nominal_point_size
);
if
(
TranslateCharsetInfo
(
(
DWORD
*
)(
UINT_PTR
)
winfnt_header
.
charset
,
&
csi
,
TCI_SRCCHARSET
))
*
fs
=
csi
.
fs
;
}
}
if
(
fs
->
fsCsb
[
0
]
==
0
)
{
/* let's see if we can find any interesting cmaps */
for
(
i
=
0
;
i
<
ft_face
->
num_charmaps
;
i
++
)
{
switch
(
ft_face
->
charmaps
[
i
]
->
encoding
)
{
case
FT_ENCODING_UNICODE
:
case
FT_ENCODING_APPLE_ROMAN
:
fs
->
fsCsb
[
0
]
|=
FS_LATIN1
;
break
;
case
FT_ENCODING_MS_SYMBOL
:
fs
->
fsCsb
[
0
]
|=
FS_SYMBOL
;
break
;
default:
break
;
}
}
}
}
#define ADDFONT_EXTERNAL_FONT 0x01
#define ADDFONT_EXTERNAL_FONT 0x01
#define ADDFONT_FORCE_BITMAP 0x02
#define ADDFONT_FORCE_BITMAP 0x02
#define ADDFONT_ADD_TO_CACHE 0x04
#define ADDFONT_ADD_TO_CACHE 0x04
...
@@ -1616,10 +1679,8 @@ static void AddFaceToList(FT_Face ft_face, const char *file, void *font_data_ptr
...
@@ -1616,10 +1679,8 @@ static void AddFaceToList(FT_Face ft_face, const char *file, void *font_data_ptr
WCHAR
*
StyleW
;
WCHAR
*
StyleW
;
do
{
do
{
TT_OS2
*
pOS2
;
Face
*
face
;
Face
*
face
;
struct
list
*
face_elem_ptr
;
struct
list
*
face_elem_ptr
;
FT_WinFNT_HeaderRec
winfnt_header
;
FONTSIGNATURE
fs
;
FONTSIGNATURE
fs
;
My_FT_Bitmap_Size
*
size
=
NULL
;
My_FT_Bitmap_Size
*
size
=
NULL
;
FT_Fixed
version
;
FT_Fixed
version
;
...
@@ -1631,32 +1692,7 @@ static void AddFaceToList(FT_Face ft_face, const char *file, void *font_data_ptr
...
@@ -1631,32 +1692,7 @@ static void AddFaceToList(FT_Face ft_face, const char *file, void *font_data_ptr
StyleW
=
towstr
(
CP_ACP
,
ft_face
->
style_name
);
StyleW
=
towstr
(
CP_ACP
,
ft_face
->
style_name
);
memset
(
&
fs
,
0
,
sizeof
(
fs
));
get_fontsig
(
ft_face
,
&
fs
);
pOS2
=
pFT_Get_Sfnt_Table
(
ft_face
,
ft_sfnt_os2
);
if
(
pOS2
)
{
fs
.
fsCsb
[
0
]
=
pOS2
->
ulCodePageRange1
;
fs
.
fsCsb
[
1
]
=
pOS2
->
ulCodePageRange2
;
fs
.
fsUsb
[
0
]
=
pOS2
->
ulUnicodeRange1
;
fs
.
fsUsb
[
1
]
=
pOS2
->
ulUnicodeRange2
;
fs
.
fsUsb
[
2
]
=
pOS2
->
ulUnicodeRange3
;
fs
.
fsUsb
[
3
]
=
pOS2
->
ulUnicodeRange4
;
if
(
pOS2
->
version
==
0
)
{
FT_UInt
dummy
;
if
(
pFT_Get_First_Char
(
ft_face
,
&
dummy
)
<
0x100
)
fs
.
fsCsb
[
0
]
|=
FS_LATIN1
;
else
fs
.
fsCsb
[
0
]
|=
FS_SYMBOL
;
}
}
else
if
(
!
pFT_Get_WinFNT_Header
(
ft_face
,
&
winfnt_header
))
{
CHARSETINFO
csi
;
TRACE
(
"pix_h %d charset %d dpi %dx%d pt %d
\n
"
,
winfnt_header
.
pixel_height
,
winfnt_header
.
charset
,
winfnt_header
.
vertical_resolution
,
winfnt_header
.
horizontal_resolution
,
winfnt_header
.
nominal_point_size
);
if
(
TranslateCharsetInfo
((
DWORD
*
)(
UINT_PTR
)
winfnt_header
.
charset
,
&
csi
,
TCI_SRCCHARSET
))
fs
=
csi
.
fs
;
}
version
=
get_font_version
(
ft_face
);
version
=
get_font_version
(
ft_face
);
LIST_FOR_EACH
(
face_elem_ptr
,
&
family
->
faces
)
{
LIST_FOR_EACH
(
face_elem_ptr
,
&
family
->
faces
)
{
...
@@ -1726,26 +1762,6 @@ static void AddFaceToList(FT_Face ft_face, const char *file, void *font_data_ptr
...
@@ -1726,26 +1762,6 @@ static void AddFaceToList(FT_Face ft_face, const char *file, void *font_data_ptr
face
->
fs
.
fsUsb
[
0
],
face
->
fs
.
fsUsb
[
1
],
face
->
fs
.
fsUsb
[
0
],
face
->
fs
.
fsUsb
[
1
],
face
->
fs
.
fsUsb
[
2
],
face
->
fs
.
fsUsb
[
3
]);
face
->
fs
.
fsUsb
[
2
],
face
->
fs
.
fsUsb
[
3
]);
if
(
face
->
fs
.
fsCsb
[
0
]
==
0
)
{
int
i
;
/* let's see if we can find any interesting cmaps */
for
(
i
=
0
;
i
<
ft_face
->
num_charmaps
;
i
++
)
{
switch
(
ft_face
->
charmaps
[
i
]
->
encoding
)
{
case
FT_ENCODING_UNICODE
:
case
FT_ENCODING_APPLE_ROMAN
:
face
->
fs
.
fsCsb
[
0
]
|=
FS_LATIN1
;
break
;
case
FT_ENCODING_MS_SYMBOL
:
face
->
fs
.
fsCsb
[
0
]
|=
FS_SYMBOL
;
break
;
default:
break
;
}
}
}
if
(
flags
&
ADDFONT_ADD_TO_CACHE
)
if
(
flags
&
ADDFONT_ADD_TO_CACHE
)
add_face_to_cache
(
face
);
add_face_to_cache
(
face
);
...
...
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