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
3c9e7aba
Commit
3c9e7aba
authored
Dec 11, 2007
by
Aric Stewart
Committed by
Alexandre Julliard
Dec 13, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Cache font enum info.
Cache the enum info so that repeated calls to EnumFontFamiles and such does not have to repeatedly load the font file.
parent
67271dcf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
freetype.c
dlls/gdi32/freetype.c
+20
-0
No files found.
dlls/gdi32/freetype.c
View file @
3c9e7aba
...
...
@@ -259,6 +259,11 @@ typedef struct tagFace {
Bitmap_Size
size
;
/* set if face is a bitmap */
BOOL
external
;
/* TRUE if we should manually add this font to the registry */
struct
tagFamily
*
family
;
/* Cached data for Enum */
BOOL
cache_valid
;
ENUMLOGFONTEXW
elf
;
NEWTEXTMETRICEXW
ntm
;
DWORD
type
;
}
Face
;
typedef
struct
tagFamily
{
...
...
@@ -1234,6 +1239,7 @@ static INT AddFontToList(const char *file, void *font_data_ptr, DWORD font_data_
}
}
face
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
face
));
face
->
cache_valid
=
FALSE
;
list_add_tail
(
&
family
->
faces
,
&
face
->
entry
);
face
->
StyleName
=
StyleW
;
if
(
file
)
...
...
@@ -3253,6 +3259,15 @@ static void GetEnumStructs(Face *face, LPENUMLOGFONTEXW pelf,
GdiFont
*
font
=
alloc_font
();
LONG
width
,
height
;
if
(
face
->
cache_valid
)
{
TRACE
(
"Cached
\n
"
);
memcpy
(
pelf
,
&
face
->
elf
,
sizeof
(
ENUMLOGFONTEXW
));
memcpy
(
pntm
,
&
face
->
ntm
,
sizeof
(
NEWTEXTMETRICEXW
));
*
ptype
=
face
->
type
;
return
;
}
if
(
face
->
scalable
)
{
height
=
100
;
width
=
0
;
...
...
@@ -3348,6 +3363,11 @@ static void GetEnumStructs(Face *face, LPENUMLOGFONTEXW pelf,
pelf
->
elfScript
[
0
]
=
'\0'
;
/* This will get set in WineEngEnumFonts */
memcpy
(
&
face
->
elf
,
pelf
,
sizeof
(
ENUMLOGFONTEXW
));
memcpy
(
&
face
->
ntm
,
pntm
,
sizeof
(
NEWTEXTMETRICEXW
));
face
->
type
=
*
ptype
;
face
->
cache_valid
=
TRUE
;
free_font
(
font
);
}
...
...
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