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
d3cdec0e
Commit
d3cdec0e
authored
Oct 16, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 16, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Use better integer types for cmap helpers.
parent
9b46e19a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
20 deletions
+20
-20
dwrite_private.h
dlls/dwrite/dwrite_private.h
+1
-1
font.c
dlls/dwrite/font.c
+2
-3
opentype.c
dlls/dwrite/opentype.c
+17
-16
No files found.
dlls/dwrite/dwrite_private.h
View file @
d3cdec0e
...
...
@@ -108,7 +108,7 @@ extern HRESULT font_create_fontface(IDWriteFactory *iface, DWRITE_FONT_FACE_TYPE
/* Opentype font table functions */
extern
HRESULT
opentype_analyze_font
(
IDWriteFontFileStream
*
,
UINT32
*
,
DWRITE_FONT_FILE_TYPE
*
,
DWRITE_FONT_FACE_TYPE
*
,
BOOL
*
)
DECLSPEC_HIDDEN
;
extern
HRESULT
opentype_get_font_table
(
IDWriteFontFileStream
*
,
DWRITE_FONT_FACE_TYPE
,
UINT32
,
UINT32
,
const
void
**
,
void
**
,
UINT32
*
,
BOOL
*
)
DECLSPEC_HIDDEN
;
extern
VOID
OpenType_CMAP_GetGlyphIndex
(
LPVOID
data
,
DWORD
utf32c
,
LPWORD
pgi
,
DWORD
flags
)
DECLSPEC_HIDDEN
;
extern
void
opentype_cmap_get_glyphindex
(
void
*
,
UINT32
,
UINT16
*
)
DECLSPEC_HIDDEN
;
extern
VOID
get_font_properties
(
LPCVOID
os2
,
LPCVOID
head
,
LPCVOID
post
,
DWRITE_FONT_METRICS
*
metrics
,
DWRITE_FONT_STRETCH
*
stretch
,
DWRITE_FONT_WEIGHT
*
weight
,
DWRITE_FONT_STYLE
*
style
)
DECLSPEC_HIDDEN
;
extern
HRESULT
bidi_computelevels
(
const
WCHAR
*
,
UINT32
,
UINT8
,
UINT8
*
,
UINT8
*
);
...
...
dlls/dwrite/font.c
View file @
d3cdec0e
...
...
@@ -391,9 +391,8 @@ static HRESULT WINAPI dwritefontface_GetGlyphIndices(IDWriteFontFace2 *iface, UI
}
for
(
i
=
0
;
i
<
count
;
i
++
)
{
OpenType_CMAP_GetGlyphIndex
(
This
->
cmap
.
data
,
codepoints
[
i
],
&
glyph_indices
[
i
],
0
);
}
opentype_cmap_get_glyphindex
(
This
->
cmap
.
data
,
codepoints
[
i
],
&
glyph_indices
[
i
]);
return
S_OK
;
}
}
...
...
dlls/dwrite/opentype.c
View file @
d3cdec0e
...
...
@@ -96,6 +96,12 @@ typedef struct {
WORD
endCode
[
1
];
}
CMAP_SegmentMapping_0
;
enum
OPENTYPE_CMAP_TABLE_FORMAT
{
OPENTYPE_CMAP_TABLE_SEGMENT_MAPPING
=
4
,
OPENTYPE_CMAP_TABLE_SEGMENTED_COVERAGE
=
12
};
/* PANOSE is 10 bytes in size, need to pack the structure properly */
#include "pshpack2.h"
typedef
struct
...
...
@@ -301,7 +307,7 @@ static int compare_group(const void *a, const void* b)
return
0
;
}
static
void
CMAP4_GetGlyphIndex
(
CMAP_SegmentMapping_0
*
format
,
DWORD
utf32c
,
LPWORD
pgi
)
static
void
CMAP4_GetGlyphIndex
(
CMAP_SegmentMapping_0
*
format
,
UINT32
utf32c
,
UINT16
*
pgi
)
{
WORD
*
startCode
;
SHORT
*
idDelta
;
...
...
@@ -340,9 +346,9 @@ static void CMAP4_GetGlyphIndex(CMAP_SegmentMapping_0* format, DWORD utf32c, LPW
}
}
static
void
CMAP12_GetGlyphIndex
(
CMAP_SegmentedCoverage
*
format
,
DWORD
utf32c
,
LPWORD
pgi
)
static
void
CMAP12_GetGlyphIndex
(
CMAP_SegmentedCoverage
*
format
,
UINT32
utf32c
,
UINT16
*
pgi
)
{
CMAP_SegmentedCoverage_group
*
group
=
NULL
;
CMAP_SegmentedCoverage_group
*
group
;
group
=
bsearch
(
&
utf32c
,
format
->
groups
,
GET_BE_DWORD
(
format
->
nGroups
),
sizeof
(
CMAP_SegmentedCoverage_group
),
compare_group
);
...
...
@@ -354,17 +360,12 @@ static void CMAP12_GetGlyphIndex(CMAP_SegmentedCoverage* format, DWORD utf32c, L
}
}
VOID
OpenType_CMAP_GetGlyphIndex
(
LPVOID
data
,
DWORD
utf32c
,
LPWORD
pgi
,
DWORD
flags
)
void
opentype_cmap_get_glyphindex
(
void
*
data
,
UINT32
utf32c
,
UINT16
*
pgi
)
{
CMAP_Header
*
CMAP_Table
=
data
;
int
i
;
CMAP_Header
*
CMAP_Table
=
NULL
;
if
(
flags
&
GGI_MARK_NONEXISTING_GLYPHS
)
*
pgi
=
0xffff
;
else
*
pgi
=
0
;
CMAP_Table
=
data
;
*
pgi
=
0
;
for
(
i
=
0
;
i
<
GET_BE_WORD
(
CMAP_Table
->
numTables
);
i
++
)
{
...
...
@@ -376,18 +377,18 @@ VOID OpenType_CMAP_GetGlyphIndex(LPVOID data, DWORD utf32c, LPWORD pgi, DWORD fl
table
=
(
WORD
*
)(((
BYTE
*
)
CMAP_Table
)
+
GET_BE_DWORD
(
CMAP_Table
->
tables
[
i
].
offset
));
type
=
GET_BE_WORD
(
*
table
);
TRACE
(
"
T
ype %i
\n
"
,
type
);
TRACE
(
"
table t
ype %i
\n
"
,
type
);
/* Break when we find a handled type */
switch
(
type
)
switch
(
type
)
{
case
4
:
case
OPENTYPE_CMAP_TABLE_SEGMENT_MAPPING
:
CMAP4_GetGlyphIndex
((
CMAP_SegmentMapping_0
*
)
table
,
utf32c
,
pgi
);
break
;
case
12
:
case
OPENTYPE_CMAP_TABLE_SEGMENTED_COVERAGE
:
CMAP12_GetGlyphIndex
((
CMAP_SegmentedCoverage
*
)
table
,
utf32c
,
pgi
);
break
;
default:
TRACE
(
"
T
ype %i unhandled.
\n
"
,
type
);
TRACE
(
"
table t
ype %i unhandled.
\n
"
,
type
);
}
}
}
...
...
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