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
e8e1d0f6
Commit
e8e1d0f6
authored
Jun 21, 2008
by
Adam Petaccia
Committed by
Alexandre Julliard
Jun 25, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Implement GdipCreateFontFamilyFromName.
parent
2ea9e28d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
105 additions
and
1 deletion
+105
-1
font.c
dlls/gdiplus/font.c
+88
-0
gdiplus.spec
dlls/gdiplus/gdiplus.spec
+1
-1
gdiplus_private.h
dlls/gdiplus/gdiplus_private.h
+9
-0
gdiplusflat.h
include/gdiplusflat.h
+3
-0
gdiplusgpstubs.h
include/gdiplusgpstubs.h
+4
-0
No files found.
dlls/gdiplus/font.c
View file @
e8e1d0f6
...
@@ -22,6 +22,10 @@
...
@@ -22,6 +22,10 @@
#include "winbase.h"
#include "winbase.h"
#include "wingdi.h"
#include "wingdi.h"
#include "winnls.h"
#include "winnls.h"
#include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
gdiplus
);
#include "objbase.h"
#include "objbase.h"
...
@@ -130,3 +134,87 @@ GpStatus WINGDIPAPI GdipCloneFont(GpFont *font, GpFont **cloneFont)
...
@@ -130,3 +134,87 @@ GpStatus WINGDIPAPI GdipCloneFont(GpFont *font, GpFont **cloneFont)
return
Ok
;
return
Ok
;
}
}
/* Borrowed from GDI32 */
static
INT
CALLBACK
is_font_installed_proc
(
const
LOGFONTW
*
elf
,
const
TEXTMETRICW
*
ntm
,
DWORD
type
,
LPARAM
lParam
)
{
return
0
;
}
static
BOOL
is_font_installed
(
const
WCHAR
*
name
)
{
HDC
hdc
=
GetDC
(
0
);
BOOL
ret
=
FALSE
;
if
(
!
EnumFontFamiliesW
(
hdc
,
name
,
is_font_installed_proc
,
0
))
ret
=
TRUE
;
ReleaseDC
(
0
,
hdc
);
return
ret
;
}
/*******************************************************************************
* GdipCreateFontFamilyFromName [GDIPLUS.@]
*
* Creates a font family object based on a supplied name
*
* PARAMS
* name [I] Name of the font
* fontCollection [I] What font collection (if any) the font belongs to (may be NULL)
* FontFamily [O] Pointer to the resulting FontFamily object
*
* RETURNS
* SUCCESS: Ok
* FAILURE: FamilyNotFound if the requested FontFamily does not exist on the system
* FAILURE: Invalid parameter if FontFamily or name is NULL
*
* NOTES
* If fontCollection is NULL then the object is not part of any collection
*
*/
GpStatus
WINGDIPAPI
GdipCreateFontFamilyFromName
(
GDIPCONST
WCHAR
*
name
,
GpFontCollection
*
fontCollection
,
GpFontFamily
**
FontFamily
)
{
GpFontFamily
*
ffamily
;
HDC
hdc
;
HFONT
hFont
;
LOGFONTW
lfw
;
TRACE
(
"%s, %p %p
\n
"
,
debugstr_w
(
name
),
fontCollection
,
FontFamily
);
if
(
!
(
name
&&
FontFamily
))
return
InvalidParameter
;
if
(
fontCollection
)
FIXME
(
"No support for FontCollections yet!
\n
"
);
if
(
!
is_font_installed
(
name
))
return
FontFamilyNotFound
;
ffamily
=
GdipAlloc
(
sizeof
(
GpFontFamily
));
if
(
!
ffamily
)
return
OutOfMemory
;
ffamily
->
tmw
=
GdipAlloc
(
sizeof
(
TEXTMETRICW
));
if
(
!
ffamily
->
tmw
)
{
GdipFree
(
ffamily
);
return
OutOfMemory
;}
hdc
=
GetDC
(
0
);
lstrcpynW
(
lfw
.
lfFaceName
,
name
,
sizeof
(
WCHAR
)
*
LF_FACESIZE
);
hFont
=
CreateFontIndirectW
(
&
lfw
);
SelectObject
(
hdc
,
hFont
);
GetTextMetricsW
(
hdc
,
ffamily
->
tmw
);
ffamily
->
FamilyName
=
GdipAlloc
(
LF_FACESIZE
*
sizeof
(
WCHAR
));
if
(
!
ffamily
->
FamilyName
)
{
GdipFree
(
ffamily
);
return
OutOfMemory
;
}
lstrcpynW
(
ffamily
->
FamilyName
,
name
,
sizeof
(
WCHAR
)
*
LF_FACESIZE
);
*
FontFamily
=
ffamily
;
ReleaseDC
(
0
,
hdc
);
return
Ok
;
}
dlls/gdiplus/gdiplus.spec
View file @
e8e1d0f6
...
@@ -85,7 +85,7 @@
...
@@ -85,7 +85,7 @@
@ stdcall GdipCreateCustomLineCap(ptr ptr long long ptr)
@ stdcall GdipCreateCustomLineCap(ptr ptr long long ptr)
@ stub GdipCreateEffect
@ stub GdipCreateEffect
@ stub GdipCreateFont
@ stub GdipCreateFont
@ st
ub GdipCreateFontFamilyFromName
@ st
dcall GdipCreateFontFamilyFromName(wstr ptr ptr)
@ stdcall GdipCreateFontFromDC(long ptr)
@ stdcall GdipCreateFontFromDC(long ptr)
@ stdcall GdipCreateFontFromLogfontA(long ptr ptr)
@ stdcall GdipCreateFontFromLogfontA(long ptr ptr)
@ stdcall GdipCreateFontFromLogfontW(long ptr ptr)
@ stdcall GdipCreateFontFromLogfontW(long ptr ptr)
...
...
dlls/gdiplus/gdiplus_private.h
View file @
e8e1d0f6
...
@@ -185,4 +185,13 @@ struct GpStringFormat{
...
@@ -185,4 +185,13 @@ struct GpStringFormat{
StringAlignment
vertalign
;
StringAlignment
vertalign
;
};
};
struct
GpFontCollection
{
GpFontFamily
*
FontFamilies
;
};
struct
GpFontFamily
{
TEXTMETRICW
*
tmw
;
WCHAR
*
FamilyName
;
};
#endif
#endif
include/gdiplusflat.h
View file @
e8e1d0f6
...
@@ -348,6 +348,9 @@ GpStatus WINGDIPAPI GdipDeleteFont(GpFont*);
...
@@ -348,6 +348,9 @@ GpStatus WINGDIPAPI GdipDeleteFont(GpFont*);
GpStatus
WINGDIPAPI
GdipGetLogFontW
(
GpFont
*
,
GpGraphics
*
,
LOGFONTW
*
);
GpStatus
WINGDIPAPI
GdipGetLogFontW
(
GpFont
*
,
GpGraphics
*
,
LOGFONTW
*
);
GpStatus
WINGDIPAPI
GdipCloneFont
(
GpFont
*
,
GpFont
**
);
GpStatus
WINGDIPAPI
GdipCloneFont
(
GpFont
*
,
GpFont
**
);
GpStatus
WINGDIPAPI
GdipCreateFontFamilyFromName
(
GDIPCONST
WCHAR
*
,
GpFontCollection
*
,
GpFontFamily
**
);
GpStatus
WINGDIPAPI
GdipCreateStringFormat
(
INT
,
LANGID
,
GpStringFormat
**
);
GpStatus
WINGDIPAPI
GdipCreateStringFormat
(
INT
,
LANGID
,
GpStringFormat
**
);
GpStatus
WINGDIPAPI
GdipDeleteStringFormat
(
GpStringFormat
*
);
GpStatus
WINGDIPAPI
GdipDeleteStringFormat
(
GpStringFormat
*
);
GpStatus
WINGDIPAPI
GdipGetStringFormatAlign
(
GpStringFormat
*
,
StringAlignment
*
);
GpStatus
WINGDIPAPI
GdipGetStringFormatAlign
(
GpStringFormat
*
,
StringAlignment
*
);
...
...
include/gdiplusgpstubs.h
View file @
e8e1d0f6
...
@@ -37,6 +37,8 @@ class GpPathGradient : public GpBrush {};
...
@@ -37,6 +37,8 @@ class GpPathGradient : public GpBrush {};
class
GpLineGradient
:
public
GpBrush
{};
class
GpLineGradient
:
public
GpBrush
{};
class
GpTexture
:
public
GpBrush
{};
class
GpTexture
:
public
GpBrush
{};
class
GpFont
{};
class
GpFont
{};
class
GpFontCollection
{};
class
GpFontFamily
{};
class
GpStringFormat
{};
class
GpStringFormat
{};
class
GpRegion
{};
class
GpRegion
{};
class
CGpEffect
{};
class
CGpEffect
{};
...
@@ -59,6 +61,8 @@ typedef struct GpPathGradient GpPathGradient;
...
@@ -59,6 +61,8 @@ typedef struct GpPathGradient GpPathGradient;
typedef
struct
GpLineGradient
GpLineGradient
;
typedef
struct
GpLineGradient
GpLineGradient
;
typedef
struct
GpTexture
GpTexture
;
typedef
struct
GpTexture
GpTexture
;
typedef
struct
GpFont
GpFont
;
typedef
struct
GpFont
GpFont
;
typedef
struct
GpFontCollection
GpFontCollection
;
typedef
struct
GpFontFamily
GpFontFamily
;
typedef
struct
GpStringFormat
GpStringFormat
;
typedef
struct
GpStringFormat
GpStringFormat
;
typedef
struct
GpRegion
GpRegion
;
typedef
struct
GpRegion
GpRegion
;
typedef
struct
CGpEffect
CGpEffect
;
typedef
struct
CGpEffect
CGpEffect
;
...
...
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