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
49eb1237
Commit
49eb1237
authored
Jul 07, 2008
by
Michael Karcher
Committed by
Alexandre Julliard
Jul 08, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for compatibility mode in WineEngCreateFontInstance.
parent
762e5818
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
8 deletions
+36
-8
freetype.c
dlls/gdi32/freetype.c
+17
-8
font.c
dlls/gdi32/tests/font.c
+19
-0
No files found.
dlls/gdi32/freetype.c
View file @
49eb1237
...
...
@@ -3064,7 +3064,7 @@ static void calc_hash(FONT_DESC *pfd)
return
;
}
static
GdiFont
*
find_in_cache
(
HFONT
hfont
,
const
LOGFONTW
*
plf
,
const
XFORM
*
pxf
,
BOOL
can_use_bitmap
)
static
GdiFont
*
find_in_cache
(
HFONT
hfont
,
const
LOGFONTW
*
plf
,
const
FMAT2
*
pmat
,
BOOL
can_use_bitmap
)
{
GdiFont
*
ret
;
FONT_DESC
fd
;
...
...
@@ -3072,7 +3072,7 @@ static GdiFont *find_in_cache(HFONT hfont, const LOGFONTW *plf, const XFORM *pxf
struct
list
*
font_elem_ptr
,
*
hfontlist_elem_ptr
;
fd
.
lf
=
*
plf
;
memcpy
(
&
fd
.
matrix
,
pxf
,
sizeof
(
FMAT2
))
;
fd
.
matrix
=
*
pmat
;
fd
.
can_use_bitmap
=
can_use_bitmap
;
calc_hash
(
&
fd
);
...
...
@@ -3240,6 +3240,7 @@ GdiFont *WineEngCreateFontInstance(DC *dc, HFONT hfont)
LOGFONTW
lf
;
CHARSETINFO
csi
;
HFONTLIST
*
hflist
;
FMAT2
dcmat
;
FontSubst
*
psub
=
NULL
;
EnterCriticalSection
(
&
freetype_cs
);
...
...
@@ -3269,13 +3270,21 @@ GdiFont *WineEngCreateFontInstance(DC *dc, HFONT hfont)
lf
.
lfWeight
,
lf
.
lfPitchAndFamily
,
lf
.
lfCharSet
,
lf
.
lfOrientation
,
lf
.
lfEscapement
);
TRACE
(
"DC transform %f %f %f %f %f %f
\n
"
,
dc
->
xformWorld2Vport
.
eM11
,
dc
->
xformWorld2Vport
.
eM12
,
dc
->
xformWorld2Vport
.
eM21
,
dc
->
xformWorld2Vport
.
eM22
,
dc
->
xformWorld2Vport
.
eDx
,
dc
->
xformWorld2Vport
.
eDy
);
if
(
dc
->
GraphicsMode
==
GM_ADVANCED
)
memcpy
(
&
dcmat
,
&
dc
->
xformWorld2Vport
,
sizeof
(
FMAT2
));
else
{
/* Windows 3.1 compatibility mode GM_COMPATIBLE has only limited
font scaling abilities. */
dcmat
.
eM11
=
dcmat
.
eM22
=
fabs
(
dc
->
xformWorld2Vport
.
eM22
);
dcmat
.
eM21
=
dcmat
.
eM12
=
0
;
}
TRACE
(
"DC transform %f %f %f %f
\n
"
,
dcmat
.
eM11
,
dcmat
.
eM12
,
dcmat
.
eM21
,
dcmat
.
eM22
);
/* check the cache first */
if
((
ret
=
find_in_cache
(
hfont
,
&
lf
,
&
dc
->
xformWorld2Vpor
t
,
can_use_bitmap
))
!=
NULL
)
{
if
((
ret
=
find_in_cache
(
hfont
,
&
lf
,
&
dc
ma
t
,
can_use_bitmap
))
!=
NULL
)
{
TRACE
(
"returning cached gdiFont(%p) for hFont %p
\n
"
,
ret
,
hfont
);
LeaveCriticalSection
(
&
freetype_cs
);
return
ret
;
...
...
@@ -3297,7 +3306,7 @@ GdiFont *WineEngCreateFontInstance(DC *dc, HFONT hfont)
ret
=
alloc_font
();
memcpy
(
&
ret
->
font_desc
.
matrix
,
&
dc
->
xformWorld2Vport
,
sizeof
(
FMAT2
))
;
ret
->
font_desc
.
matrix
=
dcmat
;
ret
->
font_desc
.
lf
=
lf
;
ret
->
font_desc
.
can_use_bitmap
=
can_use_bitmap
;
calc_hash
(
&
ret
->
font_desc
);
...
...
dlls/gdi32/tests/font.c
View file @
49eb1237
...
...
@@ -453,6 +453,25 @@ static void test_outline_font(void)
ok
(
gm
.
gmCellIncY
==
0
,
"incY %d != 0
\n
"
,
gm
.
gmCellIncY
);
SelectObject
(
hdc
,
old_hfont
);
SetMapMode
(
hdc
,
MM_ANISOTROPIC
);
/* test restrictions of compatibility mode GM_COMPATIBLE */
/* part 1: rescaling only X should not change font scaling on screen.
So compressing the X axis by 2 is not done, and this
appears as X scaling of 2 that no one requested. */
SetWindowExtEx
(
hdc
,
100
,
100
,
NULL
);
SetViewportExtEx
(
hdc
,
50
,
100
,
NULL
);
test_font_metrics
(
hdc
,
hfont
,
lf
.
lfHeight
,
lf
.
lfWidth
,
test_str
,
sizeof
(
test_str
),
&
otm
.
otmTextMetrics
,
&
size_orig
,
width_orig
,
2
,
1
);
/* part 2: rescaling only Y should change font scaling.
As also X is scaled by a factor of 2, but this is not
requested by the DC transformation, we get a scaling factor
of 2 in the X coordinate. */
SetViewportExtEx
(
hdc
,
100
,
200
,
NULL
);
test_font_metrics
(
hdc
,
hfont
,
lf
.
lfHeight
,
lf
.
lfWidth
,
test_str
,
sizeof
(
test_str
),
&
otm
.
otmTextMetrics
,
&
size_orig
,
width_orig
,
2
,
1
);
/* restore scaling */
SetMapMode
(
hdc
,
MM_TEXT
);
if
(
!
SetGraphicsMode
(
hdc
,
GM_ADVANCED
))
{
DeleteObject
(
hfont
);
...
...
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