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
ef4d0d97
Commit
ef4d0d97
authored
Apr 27, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
May 14, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Populate the installed font collection.
parent
80dfd005
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
1 deletion
+72
-1
font.c
dlls/gdiplus/font.c
+65
-1
gdiplus.c
dlls/gdiplus/gdiplus.c
+4
-0
gdiplus_private.h
dlls/gdiplus/gdiplus_private.h
+3
-0
No files found.
dlls/gdiplus/font.c
View file @
ef4d0d97
...
...
@@ -844,6 +844,7 @@ GpStatus WINGDIPAPI GdipNewPrivateFontCollection(GpFontCollection** fontCollecti
(
*
fontCollection
)
->
FontFamilies
=
NULL
;
(
*
fontCollection
)
->
count
=
0
;
(
*
fontCollection
)
->
allocated
=
0
;
return
Ok
;
}
...
...
@@ -930,14 +931,77 @@ GpStatus WINGDIPAPI GdipGetFontCollectionFamilyList(
return
Ok
;
}
void
free_installed_fonts
(
void
)
{
while
(
installedFontCollection
.
count
)
GdipDeleteFontFamily
(
installedFontCollection
.
FontFamilies
[
--
installedFontCollection
.
count
]);
HeapFree
(
GetProcessHeap
(),
0
,
installedFontCollection
.
FontFamilies
);
installedFontCollection
.
FontFamilies
=
NULL
;
installedFontCollection
.
allocated
=
0
;
}
static
INT
CALLBACK
add_font_proc
(
const
LOGFONTW
*
lfw
,
const
TEXTMETRICW
*
ntm
,
DWORD
type
,
LPARAM
lParam
)
{
GpFontCollection
*
fonts
=
(
GpFontCollection
*
)
lParam
;
int
i
;
/* skip duplicates */
for
(
i
=
0
;
i
<
fonts
->
count
;
i
++
)
if
(
strcmpiW
(
lfw
->
lfFaceName
,
fonts
->
FontFamilies
[
i
]
->
FamilyName
)
==
0
)
return
1
;
if
(
fonts
->
allocated
==
fonts
->
count
)
{
INT
new_alloc_count
=
fonts
->
allocated
+
50
;
GpFontFamily
**
new_family_list
=
HeapAlloc
(
GetProcessHeap
(),
0
,
new_alloc_count
*
sizeof
(
void
*
));
if
(
!
new_family_list
)
return
0
;
memcpy
(
new_family_list
,
fonts
->
FontFamilies
,
fonts
->
count
*
sizeof
(
void
*
));
HeapFree
(
GetProcessHeap
(),
0
,
fonts
->
FontFamilies
);
fonts
->
FontFamilies
=
new_family_list
;
fonts
->
allocated
=
new_alloc_count
;
}
if
(
GdipCreateFontFamilyFromName
(
lfw
->
lfFaceName
,
NULL
,
&
fonts
->
FontFamilies
[
fonts
->
count
])
==
Ok
)
fonts
->
count
++
;
else
return
0
;
return
1
;
}
GpStatus
WINGDIPAPI
GdipNewInstalledFontCollection
(
GpFontCollection
**
fontCollection
)
{
FIXME
(
"stub: %p
\n
"
,
fontCollection
);
TRACE
(
"(%p)
\n
"
,
fontCollection
);
if
(
!
fontCollection
)
return
InvalidParameter
;
if
(
installedFontCollection
.
count
==
0
)
{
HDC
hdc
;
LOGFONTW
lfw
;
hdc
=
GetDC
(
0
);
lfw
.
lfCharSet
=
DEFAULT_CHARSET
;
lfw
.
lfFaceName
[
0
]
=
0
;
lfw
.
lfPitchAndFamily
=
0
;
if
(
!
EnumFontFamiliesExW
(
hdc
,
&
lfw
,
add_font_proc
,
(
LPARAM
)
&
installedFontCollection
,
0
))
{
free_installed_fonts
();
ReleaseDC
(
0
,
hdc
);
return
OutOfMemory
;
}
ReleaseDC
(
0
,
hdc
);
}
*
fontCollection
=
&
installedFontCollection
;
return
Ok
;
...
...
dlls/gdiplus/gdiplus.c
View file @
ef4d0d97
...
...
@@ -64,6 +64,10 @@ BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved)
case
DLL_PROCESS_ATTACH
:
DisableThreadLibraryCalls
(
hinst
);
break
;
case
DLL_PROCESS_DETACH
:
free_installed_fonts
();
break
;
}
return
TRUE
;
}
...
...
dlls/gdiplus/gdiplus_private.h
View file @
ef4d0d97
...
...
@@ -52,6 +52,8 @@ extern void calc_curve_bezier(CONST GpPointF *pts, REAL tension, REAL *x1,
extern
void
calc_curve_bezier_endp
(
REAL
xend
,
REAL
yend
,
REAL
xadj
,
REAL
yadj
,
REAL
tension
,
REAL
*
x
,
REAL
*
y
);
extern
void
free_installed_fonts
(
void
);
extern
BOOL
lengthen_path
(
GpPath
*
path
,
INT
len
);
extern
GpStatus
trace_path
(
GpGraphics
*
graphics
,
GpPath
*
path
);
...
...
@@ -245,6 +247,7 @@ struct GpStringFormat{
struct
GpFontCollection
{
GpFontFamily
**
FontFamilies
;
INT
count
;
INT
allocated
;
};
struct
GpFontFamily
{
...
...
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