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
f73d7d07
Commit
f73d7d07
authored
Mar 30, 2007
by
Felix Nawothnig
Committed by
Alexandre Julliard
Apr 02, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Properly handle negative font widths.
parent
b1bfae28
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
1 deletion
+43
-1
freetype.c
dlls/gdi32/freetype.c
+1
-1
font.c
dlls/gdi32/tests/font.c
+42
-0
No files found.
dlls/gdi32/freetype.c
View file @
f73d7d07
...
...
@@ -2953,7 +2953,7 @@ found:
TRACE
(
"caching: gdiFont=%p hfont=%p
\n
"
,
ret
,
hfont
);
ret
->
aveWidth
=
FT_IS_SCALABLE
(
ret
->
ft_face
)
?
lf
.
lfWidth
:
0
;
ret
->
aveWidth
=
FT_IS_SCALABLE
(
ret
->
ft_face
)
?
abs
(
lf
.
lfWidth
)
:
0
;
list_add_head
(
&
gdi_font_list
,
&
ret
->
entry
);
return
ret
;
}
...
...
dlls/gdi32/tests/font.c
View file @
f73d7d07
...
...
@@ -30,6 +30,8 @@
#include "wine/test.h"
#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got)
LONG
(
WINAPI
*
pGdiGetCharDimensions
)(
HDC
hdc
,
LPTEXTMETRICW
lptm
,
LONG
*
height
);
BOOL
(
WINAPI
*
pGetCharABCWidthsW
)(
HDC
hdc
,
UINT
first
,
UINT
last
,
LPABC
abc
);
DWORD
(
WINAPI
*
pGetFontUnicodeRanges
)(
HDC
hdc
,
LPGLYPHSET
lpgs
);
...
...
@@ -1481,6 +1483,46 @@ static void test_text_metrics(const LOGFONTA *lf)
hfont_old
=
SelectObject
(
hdc
,
hfont
);
if
(
lf
->
lfWidth
>
0
)
{
HFONT
hfont2
;
GLYPHMETRICS
gm1
,
gm2
;
LOGFONTA
lf2
=
*
lf
;
MAT2
mat2
=
{
{
0
,
1
},
{
0
,
0
},
{
0
,
0
},
{
0
,
1
}
};
/* negative widths are handled just as positive ones */
lf2
.
lfWidth
*=
-
1
;
SetLastError
(
0xdeadbeef
);
hfont2
=
CreateFontIndirectA
(
&
lf2
);
ok
(
hfont
!=
0
,
"CreateFontIndirect error %u
\n
"
,
GetLastError
());
SelectObject
(
hdc
,
hfont2
);
memset
(
&
gm1
,
0xaa
,
sizeof
(
gm1
));
SetLastError
(
0xdeadbeef
);
ret
=
GetGlyphOutlineA
(
hdc
,
'x'
,
GGO_METRICS
,
&
gm1
,
0
,
NULL
,
&
mat2
);
ok
(
ret
!=
GDI_ERROR
,
"GetGlyphOutline error 0x%x
\n
"
,
GetLastError
());
SelectObject
(
hdc
,
hfont
);
DeleteObject
(
hfont2
);
memset
(
&
gm2
,
0xbb
,
sizeof
(
gm2
));
SetLastError
(
0xdeadbeef
);
ret
=
GetGlyphOutlineA
(
hdc
,
'x'
,
GGO_METRICS
,
&
gm2
,
0
,
NULL
,
&
mat2
);
ok
(
ret
!=
GDI_ERROR
,
"GetGlyphOutline error 0x%x
\n
"
,
GetLastError
());
ok
(
gm1
.
gmBlackBoxX
==
gm2
.
gmBlackBoxX
&&
gm1
.
gmBlackBoxY
==
gm2
.
gmBlackBoxY
&&
gm1
.
gmptGlyphOrigin
.
x
==
gm2
.
gmptGlyphOrigin
.
x
&&
gm1
.
gmptGlyphOrigin
.
y
==
gm2
.
gmptGlyphOrigin
.
y
&&
gm1
.
gmCellIncX
==
gm2
.
gmCellIncX
&&
gm1
.
gmCellIncY
==
gm2
.
gmCellIncY
,
"gm1=%d,%d,%d,%d,%d,%d gm2=%d,%d,%d,%d,%d,%d
\n
"
,
gm1
.
gmBlackBoxX
,
gm1
.
gmBlackBoxY
,
gm1
.
gmptGlyphOrigin
.
x
,
gm1
.
gmptGlyphOrigin
.
y
,
gm1
.
gmCellIncX
,
gm1
.
gmCellIncY
,
gm2
.
gmBlackBoxX
,
gm2
.
gmBlackBoxY
,
gm2
.
gmptGlyphOrigin
.
x
,
gm2
.
gmptGlyphOrigin
.
y
,
gm2
.
gmCellIncX
,
gm2
.
gmCellIncY
);
}
size
=
GetFontData
(
hdc
,
MS_OS2_TAG
,
0
,
NULL
,
0
);
if
(
size
==
GDI_ERROR
)
{
...
...
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