Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
6a404a3b
Commit
6a404a3b
authored
Apr 01, 2011
by
Akihiro Sagawa
Committed by
Alexandre Julliard
Apr 04, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Move charset enumeration to helper function.
parent
a9c9970d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
78 deletions
+47
-78
freetype.c
dlls/gdi32/freetype.c
+47
-78
No files found.
dlls/gdi32/freetype.c
View file @
6a404a3b
...
...
@@ -4101,6 +4101,51 @@ static BOOL face_matches(Face *face, const LOGFONTW *lf)
return
!
strcmpiW
(
lf
->
lfFaceName
,
full_family_name
);
}
static
BOOL
enum_face_charsets
(
Face
*
face
,
FONTENUMPROCW
proc
,
LPARAM
lparam
)
{
ENUMLOGFONTEXW
elf
;
NEWTEXTMETRICEXW
ntm
;
DWORD
type
=
0
;
FONTSIGNATURE
fs
;
CHARSETINFO
csi
;
int
i
;
GetEnumStructs
(
face
,
&
elf
,
&
ntm
,
&
type
);
for
(
i
=
0
;
i
<
32
;
i
++
)
{
if
(
!
face
->
scalable
&&
face
->
fs
.
fsCsb
[
0
]
==
0
)
{
/* OEM bitmap */
elf
.
elfLogFont
.
lfCharSet
=
ntm
.
ntmTm
.
tmCharSet
=
OEM_CHARSET
;
strcpyW
(
elf
.
elfScript
,
OEM_DOSW
);
i
=
32
;
/* break out of loop */
}
else
if
(
!
(
face
->
fs
.
fsCsb
[
0
]
&
(
1L
<<
i
)))
continue
;
else
{
fs
.
fsCsb
[
0
]
=
1L
<<
i
;
fs
.
fsCsb
[
1
]
=
0
;
if
(
!
TranslateCharsetInfo
(
fs
.
fsCsb
,
&
csi
,
TCI_SRCFONTSIG
))
csi
.
ciCharset
=
DEFAULT_CHARSET
;
if
(
i
==
31
)
csi
.
ciCharset
=
SYMBOL_CHARSET
;
if
(
csi
.
ciCharset
!=
DEFAULT_CHARSET
)
{
elf
.
elfLogFont
.
lfCharSet
=
ntm
.
ntmTm
.
tmCharSet
=
csi
.
ciCharset
;
if
(
ElfScriptsW
[
i
])
strcpyW
(
elf
.
elfScript
,
ElfScriptsW
[
i
]);
else
FIXME
(
"Unknown elfscript for bit %d
\n
"
,
i
);
}
}
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
),
csi
.
ciCharset
,
type
,
debugstr_w
(
elf
.
elfScript
),
elf
.
elfLogFont
.
lfItalic
,
elf
.
elfLogFont
.
lfWeight
,
ntm
.
ntmTm
.
ntmFlags
);
/* release section before callback (FIXME) */
LeaveCriticalSection
(
&
freetype_cs
);
if
(
!
proc
(
&
elf
.
elfLogFont
,
(
TEXTMETRICW
*
)
&
ntm
,
type
,
lparam
))
return
FALSE
;
EnterCriticalSection
(
&
freetype_cs
);
}
return
TRUE
;
}
/*************************************************************
* WineEngEnumFonts
*
...
...
@@ -4110,13 +4155,7 @@ DWORD WineEngEnumFonts(LPLOGFONTW plf, FONTENUMPROCW proc, LPARAM lparam)
Family
*
family
;
Face
*
face
;
struct
list
*
family_elem_ptr
,
*
face_elem_ptr
;
ENUMLOGFONTEXW
elf
;
NEWTEXTMETRICEXW
ntm
;
DWORD
type
;
FONTSIGNATURE
fs
;
CHARSETINFO
csi
;
LOGFONTW
lf
;
int
i
;
if
(
!
plf
)
{
...
...
@@ -4147,44 +4186,8 @@ DWORD WineEngEnumFonts(LPLOGFONTW plf, FONTENUMPROCW proc, LPARAM lparam)
if
(
family_matches
(
family
,
plf
))
{
LIST_FOR_EACH
(
face_elem_ptr
,
&
family
->
faces
)
{
face
=
LIST_ENTRY
(
face_elem_ptr
,
Face
,
entry
);
if
(
!
face_matches
(
face
,
plf
))
continue
;
GetEnumStructs
(
face
,
&
elf
,
&
ntm
,
&
type
);
for
(
i
=
0
;
i
<
32
;
i
++
)
{
if
(
!
face
->
scalable
&&
face
->
fs
.
fsCsb
[
0
]
==
0
)
{
/* OEM bitmap */
elf
.
elfLogFont
.
lfCharSet
=
ntm
.
ntmTm
.
tmCharSet
=
OEM_CHARSET
;
strcpyW
(
elf
.
elfScript
,
OEM_DOSW
);
i
=
32
;
/* break out of loop */
}
else
if
(
!
(
face
->
fs
.
fsCsb
[
0
]
&
(
1L
<<
i
)))
continue
;
else
{
fs
.
fsCsb
[
0
]
=
1L
<<
i
;
fs
.
fsCsb
[
1
]
=
0
;
if
(
!
TranslateCharsetInfo
(
fs
.
fsCsb
,
&
csi
,
TCI_SRCFONTSIG
))
csi
.
ciCharset
=
DEFAULT_CHARSET
;
if
(
i
==
31
)
csi
.
ciCharset
=
SYMBOL_CHARSET
;
if
(
csi
.
ciCharset
!=
DEFAULT_CHARSET
)
{
elf
.
elfLogFont
.
lfCharSet
=
ntm
.
ntmTm
.
tmCharSet
=
csi
.
ciCharset
;
if
(
ElfScriptsW
[
i
])
strcpyW
(
elf
.
elfScript
,
ElfScriptsW
[
i
]);
else
FIXME
(
"Unknown elfscript for bit %d
\n
"
,
i
);
}
}
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
),
csi
.
ciCharset
,
type
,
debugstr_w
(
elf
.
elfScript
),
elf
.
elfLogFont
.
lfItalic
,
elf
.
elfLogFont
.
lfWeight
,
ntm
.
ntmTm
.
ntmFlags
);
/* release section before callback (FIXME) */
LeaveCriticalSection
(
&
freetype_cs
);
if
(
!
proc
(
&
elf
.
elfLogFont
,
(
TEXTMETRICW
*
)
&
ntm
,
type
,
lparam
))
return
0
;
EnterCriticalSection
(
&
freetype_cs
);
}
if
(
!
enum_face_charsets
(
face
,
proc
,
lparam
))
return
0
;
}
}
}
...
...
@@ -4193,41 +4196,7 @@ DWORD WineEngEnumFonts(LPLOGFONTW plf, FONTENUMPROCW proc, LPARAM lparam)
family
=
LIST_ENTRY
(
family_elem_ptr
,
Family
,
entry
);
face_elem_ptr
=
list_head
(
&
family
->
faces
);
face
=
LIST_ENTRY
(
face_elem_ptr
,
Face
,
entry
);
GetEnumStructs
(
face
,
&
elf
,
&
ntm
,
&
type
);
for
(
i
=
0
;
i
<
32
;
i
++
)
{
if
(
!
face
->
scalable
&&
face
->
fs
.
fsCsb
[
0
]
==
0
)
{
/* OEM bitmap */
elf
.
elfLogFont
.
lfCharSet
=
ntm
.
ntmTm
.
tmCharSet
=
OEM_CHARSET
;
strcpyW
(
elf
.
elfScript
,
OEM_DOSW
);
i
=
32
;
/* break out of loop */
}
else
if
(
!
(
face
->
fs
.
fsCsb
[
0
]
&
(
1L
<<
i
)))
continue
;
else
{
fs
.
fsCsb
[
0
]
=
1L
<<
i
;
fs
.
fsCsb
[
1
]
=
0
;
if
(
!
TranslateCharsetInfo
(
fs
.
fsCsb
,
&
csi
,
TCI_SRCFONTSIG
))
csi
.
ciCharset
=
DEFAULT_CHARSET
;
if
(
i
==
31
)
csi
.
ciCharset
=
SYMBOL_CHARSET
;
if
(
csi
.
ciCharset
!=
DEFAULT_CHARSET
)
{
elf
.
elfLogFont
.
lfCharSet
=
ntm
.
ntmTm
.
tmCharSet
=
csi
.
ciCharset
;
if
(
ElfScriptsW
[
i
])
strcpyW
(
elf
.
elfScript
,
ElfScriptsW
[
i
]);
else
FIXME
(
"Unknown elfscript for bit %d
\n
"
,
i
);
}
}
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
),
csi
.
ciCharset
,
type
,
debugstr_w
(
elf
.
elfScript
),
elf
.
elfLogFont
.
lfItalic
,
elf
.
elfLogFont
.
lfWeight
,
ntm
.
ntmTm
.
ntmFlags
);
/* release section before callback (FIXME) */
LeaveCriticalSection
(
&
freetype_cs
);
if
(
!
proc
(
&
elf
.
elfLogFont
,
(
TEXTMETRICW
*
)
&
ntm
,
type
,
lparam
))
return
0
;
EnterCriticalSection
(
&
freetype_cs
);
}
if
(
!
enum_face_charsets
(
face
,
proc
,
lparam
))
return
0
;
}
}
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