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
f667c06a
Commit
f667c06a
authored
Aug 24, 2006
by
Jeff Latimer
Committed by
Alexandre Julliard
Aug 24, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi: Add missing glyph code to GetGlyphIndices and tests.
parent
e5d9b2f1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
2 deletions
+47
-2
freetype.c
dlls/gdi/freetype.c
+16
-2
font.c
dlls/gdi/tests/font.c
+31
-0
No files found.
dlls/gdi/freetype.c
View file @
f667c06a
...
...
@@ -2898,11 +2898,25 @@ static FT_UInt get_glyph_index(GdiFont font, UINT glyph)
DWORD
WineEngGetGlyphIndices
(
GdiFont
font
,
LPCWSTR
lpstr
,
INT
count
,
LPWORD
pgi
,
DWORD
flags
)
{
INT
i
;
int
i
;
WCHAR
default_char
=
0
;
TEXTMETRICW
textm
;
if
(
flags
&
GGI_MARK_NONEXISTING_GLYPHS
)
default_char
=
0x001f
;
/* Indicate non existence */
for
(
i
=
0
;
i
<
count
;
i
++
)
{
pgi
[
i
]
=
get_glyph_index
(
font
,
lpstr
[
i
]);
if
(
pgi
[
i
]
==
0
)
{
if
(
!
default_char
)
{
WineEngGetTextMetrics
(
font
,
&
textm
);
default_char
=
textm
.
tmDefaultChar
;
}
pgi
[
i
]
=
default_char
;
}
}
return
count
;
}
...
...
dlls/gdi/tests/font.c
View file @
f667c06a
...
...
@@ -391,6 +391,36 @@ static void test_text_extents(void)
ReleaseDC
(
NULL
,
hdc
);
}
static
void
test_GetGlyphIndices
()
{
HDC
hdc
;
HFONT
hfont
;
DWORD
charcount
;
LOGFONTA
lf
;
DWORD
flags
=
0
;
WCHAR
testtext
[]
=
{
'T'
,
'e'
,
's'
,
't'
,
0xffff
,
0
};
WORD
glyphs
[(
sizeof
(
testtext
)
/
2
)
-
1
];
TEXTMETRIC
textm
;
memset
(
&
lf
,
0
,
sizeof
(
lf
));
strcpy
(
lf
.
lfFaceName
,
"Symbol"
);
lf
.
lfHeight
=
20
;
hfont
=
CreateFontIndirectA
(
&
lf
);
hdc
=
GetDC
(
0
);
ok
(
GetTextMetrics
(
hdc
,
&
textm
),
"GetTextMetric failed
\n
"
);
flags
|=
GGI_MARK_NONEXISTING_GLYPHS
;
charcount
=
GetGlyphIndicesW
(
hdc
,
testtext
,
(
sizeof
(
testtext
)
/
2
)
-
1
,
glyphs
,
flags
);
ok
(
charcount
==
5
,
"GetGlyphIndices count of glyphs should = 5 not %ld
\n
"
,
charcount
);
ok
(
glyphs
[
4
]
==
0x001f
,
"GetGlyphIndices should have returned a non existant char not %04x
\n
"
,
glyphs
[
4
]);
flags
=
0
;
charcount
=
GetGlyphIndicesW
(
hdc
,
testtext
,
(
sizeof
(
testtext
)
/
2
)
-
1
,
glyphs
,
flags
);
ok
(
charcount
==
5
,
"GetGlyphIndices count of glyphs should = 5 not %ld
\n
"
,
charcount
);
ok
(
glyphs
[
4
]
==
textm
.
tmDefaultChar
,
"GetGlyphIndices should have returned a %04x not %04x
\n
"
,
textm
.
tmDefaultChar
,
glyphs
[
4
]);
}
START_TEST
(
font
)
{
test_logfont
();
...
...
@@ -399,4 +429,5 @@ START_TEST(font)
test_GdiGetCharDimensions
();
test_GetCharABCWidthsW
();
test_text_extents
();
test_GetGlyphIndices
();
}
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