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
2b804c56
Commit
2b804c56
authored
Aug 04, 2004
by
Huw Davies
Committed by
Alexandre Julliard
Aug 04, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert gdi font list to use list.h.
parent
990ec26c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
25 deletions
+19
-25
freetype.c
dlls/gdi/freetype.c
+19
-25
No files found.
dlls/gdi/freetype.c
View file @
2b804c56
...
...
@@ -40,6 +40,7 @@
#include "gdi_private.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include "wine/list.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
font
);
...
...
@@ -189,6 +190,7 @@ typedef struct {
}
GM
;
struct
tagGdiFont
{
struct
list
entry
;
FT_Face
ft_face
;
XFORM
xform
;
LPWSTR
name
;
...
...
@@ -206,12 +208,11 @@ struct tagGdiFont {
SHORT
yMin
;
OUTLINETEXTMETRICW
*
potm
;
FONTSIGNATURE
fs
;
struct
tagGdiFont
*
next
;
};
#define INIT_GM_SIZE 128
static
GdiFont
GdiFontList
=
NULL
;
static
struct
list
gdi_font_list
=
LIST_INIT
(
gdi_font_list
)
;
static
Family
*
FontList
=
NULL
;
...
...
@@ -1329,7 +1330,6 @@ static GdiFont alloc_font(void)
ret
->
gmsize
=
INIT_GM_SIZE
;
ret
->
gm
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
ret
->
gmsize
*
sizeof
(
*
ret
->
gm
));
ret
->
next
=
NULL
;
ret
->
potm
=
NULL
;
ret
->
xform
.
eM11
=
ret
->
xform
.
eM22
=
1
.
0
;
return
ret
;
...
...
@@ -1507,6 +1507,7 @@ GdiFont WineEngCreateFontInstance(DC *dc, HFONT hfont)
BOOL
bd
,
it
,
can_use_bitmap
;
LOGFONTW
lf
;
CHARSETINFO
csi
;
struct
list
*
elem_ptr
;
if
(
!
GetObjectW
(
hfont
,
sizeof
(
lf
),
&
lf
))
return
NULL
;
can_use_bitmap
=
GetDeviceCaps
(
dc
->
hSelf
,
TEXTCAPS
)
&
TC_RA_ABLE
;
...
...
@@ -1517,7 +1518,8 @@ GdiFont WineEngCreateFontInstance(DC *dc, HFONT hfont)
lf
.
lfEscapement
);
/* check the cache first */
for
(
ret
=
GdiFontList
;
ret
;
ret
=
ret
->
next
)
{
LIST_FOR_EACH
(
elem_ptr
,
&
gdi_font_list
)
{
ret
=
LIST_ENTRY
(
elem_ptr
,
struct
tagGdiFont
,
entry
);
if
(
ret
->
hfont
==
hfont
&&
!
memcmp
(
&
ret
->
xform
,
&
dc
->
xformWorld2Vport
,
offsetof
(
XFORM
,
eDx
))
&&
(
can_use_bitmap
||
FT_IS_SCALABLE
(
ret
->
ft_face
)))
{
...
...
@@ -1702,19 +1704,19 @@ GdiFont WineEngCreateFontInstance(DC *dc, HFONT hfont)
TRACE
(
"caching: gdiFont=%p hfont=%p
\n
"
,
ret
,
hfont
);
ret
->
hfont
=
hfont
;
ret
->
aveWidth
=
lf
.
lfWidth
;
ret
->
next
=
GdiFontList
;
GdiFontList
=
ret
;
list_add_head
(
&
gdi_font_list
,
&
ret
->
entry
);
return
ret
;
}
static
void
DumpGdiFontL
ist
(
void
)
static
void
dump_gdi_font_l
ist
(
void
)
{
GdiFont
gdiFont
;
LOGFONTW
lf
;
struct
list
*
elem_ptr
;
TRACE
(
"---------- gdiFont Cache ----------
\n
"
);
for
(
gdiFont
=
GdiFontList
;
gdiFont
;
gdiFont
=
gdiFont
->
nex
t
)
{
LOGFONTW
lf
;
LIST_FOR_EACH
(
elem_ptr
,
&
gdi_font_lis
t
)
{
gdiFont
=
LIST_ENTRY
(
elem_ptr
,
struct
tagGdiFont
,
entry
)
;
GetObjectW
(
gdiFont
->
hfont
,
sizeof
(
lf
),
&
lf
);
TRACE
(
"gdiFont=%p hfont=%p (%s)
\n
"
,
gdiFont
,
gdiFont
->
hfont
,
debugstr_w
(
lf
.
lfFaceName
));
...
...
@@ -1730,29 +1732,21 @@ static void DumpGdiFontList(void)
BOOL
WineEngDestroyFontInstance
(
HFONT
handle
)
{
GdiFont
gdiFont
;
GdiFont
gdiPrev
=
NULL
;
BOOL
ret
=
FALSE
;
struct
list
*
elem_ptr
;
TRACE
(
"destroying hfont=%p
\n
"
,
handle
);
if
(
TRACE_ON
(
font
))
DumpGdiFontL
ist
();
dump_gdi_font_l
ist
();
gdiFont
=
GdiFontList
;
while
(
gdiFont
)
{
elem_ptr
=
list_head
(
&
gdi_font_list
);
while
(
elem_ptr
)
{
gdiFont
=
LIST_ENTRY
(
elem_ptr
,
struct
tagGdiFont
,
entry
);
elem_ptr
=
list_next
(
&
gdi_font_list
,
elem_ptr
);
if
(
gdiFont
->
hfont
==
handle
)
{
if
(
gdiPrev
)
{
gdiPrev
->
next
=
gdiFont
->
next
;
list_remove
(
&
gdiFont
->
entry
);
free_font
(
gdiFont
);
gdiFont
=
gdiPrev
->
next
;
}
else
{
GdiFontList
=
gdiFont
->
next
;
free_font
(
gdiFont
);
gdiFont
=
GdiFontList
;
}
ret
=
TRUE
;
}
else
{
gdiPrev
=
gdiFont
;
gdiFont
=
gdiFont
->
next
;
}
}
return
ret
;
...
...
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