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
9581b2df
Commit
9581b2df
authored
Feb 03, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Cache the codepage tables also for OpenType names mapping.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0ec38429
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
16 deletions
+18
-16
freetype.c
dlls/gdi32/freetype.c
+18
-16
No files found.
dlls/gdi32/freetype.c
View file @
9581b2df
...
...
@@ -714,21 +714,27 @@ static const LANGID mac_langid_table[] =
MAKELANGID
(
LANG_AZERI
,
SUBLANG_AZERI_LATIN
),
/* TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT */
};
static
CPTABLEINFO
*
get_
mac_code_page
(
const
FT_SfntName
*
name
)
static
CPTABLEINFO
*
get_
cptable
(
WORD
cp
)
{
static
CPTABLEINFO
tables
[
100
];
int
id
=
name
->
encoding_id
;
unsigned
int
i
;
USHORT
*
ptr
;
SIZE_T
size
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
tables
)
&&
tables
[
i
].
CodePage
;
i
++
)
if
(
tables
[
i
].
CodePage
==
cp
)
return
&
tables
[
i
];
if
(
NtGetNlsSectionPtr
(
11
,
cp
,
NULL
,
(
void
**
)
&
ptr
,
&
size
))
return
NULL
;
if
(
i
==
ARRAY_SIZE
(
tables
))
ERR
(
"too many code pages
\n
"
);
RtlInitCodePageTable
(
ptr
,
&
tables
[
i
]
);
return
&
tables
[
i
];
}
static
CPTABLEINFO
*
get_mac_code_page
(
const
FT_SfntName
*
name
)
{
int
id
=
name
->
encoding_id
;
if
(
name
->
encoding_id
==
TT_MAC_ID_SIMPLIFIED_CHINESE
)
id
=
8
;
/* special case */
if
(
id
>=
ARRAY_SIZE
(
tables
))
return
NULL
;
if
(
!
tables
[
id
].
CodePage
)
{
if
(
NtGetNlsSectionPtr
(
11
,
10000
+
id
,
NULL
,
(
void
**
)
&
ptr
,
&
size
))
return
NULL
;
RtlInitCodePageTable
(
ptr
,
&
tables
[
id
]
);
}
return
&
tables
[
id
];
return
get_cptable
(
10000
+
id
);
}
static
int
match_name_table_language
(
const
FT_SfntName
*
name
,
LANGID
lang
)
...
...
@@ -1144,9 +1150,6 @@ static BOOL search_face_name_callback( LANGID langid, struct opentype_name *name
static
WCHAR
*
decode_opentype_name
(
struct
opentype_name
*
name
)
{
CPTABLEINFO
codepage_info
;
USHORT
*
codepage_ptr
;
SIZE_T
codepage_size
;
WCHAR
buffer
[
512
];
DWORD
len
;
...
...
@@ -1158,11 +1161,10 @@ static WCHAR *decode_opentype_name( struct opentype_name *name )
}
else
{
NtGetNlsSectionPtr
(
11
,
name
->
codepage
,
NULL
,
(
void
**
)
&
codepage_ptr
,
&
codepage_siz
e
);
RtlInitCodePageTable
(
codepage_ptr
,
&
codepage_info
)
;
RtlCustomCPToUnicodeN
(
&
codepage_info
,
buffer
,
sizeof
(
buffer
),
&
len
,
name
->
bytes
,
name
->
length
);
CPTABLEINFO
*
cptable
=
get_cptable
(
name
->
codepag
e
);
if
(
!
cptable
)
return
NULL
;
RtlCustomCPToUnicodeN
(
cptable
,
buffer
,
sizeof
(
buffer
),
&
len
,
name
->
bytes
,
name
->
length
);
len
/=
sizeof
(
WCHAR
);
NtUnmapViewOfSection
(
GetCurrentProcess
(),
codepage_ptr
);
}
buffer
[
ARRAY_SIZE
(
buffer
)
-
1
]
=
0
;
...
...
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