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
34002d4c
Commit
34002d4c
authored
Feb 27, 2008
by
Huw Davies
Committed by
Alexandre Julliard
Feb 28, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Add a partial implementation of GdiRealizationInfo.
parent
ed9c7396
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
80 additions
and
3 deletions
+80
-3
font.c
dlls/gdi32/font.c
+29
-2
gdi32.spec
dlls/gdi32/gdi32.spec
+1
-1
font.c
dlls/gdi32/tests/font.c
+50
-0
No files found.
dlls/gdi32/font.c
View file @
34002d4c
...
...
@@ -348,7 +348,7 @@ HFONT WINAPI CreateFontIndirectW( const LOGFONTW *plf )
if
(
!
(
fontPtr
=
GDI_AllocObject
(
sizeof
(
FONTOBJ
),
FONT_MAGIC
,
(
HGDIOBJ
*
)
&
hFont
,
&
font_funcs
)))
return
0
;
memcpy
(
&
fontPtr
->
logfont
,
plf
,
sizeof
(
LOGFONTW
)
)
;
fontPtr
->
logfont
=
*
plf
;
TRACE
(
"(%d %d %d %d %x %d %x %d %d) %s %s %s %s => %p
\n
"
,
plf
->
lfHeight
,
plf
->
lfWidth
,
...
...
@@ -2536,7 +2536,7 @@ BOOL WINAPI TranslateCharsetInfo(
return
FALSE
;
}
if
(
index
>=
MAXTCIINDEX
||
FONT_tci
[
index
].
ciCharset
==
DEFAULT_CHARSET
)
return
FALSE
;
memcpy
(
lpCs
,
&
FONT_tci
[
index
],
sizeof
(
CHARSETINFO
))
;
*
lpCs
=
FONT_tci
[
index
]
;
return
TRUE
;
}
...
...
@@ -3209,3 +3209,30 @@ BOOL WINAPI FontIsLinked(HDC hdc)
TRACE
(
"returning %d
\n
"
,
ret
);
return
ret
;
}
/*************************************************************
* GdiRealizationInfo (GDI32.@)
*
* Returns a structure that contains some font information.
*/
typedef
struct
{
DWORD
flags
;
/* 1 for bitmap fonts, 3 for scalable fonts */
DWORD
unknown1
;
/* keeps incrementing - num of fonts that have been created or selected into a dc ?? */
DWORD
unknown2
;
/* fixed for a given font - looks like it could be the order of the face in the font list or the order
in which the face was first rendered. */
}
realization_info_t
;
BOOL
WINAPI
GdiRealizationInfo
(
HDC
hdc
,
realization_info_t
*
info
)
{
UINT
otm_size
;
FIXME
(
"(%p, %p): stub!
\n
"
,
hdc
,
info
);
info
->
flags
=
1
;
otm_size
=
GetOutlineTextMetricsW
(
hdc
,
0
,
NULL
);
if
(
otm_size
)
info
->
flags
|=
2
;
/* scalable */
info
->
unknown1
=
-
1
;
info
->
unknown2
=
-
1
;
return
TRUE
;
}
dlls/gdi32/gdi32.spec
View file @
34002d4c
...
...
@@ -206,7 +206,7 @@
# @ stub GdiProcessSetup
# @ stub GdiQueryFonts
# @ stub GdiQueryTable
# @ stub GdiRealizationInfo
@ stdcall GdiRealizationInfo(long ptr)
# @ stub GdiReleaseDC
@ stub GdiReleaseLocalDC
# @ stub GdiResetDCEMF
...
...
dlls/gdi32/tests/font.c
View file @
34002d4c
...
...
@@ -38,6 +38,7 @@ 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
);
DWORD
(
WINAPI
*
pGetGlyphIndicesW
)(
HDC
hdc
,
LPCWSTR
lpstr
,
INT
count
,
LPWORD
pgi
,
DWORD
flags
);
BOOL
(
WINAPI
*
pGdiRealizationInfo
)(
HDC
hdc
,
DWORD
*
);
static
HMODULE
hgdi32
=
0
;
...
...
@@ -51,6 +52,7 @@ static void init(void)
pGetFontUnicodeRanges
=
(
void
*
)
GetProcAddress
(
hgdi32
,
"GetFontUnicodeRanges"
);
pGetGlyphIndicesA
=
(
void
*
)
GetProcAddress
(
hgdi32
,
"GetGlyphIndicesA"
);
pGetGlyphIndicesW
=
(
void
*
)
GetProcAddress
(
hgdi32
,
"GetGlyphIndicesW"
);
pGdiRealizationInfo
=
(
void
*
)
GetProcAddress
(
hgdi32
,
"GdiRealizationInfo"
);
}
static
INT
CALLBACK
is_truetype_font_installed_proc
(
const
LOGFONT
*
elf
,
const
TEXTMETRIC
*
ntm
,
DWORD
type
,
LPARAM
lParam
)
...
...
@@ -1745,6 +1747,53 @@ static void test_nonexistent_font(void)
ReleaseDC
(
0
,
hdc
);
}
static
void
test_GdiRealizationInfo
(
void
)
{
HDC
hdc
;
DWORD
info
[
4
];
BOOL
r
;
HFONT
hfont
,
hfont_old
;
LOGFONTA
lf
;
if
(
!
pGdiRealizationInfo
)
{
skip
(
"GdiRealizationInfo not available
\n
"
);
return
;
}
hdc
=
GetDC
(
0
);
memset
(
info
,
0xcc
,
sizeof
(
info
));
r
=
pGdiRealizationInfo
(
hdc
,
info
);
ok
(
r
!=
0
,
"ret 0
\n
"
);
ok
(
info
[
0
]
==
1
,
"info[0] = %x for the system font
\n
"
,
info
[
0
]);
ok
(
info
[
3
]
==
0xcccccccc
,
"structure longer than 3 dwords"
);
if
(
!
is_truetype_font_installed
(
"Arial"
))
{
skip
(
"skipping GdiRealizationInfo with truetype font
\n
"
);
goto
end
;
}
memset
(
&
lf
,
0
,
sizeof
(
lf
));
strcpy
(
lf
.
lfFaceName
,
"Arial"
);
lf
.
lfHeight
=
20
;
lf
.
lfWeight
=
FW_NORMAL
;
hfont
=
CreateFontIndirectA
(
&
lf
);
hfont_old
=
SelectObject
(
hdc
,
hfont
);
memset
(
info
,
0xcc
,
sizeof
(
info
));
r
=
pGdiRealizationInfo
(
hdc
,
info
);
ok
(
r
!=
0
,
"ret 0
\n
"
);
ok
(
info
[
0
]
==
3
,
"info[0] = %x for arial
\n
"
,
info
[
0
]);
ok
(
info
[
3
]
==
0xcccccccc
,
"structure longer than 3 dwords"
);
DeleteObject
(
SelectObject
(
hdc
,
hfont_old
));
end:
ReleaseDC
(
0
,
hdc
);
}
START_TEST
(
font
)
{
init
();
...
...
@@ -1778,4 +1827,5 @@ START_TEST(font)
else
skip
(
"Arial Black or Symbol/Wingdings is not installed
\n
"
);
test_GetTextMetrics
();
test_GdiRealizationInfo
();
}
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