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
eab02574
Commit
eab02574
authored
Mar 08, 2012
by
Kusanagi Kouichi
Committed by
Alexandre Julliard
Mar 13, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Simplify font replacement loading.
parent
4bb0e2d0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
22 deletions
+32
-22
freetype.c
dlls/gdi32/freetype.c
+32
-22
No files found.
dlls/gdi32/freetype.c
View file @
eab02574
...
...
@@ -281,6 +281,7 @@ typedef struct tagFamily {
const
WCHAR
*
FamilyName
;
const
WCHAR
*
EnglishName
;
struct
list
faces
;
struct
list
*
replacement
;
}
Family
;
typedef
struct
{
...
...
@@ -1323,6 +1324,7 @@ static void load_font_list_from_cache(HKEY hkey_font_cache)
family
->
FamilyName
=
strdupW
(
family_name
);
family
->
EnglishName
=
english_family
;
list_init
(
&
family
->
faces
);
family
->
replacement
=
&
family
->
faces
;
list_add_tail
(
&
font_list
,
&
family
->
entry
);
if
(
english_family
)
...
...
@@ -1540,6 +1542,7 @@ static void AddFaceToList(FT_Face ft_face, char *fake_family, const char *file,
family
->
FamilyName
=
strdupW
(
localised_family
?
localised_family
:
english_family
);
family
->
EnglishName
=
localised_family
?
strdupW
(
english_family
)
:
NULL
;
list_init
(
&
family
->
faces
);
family
->
replacement
=
&
family
->
faces
;
list_add_tail
(
&
font_list
,
&
family
->
entry
);
if
(
localised_family
)
{
...
...
@@ -1900,20 +1903,18 @@ static void LoadReplaceList(void)
if
(
!
find_family_from_any_name
(
value
))
{
/* Find the old family and hence all of the font files
in that family */
const
Family
*
const
family
=
find_family_from_any_name
(
data
);
Family
*
const
family
=
find_family_from_any_name
(
data
);
if
(
family
!=
NULL
)
{
const
struct
list
*
face_elem_ptr
;
LIST_FOR_EACH
(
face_elem_ptr
,
&
family
->
faces
)
{
const
Face
*
const
face
=
LIST_ENTRY
(
face_elem_ptr
,
Face
,
entry
);
TRACE
(
"mapping %s
%s to %s
\n
"
,
debugstr_w
(
family
->
FamilyName
),
debugstr_w
(
face
->
StyleName
),
familyA
);
/* Now add a new entry with the new family name */
AddFontToList
(
face
->
file
,
face
->
font_data_ptr
,
face
->
font_data_size
,
familyA
,
family
->
FamilyName
,
ADDFONT_FORCE_BITMAP
|
(
face
->
external
?
ADDFONT_EXTERNAL_FONT
:
0
)
);
Family
*
const
new_family
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
new_family
))
;
if
(
new_family
!=
NULL
)
{
TRACE
(
"mapping %s
to %s
\n
"
,
debugstr_w
(
data
),
debugstr_w
(
value
));
new_family
->
FamilyName
=
strdupW
(
value
);
new_family
->
EnglishName
=
NULL
;
list_init
(
&
new_family
->
faces
);
new_family
->
replacement
=
&
family
->
faces
;
list_add_tail
(
&
font_list
,
&
new_family
->
entry
);
}
}
else
...
...
@@ -1991,7 +1992,10 @@ static SYSTEM_LINKS *find_font_link(const WCHAR *name)
static
const
struct
list
*
get_face_list_from_family
(
const
Family
*
family
)
{
return
&
family
->
faces
;
if
(
!
list_empty
(
&
family
->
faces
))
return
&
family
->
faces
;
else
return
family
->
replacement
;
}
static
void
populate_system_links
(
const
WCHAR
*
name
,
const
WCHAR
*
const
*
values
)
...
...
@@ -4674,24 +4678,24 @@ static BOOL family_matches(Family *family, const LOGFONTW *lf)
return
FALSE
;
}
static
BOOL
face_matches
(
Face
*
face
,
const
LOGFONTW
*
lf
)
static
BOOL
face_matches
(
const
WCHAR
*
family_name
,
Face
*
face
,
const
LOGFONTW
*
lf
)
{
WCHAR
full_family_name
[
LF_FULLFACESIZE
];
if
(
!
strcmpiW
(
lf
->
lfFaceName
,
fa
ce
->
family
->
FamilyN
ame
))
return
TRUE
;
if
(
!
strcmpiW
(
lf
->
lfFaceName
,
fa
mily_n
ame
))
return
TRUE
;
if
(
strlenW
(
fa
ce
->
family
->
FamilyN
ame
)
+
strlenW
(
face
->
StyleName
)
+
2
>
LF_FULLFACESIZE
)
if
(
strlenW
(
fa
mily_n
ame
)
+
strlenW
(
face
->
StyleName
)
+
2
>
LF_FULLFACESIZE
)
{
FIXME
(
"Length of %s + %s + 2 is longer than LF_FULLFACESIZE
\n
"
,
debugstr_w
(
fa
ce
->
family
->
FamilyN
ame
),
debugstr_w
(
face
->
StyleName
));
debugstr_w
(
fa
mily_n
ame
),
debugstr_w
(
face
->
StyleName
));
return
FALSE
;
}
create_full_name
(
full_family_name
,
fa
ce
->
family
->
FamilyN
ame
,
face
->
StyleName
);
create_full_name
(
full_family_name
,
fa
mily_n
ame
,
face
->
StyleName
);
return
!
strcmpiW
(
lf
->
lfFaceName
,
full_family_name
);
}
static
BOOL
enum_face_charsets
(
Face
*
face
,
struct
enum_charset_list
*
list
,
static
BOOL
enum_face_charsets
(
const
Family
*
family
,
Face
*
face
,
struct
enum_charset_list
*
list
,
FONTENUMPROCW
proc
,
LPARAM
lparam
)
{
ENUMLOGFONTEXW
elf
;
...
...
@@ -4713,6 +4717,12 @@ static BOOL enum_face_charsets(Face *face, struct enum_charset_list *list,
if
(
!
elf
.
elfScript
[
0
])
FIXME
(
"Unknown elfscript for bit %d
\n
"
,
ffs
(
list
->
element
[
i
].
mask
)
-
1
);
}
/* Font Replacement */
if
(
family
!=
face
->
family
)
{
strcpyW
(
elf
.
elfLogFont
.
lfFaceName
,
family
->
FamilyName
);
create_full_name
(
elf
.
elfFullName
,
family
->
FamilyName
,
face
->
StyleName
);
}
TRACE
(
"enuming face %s full %s style %s charset = %d type %d script %s it %d weight %d ntmflags %08x
\n
"
,
debugstr_w
(
elf
.
elfLogFont
.
lfFaceName
),
debugstr_w
(
elf
.
elfFullName
),
debugstr_w
(
elf
.
elfStyle
),
...
...
@@ -4770,8 +4780,8 @@ static BOOL freetype_EnumFonts( PHYSDEV dev, LPLOGFONTW plf, FONTENUMPROCW proc,
face_list
=
get_face_list_from_family
(
family
);
LIST_FOR_EACH
(
face_elem_ptr
,
face_list
)
{
face
=
LIST_ENTRY
(
face_elem_ptr
,
Face
,
entry
);
if
(
!
face_matches
(
face
,
plf
))
continue
;
if
(
!
enum_face_charsets
(
face
,
&
enum_charsets
,
proc
,
lparam
))
return
FALSE
;
if
(
!
face_matches
(
fa
mily
->
FamilyName
,
fa
ce
,
plf
))
continue
;
if
(
!
enum_face_charsets
(
fa
mily
,
fa
ce
,
&
enum_charsets
,
proc
,
lparam
))
return
FALSE
;
}
}
}
...
...
@@ -4781,7 +4791,7 @@ static BOOL freetype_EnumFonts( PHYSDEV dev, LPLOGFONTW plf, FONTENUMPROCW proc,
face_list
=
get_face_list_from_family
(
family
);
face_elem_ptr
=
list_head
(
face_list
);
face
=
LIST_ENTRY
(
face_elem_ptr
,
Face
,
entry
);
if
(
!
enum_face_charsets
(
face
,
&
enum_charsets
,
proc
,
lparam
))
return
FALSE
;
if
(
!
enum_face_charsets
(
fa
mily
,
fa
ce
,
&
enum_charsets
,
proc
,
lparam
))
return
FALSE
;
}
}
LeaveCriticalSection
(
&
freetype_cs
);
...
...
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