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
df76fe6f
Commit
df76fe6f
authored
Jun 24, 2008
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jun 24, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Perform the world transform separately from font scaling.
parent
8a6628ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
12 deletions
+39
-12
freetype.c
dlls/gdi32/freetype.c
+39
-12
No files found.
dlls/gdi32/freetype.c
View file @
df76fe6f
...
...
@@ -3482,8 +3482,7 @@ found:
it
=
lf
.
lfItalic
?
1
:
0
;
bd
=
lf
.
lfWeight
>
550
?
1
:
0
;
height
=
GDI_ROUND
(
(
double
)
lf
.
lfHeight
*
dc
->
xformWorld2Vport
.
eM22
);
height
=
lf
.
lfHeight
<
0
?
-
abs
(
height
)
:
abs
(
height
);
height
=
lf
.
lfHeight
;
face
=
best
=
best_bitmap
=
NULL
;
LIST_FOR_EACH_ENTRY
(
face
,
&
family
->
faces
,
Face
,
entry
)
...
...
@@ -4260,6 +4259,12 @@ DWORD WineEngGetGlyphIndices(GdiFont *font, LPCWSTR lpstr, INT count,
return
count
;
}
static
inline
BOOL
is_identity_FMAT2
(
const
FMAT2
*
matrix
)
{
static
const
FMAT2
identity
=
{
1
.
0
,
0
.
0
,
0
.
0
,
1
.
0
};
return
!
memcmp
(
matrix
,
&
identity
,
sizeof
(
FMAT2
));
}
/*************************************************************
* WineEngGetGlyphOutline
*
...
...
@@ -4340,7 +4345,7 @@ DWORD WineEngGetGlyphOutline(GdiFont *incoming_font, UINT glyph, UINT format,
/* Scaling factor */
if
(
font
->
aveWidth
&&
font
->
potm
)
{
widthRatio
=
(
double
)
font
->
aveWidth
*
font
->
font_desc
.
matrix
.
eM11
;
widthRatio
=
(
double
)
font
->
aveWidth
;
widthRatio
/=
(
double
)
font
->
potm
->
otmTextMetrics
.
tmAveCharWidth
;
}
else
...
...
@@ -4393,6 +4398,18 @@ DWORD WineEngGetGlyphOutline(GdiFont *incoming_font, UINT glyph, UINT format,
needsTransform
=
TRUE
;
}
/* World transform */
if
(
!
is_identity_FMAT2
(
&
font
->
font_desc
.
matrix
))
{
FT_Matrix
worldMat
;
worldMat
.
xx
=
FT_FixedFromFloat
(
font
->
font_desc
.
matrix
.
eM11
);
worldMat
.
xy
=
FT_FixedFromFloat
(
font
->
font_desc
.
matrix
.
eM21
);
worldMat
.
yx
=
FT_FixedFromFloat
(
font
->
font_desc
.
matrix
.
eM12
);
worldMat
.
yy
=
FT_FixedFromFloat
(
font
->
font_desc
.
matrix
.
eM22
);
pFT_Matrix_Multiply
(
&
worldMat
,
&
transMat
);
needsTransform
=
TRUE
;
}
/* Extra transformation specified by caller */
if
(
lpmat
)
{
FT_Matrix
extraMat
;
...
...
@@ -4857,24 +4874,34 @@ static BOOL get_bitmap_text_metrics(GdiFont *font)
static
void
scale_font_metrics
(
const
GdiFont
*
font
,
LPTEXTMETRICW
ptm
)
{
double
scale_x
;
double
scale_x
,
scale_y
;
if
(
font
->
aveWidth
)
{
scale_x
=
(
double
)
font
->
aveWidth
*
font
->
font_desc
.
matrix
.
eM11
;
scale_x
=
(
double
)
font
->
aveWidth
;
scale_x
/=
(
double
)
font
->
potm
->
otmTextMetrics
.
tmAveCharWidth
;
}
else
scale_x
=
font
->
scale_y
;
ptm
->
tmHeight
=
(
double
)
ptm
->
tmHeight
*
font
->
scale_y
;
ptm
->
tmAscent
=
(
double
)
ptm
->
tmAscent
*
font
->
scale_y
;
ptm
->
tmDescent
=
(
double
)
ptm
->
tmDescent
*
font
->
scale_y
;
ptm
->
tmInternalLeading
=
(
double
)
ptm
->
tmInternalLeading
*
font
->
scale_y
;
ptm
->
tmExternalLeading
=
(
double
)
ptm
->
tmExternalLeading
*
font
->
scale_y
;
scale_x
*=
fabs
(
font
->
font_desc
.
matrix
.
eM11
);
scale_y
=
font
->
scale_y
*
fabs
(
font
->
font_desc
.
matrix
.
eM22
);
#define SCALE_X(x) (x) = GDI_ROUND((double)(x) * (scale_x))
#define SCALE_Y(y) (y) = GDI_ROUND((double)(y) * (scale_y))
SCALE_Y
(
ptm
->
tmHeight
);
SCALE_Y
(
ptm
->
tmAscent
);
SCALE_Y
(
ptm
->
tmDescent
);
SCALE_Y
(
ptm
->
tmInternalLeading
);
SCALE_Y
(
ptm
->
tmExternalLeading
);
SCALE_Y
(
ptm
->
tmOverhang
);
SCALE_X
(
ptm
->
tmAveCharWidth
);
SCALE_X
(
ptm
->
tmMaxCharWidth
);
ptm
->
tmAveCharWidth
=
(
double
)
ptm
->
tmAveCharWidth
*
scale_x
;
ptm
->
tmMaxCharWidth
=
(
double
)
ptm
->
tmMaxCharWidth
*
scale_x
;
#undef SCALE_X
#undef SCALE_Y
}
/*************************************************************
...
...
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