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
0dc76580
Commit
0dc76580
authored
Dec 08, 2007
by
Hans Leidekker
Committed by
Alexandre Julliard
Dec 10, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: GetCharABCWidthsI does not require a scalable font.
parent
b529b3bb
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
5 deletions
+60
-5
font.c
dlls/gdi32/font.c
+12
-0
freetype.c
dlls/gdi32/freetype.c
+1
-1
font.c
dlls/gdi32/tests/font.c
+47
-4
No files found.
dlls/gdi32/font.c
View file @
0dc76580
...
...
@@ -2510,6 +2510,12 @@ BOOL WINAPI GetCharABCWidthsW( HDC hdc, UINT firstChar, UINT lastChar,
if
(
!
dc
)
return
FALSE
;
if
(
!
abc
)
{
DC_ReleaseDCPtr
(
dc
);
return
FALSE
;
}
if
(
dc
->
gdiFont
)
ret
=
WineEngGetCharABCWidths
(
dc
->
gdiFont
,
firstChar
,
lastChar
,
abc
);
else
...
...
@@ -2559,6 +2565,12 @@ BOOL WINAPI GetCharABCWidthsI( HDC hdc, UINT firstChar, UINT count,
if
(
!
dc
)
return
FALSE
;
if
(
!
abc
)
{
DC_ReleaseDCPtr
(
dc
);
return
FALSE
;
}
if
(
dc
->
gdiFont
)
ret
=
WineEngGetCharABCWidthsI
(
dc
->
gdiFont
,
firstChar
,
count
,
pgi
,
abc
);
else
...
...
dlls/gdi32/freetype.c
View file @
0dc76580
...
...
@@ -4512,7 +4512,7 @@ BOOL WineEngGetCharABCWidthsI(GdiFont *font, UINT firstChar, UINT count, LPWORD
FT_UInt
glyph_index
;
GdiFont
*
linked_font
;
if
(
!
FT_
IS_SCALABLE
(
font
->
ft_face
))
if
(
!
FT_
HAS_HORIZONTAL
(
font
->
ft_face
))
return
FALSE
;
get_glyph_index_linked
(
font
,
'a'
,
&
linked_font
,
&
glyph_index
);
...
...
dlls/gdi32/tests/font.c
View file @
0dc76580
...
...
@@ -33,6 +33,7 @@
#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
*
pGetCharABCWidthsI
)(
HDC
hdc
,
UINT
first
,
UINT
count
,
LPWORD
glyphs
,
LPABC
abc
);
BOOL
(
WINAPI
*
pGetCharABCWidthsW
)(
HDC
hdc
,
UINT
first
,
UINT
last
,
LPABC
abc
);
DWORD
(
WINAPI
*
pGetFontUnicodeRanges
)(
HDC
hdc
,
LPGLYPHSET
lpgs
);
DWORD
(
WINAPI
*
pGetGlyphIndicesA
)(
HDC
hdc
,
LPCSTR
lpstr
,
INT
count
,
LPWORD
pgi
,
DWORD
flags
);
...
...
@@ -45,6 +46,7 @@ static void init(void)
hgdi32
=
GetModuleHandleA
(
"gdi32.dll"
);
pGdiGetCharDimensions
=
(
void
*
)
GetProcAddress
(
hgdi32
,
"GdiGetCharDimensions"
);
pGetCharABCWidthsI
=
(
void
*
)
GetProcAddress
(
hgdi32
,
"GetCharABCWidthsI"
);
pGetCharABCWidthsW
=
(
void
*
)
GetProcAddress
(
hgdi32
,
"GetCharABCWidthsW"
);
pGetFontUnicodeRanges
=
(
void
*
)
GetProcAddress
(
hgdi32
,
"GetFontUnicodeRanges"
);
pGetGlyphIndicesA
=
(
void
*
)
GetProcAddress
(
hgdi32
,
"GetGlyphIndicesA"
);
...
...
@@ -450,14 +452,55 @@ static void test_GdiGetCharDimensions(void)
DeleteDC
(
hdc
);
}
static
void
test_GetCharABCWidths
W
(
void
)
static
void
test_GetCharABCWidths
(
void
)
{
static
const
WCHAR
str
[]
=
{
'a'
,
0
};
BOOL
ret
;
HDC
hdc
;
LOGFONTA
lf
;
HFONT
hfont
;
ABC
abc
[
1
];
if
(
!
pGetCharABCWidthsW
)
return
;
WORD
glyphs
[
1
];
DWORD
nb
;
if
(
!
pGetCharABCWidthsW
||
!
pGetCharABCWidthsI
)
{
skip
(
"GetCharABCWidthsW/I not available on this platform
\n
"
);
return
;
}
memset
(
&
lf
,
0
,
sizeof
(
lf
));
strcpy
(
lf
.
lfFaceName
,
"System"
);
lf
.
lfHeight
=
20
;
hfont
=
CreateFontIndirectA
(
&
lf
);
hdc
=
GetDC
(
0
);
hfont
=
SelectObject
(
hdc
,
hfont
);
nb
=
pGetGlyphIndicesW
(
hdc
,
str
,
1
,
glyphs
,
0
);
ok
(
nb
==
1
,
"pGetGlyphIndicesW should have returned 1
\n
"
);
ret
=
pGetCharABCWidthsI
(
NULL
,
0
,
1
,
glyphs
,
abc
);
ok
(
!
ret
,
"GetCharABCWidthsI should have failed
\n
"
);
ret
=
pGetCharABCWidthsI
(
hdc
,
0
,
1
,
glyphs
,
NULL
);
ok
(
!
ret
,
"GetCharABCWidthsI should have failed
\n
"
);
ret
=
pGetCharABCWidthsI
(
hdc
,
0
,
1
,
glyphs
,
abc
);
ok
(
ret
,
"GetCharABCWidthsI should have succeeded
\n
"
);
ret
=
pGetCharABCWidthsW
(
NULL
,
'a'
,
'a'
,
abc
);
ok
(
!
ret
,
"GetCharABCWidthsW should have returned FALSE
\n
"
);
ok
(
!
ret
,
"GetCharABCWidthsW should have failed
\n
"
);
ret
=
pGetCharABCWidthsW
(
hdc
,
'a'
,
'a'
,
NULL
);
ok
(
!
ret
,
"GetCharABCWidthsW should have failed
\n
"
);
ret
=
pGetCharABCWidthsW
(
hdc
,
'a'
,
'a'
,
abc
);
ok
(
!
ret
,
"GetCharABCWidthsW should have failed
\n
"
);
hfont
=
SelectObject
(
hdc
,
hfont
);
DeleteObject
(
hfont
);
ReleaseDC
(
NULL
,
hdc
);
}
static
void
test_text_extents
(
void
)
...
...
@@ -1702,7 +1745,7 @@ START_TEST(font)
test_bitmap_font
();
test_bitmap_font_metrics
();
test_GdiGetCharDimensions
();
test_GetCharABCWidths
W
();
test_GetCharABCWidths
();
test_text_extents
();
test_GetGlyphIndices
();
test_GetKerningPairs
();
...
...
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