Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
fd9e1612
Commit
fd9e1612
authored
Nov 05, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Use FT_MulDiv() instead of the kernel32 function.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8768f605
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
freetype.c
dlls/gdi32/freetype.c
+9
-10
No files found.
dlls/gdi32/freetype.c
View file @
fd9e1612
...
@@ -146,6 +146,7 @@ MAKE_FUNCPTR(FT_Library_Version);
...
@@ -146,6 +146,7 @@ MAKE_FUNCPTR(FT_Library_Version);
MAKE_FUNCPTR
(
FT_Load_Glyph
);
MAKE_FUNCPTR
(
FT_Load_Glyph
);
MAKE_FUNCPTR
(
FT_Load_Sfnt_Table
);
MAKE_FUNCPTR
(
FT_Load_Sfnt_Table
);
MAKE_FUNCPTR
(
FT_Matrix_Multiply
);
MAKE_FUNCPTR
(
FT_Matrix_Multiply
);
MAKE_FUNCPTR
(
FT_MulDiv
);
#ifdef FT_MULFIX_INLINED
#ifdef FT_MULFIX_INLINED
#define pFT_MulFix FT_MULFIX_INLINED
#define pFT_MulFix FT_MULFIX_INLINED
#else
#else
...
@@ -1509,6 +1510,7 @@ static BOOL init_freetype(void)
...
@@ -1509,6 +1510,7 @@ static BOOL init_freetype(void)
LOAD_FUNCPTR
(
FT_Load_Glyph
)
LOAD_FUNCPTR
(
FT_Load_Glyph
)
LOAD_FUNCPTR
(
FT_Load_Sfnt_Table
)
LOAD_FUNCPTR
(
FT_Load_Sfnt_Table
)
LOAD_FUNCPTR
(
FT_Matrix_Multiply
)
LOAD_FUNCPTR
(
FT_Matrix_Multiply
)
LOAD_FUNCPTR
(
FT_MulDiv
)
#ifndef FT_MULFIX_INLINED
#ifndef FT_MULFIX_INLINED
LOAD_FUNCPTR
(
FT_MulFix
)
LOAD_FUNCPTR
(
FT_MulFix
)
#endif
#endif
...
@@ -1635,11 +1637,9 @@ static LONG calc_ppem_for_height(FT_Face ft_face, LONG height)
...
@@ -1635,11 +1637,9 @@ static LONG calc_ppem_for_height(FT_Face ft_face, LONG height)
if
(
height
>
0
)
{
if
(
height
>
0
)
{
USHORT
windescent
=
get_fixed_windescent
(
pOS2
->
usWinDescent
);
USHORT
windescent
=
get_fixed_windescent
(
pOS2
->
usWinDescent
);
if
(
pOS2
->
usWinAscent
+
windescent
==
0
)
if
(
pOS2
->
usWinAscent
+
windescent
==
0
)
ppem
=
MulDiv
(
ft_face
->
units_per_EM
,
height
,
ppem
=
pFT_MulDiv
(
ft_face
->
units_per_EM
,
height
,
pHori
->
Ascender
-
pHori
->
Descender
);
pHori
->
Ascender
-
pHori
->
Descender
);
else
else
ppem
=
MulDiv
(
ft_face
->
units_per_EM
,
height
,
ppem
=
pFT_MulDiv
(
ft_face
->
units_per_EM
,
height
,
pOS2
->
usWinAscent
+
windescent
);
pOS2
->
usWinAscent
+
windescent
);
if
(
ppem
>
MAX_PPEM
)
{
if
(
ppem
>
MAX_PPEM
)
{
WARN
(
"Ignoring too large height %d, ppem %d
\n
"
,
height
,
ppem
);
WARN
(
"Ignoring too large height %d, ppem %d
\n
"
,
height
,
ppem
);
ppem
=
1
;
ppem
=
1
;
...
@@ -2340,7 +2340,7 @@ static BOOL get_transform_matrices( struct gdi_font *font, BOOL vertical, const
...
@@ -2340,7 +2340,7 @@ static BOOL get_transform_matrices( struct gdi_font *font, BOOL vertical, const
FT_Matrix
rotation_mat
;
FT_Matrix
rotation_mat
;
FT_Vector
angle
;
FT_Vector
angle
;
pFT_Vector_Unit
(
&
angle
,
MulDiv
(
1
<<
16
,
font
->
lf
.
lfOrientation
,
10
)
);
pFT_Vector_Unit
(
&
angle
,
pFT_
MulDiv
(
1
<<
16
,
font
->
lf
.
lfOrientation
,
10
)
);
rotation_mat
.
xx
=
angle
.
x
;
rotation_mat
.
xx
=
angle
.
x
;
rotation_mat
.
xy
=
-
angle
.
y
;
rotation_mat
.
xy
=
-
angle
.
y
;
rotation_mat
.
yx
=
angle
.
y
;
rotation_mat
.
yx
=
angle
.
y
;
...
@@ -2401,7 +2401,7 @@ static BOOL get_bold_glyph_outline(FT_GlyphSlot glyph, LONG ppem, FT_Glyph_Metri
...
@@ -2401,7 +2401,7 @@ static BOOL get_bold_glyph_outline(FT_GlyphSlot glyph, LONG ppem, FT_Glyph_Metri
if
(
!
pFT_Outline_Embolden
)
if
(
!
pFT_Outline_Embolden
)
return
FALSE
;
return
FALSE
;
strength
=
MulDiv
(
ppem
,
1
<<
6
,
24
);
strength
=
pFT_
MulDiv
(
ppem
,
1
<<
6
,
24
);
err
=
pFT_Outline_Embolden
(
&
glyph
->
outline
,
strength
);
err
=
pFT_Outline_Embolden
(
&
glyph
->
outline
,
strength
);
if
(
err
)
{
if
(
err
)
{
TRACE
(
"FT_Ouline_Embolden returns %d
\n
"
,
err
);
TRACE
(
"FT_Ouline_Embolden returns %d
\n
"
,
err
);
...
@@ -2452,8 +2452,7 @@ static FT_Vector get_advance_metric(struct gdi_font *incoming_font, struct gdi_f
...
@@ -2452,8 +2452,7 @@ static FT_Vector get_advance_metric(struct gdi_font *incoming_font, struct gdi_f
if
(
freetype_set_outline_text_metrics
(
incoming_font
)
&&
if
(
freetype_set_outline_text_metrics
(
incoming_font
)
&&
!
(
incoming_font
->
otm
.
otmTextMetrics
.
tmPitchAndFamily
&
TMPF_FIXED_PITCH
))
{
!
(
incoming_font
->
otm
.
otmTextMetrics
.
tmPitchAndFamily
&
TMPF_FIXED_PITCH
))
{
UINT
avg_advance
;
UINT
avg_advance
;
em_scale
=
MulDiv
(
incoming_font
->
ppem
,
1
<<
16
,
em_scale
=
pFT_MulDiv
(
incoming_font
->
ppem
,
1
<<
16
,
get_ft_face
(
incoming_font
)
->
units_per_EM
);
get_ft_face
(
incoming_font
)
->
units_per_EM
);
avg_advance
=
pFT_MulFix
(
incoming_font
->
ntmAvgWidth
,
em_scale
);
avg_advance
=
pFT_MulFix
(
incoming_font
->
ntmAvgWidth
,
em_scale
);
fixed_pitch_full
=
(
avg_advance
>
0
&&
fixed_pitch_full
=
(
avg_advance
>
0
&&
(
base_advance
+
63
)
>>
6
==
(
base_advance
+
63
)
>>
6
==
...
@@ -3395,7 +3394,7 @@ static BOOL CDECL freetype_set_outline_text_metrics( struct gdi_font *font )
...
@@ -3395,7 +3394,7 @@ static BOOL CDECL freetype_set_outline_text_metrics( struct gdi_font *font )
strlenW
(
(
WCHAR
*
)
font
->
otm
.
otmpFaceName
)
+
1
+
strlenW
(
(
WCHAR
*
)
font
->
otm
.
otmpFaceName
)
+
1
+
strlenW
(
(
WCHAR
*
)
font
->
otm
.
otmpFullName
)
+
1
)
*
sizeof
(
WCHAR
);
strlenW
(
(
WCHAR
*
)
font
->
otm
.
otmpFullName
)
+
1
)
*
sizeof
(
WCHAR
);
em_scale
=
(
FT_Fixed
)
MulDiv
(
font
->
ppem
,
1
<<
16
,
ft_face
->
units_per_EM
);
em_scale
=
(
FT_Fixed
)
pFT_
MulDiv
(
font
->
ppem
,
1
<<
16
,
ft_face
->
units_per_EM
);
pOS2
=
pFT_Get_Sfnt_Table
(
ft_face
,
ft_sfnt_os2
);
pOS2
=
pFT_Get_Sfnt_Table
(
ft_face
,
ft_sfnt_os2
);
if
(
!
pOS2
)
{
if
(
!
pOS2
)
{
...
@@ -3651,7 +3650,7 @@ static BOOL CDECL freetype_get_char_width_info( struct gdi_font *font, struct ch
...
@@ -3651,7 +3650,7 @@ static BOOL CDECL freetype_get_char_width_info( struct gdi_font *font, struct ch
if
((
pHori
=
pFT_Get_Sfnt_Table
(
ft_face
,
ft_sfnt_hhea
)))
if
((
pHori
=
pFT_Get_Sfnt_Table
(
ft_face
,
ft_sfnt_hhea
)))
{
{
FT_Fixed
em_scale
=
MulDiv
(
font
->
ppem
,
1
<<
16
,
ft_face
->
units_per_EM
);
FT_Fixed
em_scale
=
pFT_
MulDiv
(
font
->
ppem
,
1
<<
16
,
ft_face
->
units_per_EM
);
info
->
lsb
=
(
SHORT
)
pFT_MulFix
(
pHori
->
min_Left_Side_Bearing
,
em_scale
);
info
->
lsb
=
(
SHORT
)
pFT_MulFix
(
pHori
->
min_Left_Side_Bearing
,
em_scale
);
info
->
rsb
=
(
SHORT
)
pFT_MulFix
(
pHori
->
min_Right_Side_Bearing
,
em_scale
);
info
->
rsb
=
(
SHORT
)
pFT_MulFix
(
pHori
->
min_Right_Side_Bearing
,
em_scale
);
return
TRUE
;
return
TRUE
;
...
...
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