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
8be1357b
Commit
8be1357b
authored
Aug 11, 2016
by
Nikolay Sivov
Committed by
Alexandre Julliard
Aug 11, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
t2embed: Fix embedding type resolution order.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8fbaeb30
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
6 deletions
+66
-6
main.c
dlls/t2embed/main.c
+10
-5
Makefile.in
dlls/t2embed/tests/Makefile.in
+1
-1
t2embed.c
dlls/t2embed/tests/t2embed.c
+55
-0
No files found.
dlls/t2embed/main.c
View file @
8be1357b
...
...
@@ -33,7 +33,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(t2embed);
BOOL
WINAPI
DllMain
(
HINSTANCE
hinstDLL
,
DWORD
fdwReason
,
LPVOID
lpvReserved
)
{
switch
(
fdwReason
)
{
case
DLL_WINE_PREATTACH
:
...
...
@@ -89,14 +88,20 @@ LONG WINAPI TTGetEmbeddingType(HDC hDC, ULONG *status)
if
(
!
status
)
return
E_PERMISSIONSINVALID
;
otm
.
otmfsType
&=
0xf
;
if
(
otm
.
otmfsType
==
LICENSE_INSTALLABLE
)
*
status
=
EMBED_INSTALLABLE
;
else
if
(
otm
.
otmfsType
&
LICENSE_NOEMBEDDING
)
*
status
=
EMBED_NOEMBEDDING
;
else
if
(
otm
.
otmfsType
&
LICENSE_PREVIEWPRINT
)
*
status
=
EMBED_PREVIEWPRINT
;
else
if
(
otm
.
otmfsType
&
LICENSE_EDITABLE
)
*
status
=
EMBED_EDITABLE
;
else
if
(
otm
.
otmfsType
&
LICENSE_PREVIEWPRINT
)
*
status
=
EMBED_PREVIEWPRINT
;
else
if
(
otm
.
otmfsType
&
LICENSE_NOEMBEDDING
)
*
status
=
EMBED_NOEMBEDDING
;
else
{
WARN
(
"unrecognized flags, %#x
\n
"
,
otm
.
otmfsType
);
*
status
=
EMBED_INSTALLABLE
;
}
return
E_NONE
;
}
...
...
dlls/t2embed/tests/Makefile.in
View file @
8be1357b
TESTDLL
=
t2embed.dll
IMPORTS
=
gdi32 t2embed
IMPORTS
=
user32
gdi32 t2embed
C_SRCS
=
\
t2embed.c
dlls/t2embed/tests/t2embed.c
View file @
8be1357b
...
...
@@ -19,10 +19,59 @@
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "t2embapi.h"
#include "wine/test.h"
static
int
CALLBACK
enum_font_proc
(
ENUMLOGFONTEXA
*
enumlf
,
NEWTEXTMETRICEXA
*
ntm
,
DWORD
type
,
LPARAM
lParam
)
{
OUTLINETEXTMETRICA
otm
;
HDC
hdc
=
GetDC
(
NULL
);
HFONT
hfont
,
old_font
;
ULONG
status
;
LONG
ret
;
hfont
=
CreateFontIndirectA
(
&
enumlf
->
elfLogFont
);
old_font
=
SelectObject
(
hdc
,
hfont
);
otm
.
otmSize
=
sizeof
(
otm
);
if
(
GetOutlineTextMetricsA
(
hdc
,
otm
.
otmSize
,
&
otm
))
{
ULONG
expected
=
0xffff
;
UINT
fsType
=
otm
.
otmfsType
&
0xf
;
ret
=
TTGetEmbeddingType
(
hdc
,
&
status
);
ok
(
ret
==
E_NONE
,
"got %d
\n
"
,
ret
);
if
(
fsType
==
LICENSE_INSTALLABLE
)
expected
=
EMBED_INSTALLABLE
;
else
if
(
fsType
&
LICENSE_EDITABLE
)
expected
=
EMBED_EDITABLE
;
else
if
(
fsType
&
LICENSE_PREVIEWPRINT
)
expected
=
EMBED_PREVIEWPRINT
;
else
if
(
fsType
&
LICENSE_NOEMBEDDING
)
expected
=
EMBED_NOEMBEDDING
;
ok
(
expected
==
status
,
"%s: status %d, expected %d, fsType %#x
\n
"
,
enumlf
->
elfLogFont
.
lfFaceName
,
status
,
expected
,
otm
.
otmfsType
);
}
else
{
status
=
0xdeadbeef
;
ret
=
TTGetEmbeddingType
(
hdc
,
&
status
);
ok
(
ret
==
E_NOTATRUETYPEFONT
,
"%s: got %d
\n
"
,
enumlf
->
elfLogFont
.
lfFaceName
,
ret
);
ok
(
status
==
0xdeadbeef
,
"%s: got status %d
\n
"
,
enumlf
->
elfLogFont
.
lfFaceName
,
status
);
}
SelectObject
(
hdc
,
old_font
);
DeleteObject
(
hfont
);
ReleaseDC
(
NULL
,
hdc
);
return
1
;
}
static
void
test_TTGetEmbeddingType
(
void
)
{
HFONT
hfont
,
old_font
;
...
...
@@ -73,6 +122,12 @@ static void test_TTGetEmbeddingType(void)
SelectObject
(
hdc
,
old_font
);
DeleteObject
(
hfont
);
/* repeat for all system fonts */
logfont
.
lfCharSet
=
DEFAULT_CHARSET
;
logfont
.
lfFaceName
[
0
]
=
0
;
EnumFontFamiliesExA
(
hdc
,
&
logfont
,
(
FONTENUMPROCA
)
enum_font_proc
,
0
,
0
);
DeleteDC
(
hdc
);
}
...
...
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