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
aa251769
Commit
aa251769
authored
Apr 10, 2006
by
Huw Davies
Committed by
Alexandre Julliard
Apr 10, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Add support for ttc indices in the font link list.
parent
3f591ecb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
19 deletions
+17
-19
freetype.c
dlls/gdi/freetype.c
+17
-19
No files found.
dlls/gdi/freetype.c
View file @
aa251769
...
...
@@ -443,20 +443,22 @@ static inline FT_Fixed FT_FixedFromFIXED(FIXED f)
}
static
Face
*
find_face_from_filename
(
const
WCHAR
*
name
)
static
Face
*
find_face_from_filename
(
const
WCHAR
*
file_name
,
const
WCHAR
*
face_
name
)
{
Family
*
family
;
Face
*
face
;
char
*
file
;
DWORD
len
=
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
name
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
char
*
nameA
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
DWORD
len
=
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
file_
name
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
char
*
file_
nameA
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
Face
*
ret
=
NULL
;
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
name
,
-
1
,
nameA
,
len
,
NULL
,
NULL
);
TRACE
(
"looking for
%s
\n
"
,
debugstr_a
(
nameA
));
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
file_name
,
-
1
,
file_
nameA
,
len
,
NULL
,
NULL
);
TRACE
(
"looking for
file %s name %s
\n
"
,
debugstr_a
(
file_nameA
),
debugstr_w
(
face_name
));
LIST_FOR_EACH_ENTRY
(
family
,
&
font_list
,
Family
,
entry
)
{
if
(
face_name
&&
strcmpiW
(
face_name
,
family
->
FamilyName
))
continue
;
LIST_FOR_EACH_ENTRY
(
face
,
&
family
->
faces
,
Face
,
entry
)
{
file
=
strrchr
(
face
->
file
,
'/'
);
...
...
@@ -464,12 +466,12 @@ static Face *find_face_from_filename(const WCHAR *name)
file
=
face
->
file
;
else
file
++
;
if
(
!
strcmp
(
file
,
nameA
))
if
(
!
strcmp
(
file
,
file_
nameA
))
ret
=
face
;
break
;
}
}
HeapFree
(
GetProcessHeap
(),
0
,
nameA
);
HeapFree
(
GetProcessHeap
(),
0
,
file_
nameA
);
return
ret
;
}
...
...
@@ -1041,7 +1043,6 @@ static BOOL init_system_links(void)
for
(
entry
=
data
;
(
char
*
)
entry
<
(
char
*
)
data
+
data_len
&&
*
entry
!=
0
;
entry
=
next
)
{
WCHAR
*
face_name
;
INT
index
;
CHILD_FONT
*
child_font
;
TRACE
(
"
\t
%s
\n
"
,
debugstr_w
(
entry
));
...
...
@@ -1049,30 +1050,26 @@ static BOOL init_system_links(void)
next
=
entry
+
strlenW
(
entry
)
+
1
;
face_name
=
strchrW
(
entry
,
','
);
if
(
!
face_name
)
index
=
0
;
else
if
(
face_name
)
{
FIXME
(
"don't yet handle ttc's correctly in linking. Assuming index 0
\n
"
);
*
face_name
++
=
0
;
while
(
isspaceW
(
*
face_name
))
face_name
++
;
index
=
0
;
}
face
=
find_face_from_filename
(
entry
);
face
=
find_face_from_filename
(
entry
,
face_name
);
if
(
!
face
)
{
TRACE
(
"Unable to find file %s
\n
"
,
debugstr_w
(
entry
));
TRACE
(
"Unable to find file %s
face name %s
\n
"
,
debugstr_w
(
entry
),
debugstr_w
(
face_name
));
continue
;
}
child_font
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
child_font
));
child_font
->
file_name
=
strdupA
(
face
->
file
);
child_font
->
index
=
index
;
child_font
->
index
=
face
->
face_
index
;
child_font
->
font
=
NULL
;
fs
.
fsCsb
[
0
]
|=
face
->
fs
.
fsCsb
[
0
];
fs
.
fsCsb
[
1
]
|=
face
->
fs
.
fsCsb
[
1
];
TRACE
(
"Adding file %s index %d
\n
"
,
child_font
->
file_name
,
child_font
->
index
);
list_add_tail
(
&
font_link
->
links
,
&
child_font
->
entry
);
}
family
=
find_family_from_name
(
font_link
->
font_name
);
...
...
@@ -1100,13 +1097,14 @@ static BOOL init_system_links(void)
system_font_link
->
font_name
=
strdupW
(
System
);
list_init
(
&
system_font_link
->
links
);
face
=
find_face_from_filename
(
tahoma_ttf
);
face
=
find_face_from_filename
(
tahoma_ttf
,
Tahoma
);
if
(
face
)
{
child_font
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
child_font
));
child_font
->
file_name
=
strdupA
(
face
->
file
);
child_font
->
index
=
0
;
child_font
->
index
=
face
->
face_index
;
child_font
->
font
=
NULL
;
TRACE
(
"Found Tahoma in %s index %d
\n
"
,
child_font
->
file_name
,
child_font
->
index
);
list_add_tail
(
&
system_font_link
->
links
,
&
child_font
->
entry
);
}
LIST_FOR_EACH_ENTRY
(
font_link
,
&
system_links
,
SYSTEM_LINKS
,
entry
)
...
...
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