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
c4d08275
Commit
c4d08275
authored
Jul 06, 2016
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 07, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Check all 'vert' lookups, not just the first one.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c52fa73a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
64 deletions
+65
-64
opentype.c
dlls/dwrite/opentype.c
+34
-32
font.c
dlls/dwrite/tests/font.c
+31
-32
No files found.
dlls/dwrite/opentype.c
View file @
c4d08275
...
...
@@ -1954,7 +1954,7 @@ BOOL opentype_has_vertical_variants(IDWriteFontFace3 *fontface)
for
(
i
=
0
;
i
<
GET_BE_WORD
(
featurelist
->
FeatureCount
);
i
++
)
{
if
(
*
(
UINT32
*
)
featurelist
->
FeatureRecord
[
i
].
FeatureTag
==
DWRITE_FONT_FEATURE_TAG_VERTICAL_WRITING
)
{
const
OT_Feature
*
feature
=
(
const
OT_Feature
*
)((
BYTE
*
)
featurelist
+
GET_BE_WORD
(
featurelist
->
FeatureRecord
[
i
].
Feature
));
UINT16
lookup_count
=
GET_BE_WORD
(
feature
->
LookupCount
),
index
,
count
,
type
;
UINT16
lookup_count
=
GET_BE_WORD
(
feature
->
LookupCount
),
i
,
i
ndex
,
count
,
type
;
const
GSUB_SingleSubstFormat2
*
subst2
;
const
OT_LookupTable
*
lookup_table
;
UINT32
offset
;
...
...
@@ -1962,40 +1962,42 @@ BOOL opentype_has_vertical_variants(IDWriteFontFace3 *fontface)
if
(
lookup_count
==
0
)
continue
;
/* check if lookup is empty */
index
=
GET_BE_WORD
(
feature
->
LookupListIndex
[
0
]);
lookup_table
=
(
const
OT_LookupTable
*
)((
BYTE
*
)
lookup_list
+
GET_BE_WORD
(
lookup_list
->
Lookup
[
index
]));
type
=
GET_BE_WORD
(
lookup_table
->
LookupType
);
if
(
type
!=
OPENTYPE_GPOS_SINGLE_SUBST
&&
type
!=
OPENTYPE_GPOS_EXTENSION_SUBST
)
continue
;
count
=
GET_BE_WORD
(
lookup_table
->
SubTableCount
);
if
(
count
==
0
)
continue
;
offset
=
GET_BE_WORD
(
lookup_table
->
SubTable
[
0
]);
if
(
type
==
OPENTYPE_GPOS_EXTENSION_SUBST
)
{
const
GSUB_ExtensionPosFormat1
*
ext
=
(
const
GSUB_ExtensionPosFormat1
*
)((
const
BYTE
*
)
lookup_table
+
offset
);
if
(
GET_BE_WORD
(
ext
->
SubstFormat
)
==
1
)
offset
+=
GET_BE_DWORD
(
ext
->
ExtensionOffset
);
else
FIXME
(
"Unhandled Extension Substitution Format %u
\n
"
,
GET_BE_WORD
(
ext
->
SubstFormat
));
}
for
(
i
=
0
;
i
<
lookup_count
;
i
++
)
{
/* check if lookup is empty */
index
=
GET_BE_WORD
(
feature
->
LookupListIndex
[
i
]);
lookup_table
=
(
const
OT_LookupTable
*
)((
BYTE
*
)
lookup_list
+
GET_BE_WORD
(
lookup_list
->
Lookup
[
index
]));
type
=
GET_BE_WORD
(
lookup_table
->
LookupType
);
if
(
type
!=
OPENTYPE_GPOS_SINGLE_SUBST
&&
type
!=
OPENTYPE_GPOS_EXTENSION_SUBST
)
continue
;
count
=
GET_BE_WORD
(
lookup_table
->
SubTableCount
);
if
(
count
==
0
)
continue
;
offset
=
GET_BE_WORD
(
lookup_table
->
SubTable
[
0
]);
if
(
type
==
OPENTYPE_GPOS_EXTENSION_SUBST
)
{
const
GSUB_ExtensionPosFormat1
*
ext
=
(
const
GSUB_ExtensionPosFormat1
*
)((
const
BYTE
*
)
lookup_table
+
offset
);
if
(
GET_BE_WORD
(
ext
->
SubstFormat
)
==
1
)
offset
+=
GET_BE_DWORD
(
ext
->
ExtensionOffset
);
else
FIXME
(
"Unhandled Extension Substitution Format %u
\n
"
,
GET_BE_WORD
(
ext
->
SubstFormat
));
}
subst2
=
(
const
GSUB_SingleSubstFormat2
*
)((
BYTE
*
)
lookup_table
+
offset
);
index
=
GET_BE_WORD
(
subst2
->
SubstFormat
);
if
(
index
==
1
)
FIXME
(
"Validate Single Substitution Format 1
\n
"
);
else
if
(
index
==
2
)
{
/* SimSun-ExtB has 0 glyph count for this substitution */
if
(
GET_BE_WORD
(
subst2
->
GlyphCount
)
>
0
)
{
ret
=
TRUE
;
break
;
subst2
=
(
const
GSUB_SingleSubstFormat2
*
)((
BYTE
*
)
lookup_table
+
offset
);
index
=
GET_BE_WORD
(
subst2
->
SubstFormat
);
if
(
index
==
1
)
FIXME
(
"Validate Single Substitution Format 1
\n
"
);
else
if
(
index
==
2
)
{
/* SimSun-ExtB has 0 glyph count for this substitution */
if
(
GET_BE_WORD
(
subst2
->
GlyphCount
)
>
0
)
{
ret
=
TRUE
;
break
;
}
}
else
WARN
(
"Unknown Single Substitution Format, %u
\n
"
,
index
);
}
else
WARN
(
"Unknown Single Substitution Format, %u
\n
"
,
index
);
}
}
...
...
dlls/dwrite/tests/font.c
View file @
c4d08275
...
...
@@ -6381,7 +6381,7 @@ static BOOL has_vertical_glyph_variants(IDWriteFontFace1 *fontface)
for
(
i
=
0
;
i
<
GET_BE_WORD
(
featurelist
->
FeatureCount
);
i
++
)
{
if
(
*
(
UINT32
*
)
featurelist
->
FeatureRecord
[
i
].
FeatureTag
==
DWRITE_FONT_FEATURE_TAG_VERTICAL_WRITING
)
{
const
OT_Feature
*
feature
=
(
const
OT_Feature
*
)((
BYTE
*
)
featurelist
+
GET_BE_WORD
(
featurelist
->
FeatureRecord
[
i
].
Feature
));
UINT16
lookup_count
=
GET_BE_WORD
(
feature
->
LookupCount
),
index
,
count
,
type
;
UINT16
lookup_count
=
GET_BE_WORD
(
feature
->
LookupCount
),
i
,
i
ndex
,
count
,
type
;
const
GSUB_SingleSubstFormat2
*
subst2
;
const
OT_LookupTable
*
lookup_table
;
UINT32
offset
;
...
...
@@ -6389,44 +6389,43 @@ static BOOL has_vertical_glyph_variants(IDWriteFontFace1 *fontface)
if
(
lookup_count
==
0
)
continue
;
ok
(
lookup_count
==
1
,
"got lookup count %u
\n
"
,
lookup_count
);
for
(
i
=
0
;
i
<
lookup_count
;
i
++
)
{
/* check if lookup is empty */
index
=
GET_BE_WORD
(
feature
->
LookupListIndex
[
i
]);
lookup_table
=
(
const
OT_LookupTable
*
)((
BYTE
*
)
lookup_list
+
GET_BE_WORD
(
lookup_list
->
Lookup
[
index
]));
/* check if lookup is empty */
index
=
GET_BE_WORD
(
feature
->
LookupListIndex
[
0
]);
lookup_table
=
(
const
OT_LookupTable
*
)((
BYTE
*
)
lookup_list
+
GET_BE_WORD
(
lookup_list
->
Lookup
[
index
]));
type
=
GET_BE_WORD
(
lookup_table
->
LookupType
);
ok
(
type
==
1
||
type
==
7
,
"got unexpected lookup type %u
\n
"
,
type
);
type
=
GET_BE_WORD
(
lookup_table
->
LookupType
);
ok
(
type
==
1
||
type
==
7
,
"got unexpected lookup type %u
\n
"
,
type
);
count
=
GET_BE_WORD
(
lookup_table
->
SubTableCount
);
if
(
count
==
0
)
continue
;
ok
(
count
>
0
,
"got unexpected subtable count %u
\n
"
,
count
);
count
=
GET_BE_WORD
(
lookup_table
->
SubTableCount
);
if
(
count
==
0
)
continue
;
ok
(
count
>
0
,
"got unexpected subtable count %u
\n
"
,
count
);
offset
=
GET_BE_WORD
(
lookup_table
->
SubTable
[
0
]);
if
(
type
==
7
)
{
const
GSUB_ExtensionPosFormat1
*
ext
=
(
const
GSUB_ExtensionPosFormat1
*
)((
const
BYTE
*
)
lookup_table
+
offset
);
if
(
GET_BE_WORD
(
ext
->
SubstFormat
)
==
1
)
offset
+=
GET_BE_DWORD
(
ext
->
ExtensionOffset
);
else
ok
(
0
,
"Unhandled Extension Substitution Format %u
\n
"
,
GET_BE_WORD
(
ext
->
SubstFormat
));
}
offset
=
GET_BE_WORD
(
lookup_table
->
SubTable
[
0
]);
if
(
type
==
7
)
{
const
GSUB_ExtensionPosFormat1
*
ext
=
(
const
GSUB_ExtensionPosFormat1
*
)((
const
BYTE
*
)
lookup_table
+
offset
);
if
(
GET_BE_WORD
(
ext
->
SubstFormat
)
==
1
)
offset
+=
GET_BE_DWORD
(
ext
->
ExtensionOffset
);
else
ok
(
0
,
"Unhandled Extension Substitution Format %u
\n
"
,
GET_BE_WORD
(
ext
->
SubstFormat
));
}
subst2
=
(
const
GSUB_SingleSubstFormat2
*
)((
BYTE
*
)
lookup_table
+
offset
);
index
=
GET_BE_WORD
(
subst2
->
SubstFormat
);
if
(
index
==
1
)
ok
(
0
,
"validate Single Substitution Format 1
\n
"
);
else
if
(
index
==
2
)
{
/* SimSun-ExtB has 0 glyph count for this substitution */
if
(
GET_BE_WORD
(
subst2
->
GlyphCount
)
>
0
)
{
ret
=
TRUE
;
break
;
subst2
=
(
const
GSUB_SingleSubstFormat2
*
)((
BYTE
*
)
lookup_table
+
offset
);
index
=
GET_BE_WORD
(
subst2
->
SubstFormat
);
if
(
index
==
1
)
ok
(
0
,
"validate Single Substitution Format 1
\n
"
);
else
if
(
index
==
2
)
{
/* SimSun-ExtB has 0 glyph count for this substitution */
if
(
GET_BE_WORD
(
subst2
->
GlyphCount
)
>
0
)
{
ret
=
TRUE
;
break
;
}
}
else
ok
(
0
,
"unknown Single Substitution Format, %u
\n
"
,
index
);
}
else
ok
(
0
,
"unknown Single Substitution Format, %u
\n
"
,
index
);
}
}
...
...
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