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
62b4f31d
Commit
62b4f31d
authored
Jan 17, 2013
by
Aric Stewart
Committed by
Alexandre Julliard
Jan 17, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
usp10: Implement GPOS Cursive Attachment Positioning Subtable.
parent
f4597120
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
0 deletions
+70
-0
opentype.c
dlls/usp10/opentype.c
+70
-0
No files found.
dlls/usp10/opentype.c
View file @
62b4f31d
...
...
@@ -375,6 +375,18 @@ typedef struct {
}
GPOS_PairSet
;
typedef
struct
{
WORD
EntryAnchor
;
WORD
ExitAnchor
;
}
GPOS_EntryExitRecord
;
typedef
struct
{
WORD
PosFormat
;
WORD
Coverage
;
WORD
EntryExitCount
;
GPOS_EntryExitRecord
EntryExitRecord
[
1
];
}
GPOS_CursivePosFormat1
;
typedef
struct
{
WORD
PosFormat
;
WORD
MarkCoverage
;
WORD
BaseCoverage
;
...
...
@@ -1333,6 +1345,49 @@ static INT GPOS_apply_PairAdjustment(const OT_LookupTable *look, const SCRIPT_AN
return
glyph_index
+
1
;
}
static
VOID
GPOS_apply_CursiveAttachment
(
const
OT_LookupTable
*
look
,
const
SCRIPT_ANALYSIS
*
analysis
,
const
WORD
*
glyphs
,
INT
glyph_index
,
INT
glyph_count
,
INT
ppem
,
LPPOINT
pt
)
{
int
j
;
int
write_dir
=
(
analysis
->
fRTL
&&
!
analysis
->
fLogicalOrder
)
?
-
1
:
1
;
if
(
glyph_index
+
write_dir
<
0
||
glyph_index
+
write_dir
>=
glyph_count
)
return
;
TRACE
(
"Cursive Attachment Positioning Subtable
\n
"
);
for
(
j
=
0
;
j
<
GET_BE_WORD
(
look
->
SubTableCount
);
j
++
)
{
const
GPOS_CursivePosFormat1
*
cpf1
;
WORD
offset
=
GET_BE_WORD
(
look
->
SubTable
[
j
]);
cpf1
=
(
const
GPOS_CursivePosFormat1
*
)((
const
BYTE
*
)
look
+
offset
);
if
(
GET_BE_WORD
(
cpf1
->
PosFormat
)
==
1
)
{
int
index_exit
,
index_entry
;
offset
=
GET_BE_WORD
(
cpf1
->
Coverage
);
index_exit
=
GSUB_is_glyph_covered
((
const
BYTE
*
)
cpf1
+
offset
,
glyphs
[
glyph_index
]);
if
(
index_exit
!=
-
1
&&
cpf1
->
EntryExitRecord
[
index_exit
].
ExitAnchor
!=
0
)
{
index_entry
=
GSUB_is_glyph_covered
((
const
BYTE
*
)
cpf1
+
offset
,
glyphs
[
glyph_index
+
write_dir
]);
if
(
index_entry
!=
-
1
&&
cpf1
->
EntryExitRecord
[
index_entry
].
EntryAnchor
!=
0
)
{
POINT
exit_pt
,
entry_pt
;
offset
=
GET_BE_WORD
(
cpf1
->
EntryExitRecord
[
index_exit
].
ExitAnchor
);
GPOS_get_anchor_values
((
const
BYTE
*
)
cpf1
+
offset
,
&
exit_pt
,
ppem
);
offset
=
GET_BE_WORD
(
cpf1
->
EntryExitRecord
[
index_entry
].
EntryAnchor
);
GPOS_get_anchor_values
((
const
BYTE
*
)
cpf1
+
offset
,
&
entry_pt
,
ppem
);
TRACE
(
"Found linkage %x[%i,%i] %x[%i,%i]
\n
"
,
glyphs
[
glyph_index
],
exit_pt
.
x
,
exit_pt
.
y
,
glyphs
[
glyph_index
+
write_dir
],
entry_pt
.
x
,
entry_pt
.
y
);
pt
->
x
=
entry_pt
.
x
-
exit_pt
.
x
;
pt
->
y
=
entry_pt
.
y
-
exit_pt
.
y
;
return
;
}
}
}
else
FIXME
(
"Cursive Attachment Positioning: Format %i Unhandled
\n
"
,
GET_BE_WORD
(
cpf1
->
PosFormat
));
}
return
;
}
static
VOID
GPOS_apply_MarkToBase
(
const
OT_LookupTable
*
look
,
const
SCRIPT_ANALYSIS
*
analysis
,
const
WORD
*
glyphs
,
INT
glyph_index
,
INT
glyph_count
,
INT
ppem
,
LPPOINT
pt
)
{
...
...
@@ -1726,6 +1781,21 @@ static INT GPOS_apply_lookup(LPOUTLINETEXTMETRICW lpotm, LPLOGFONTW lplogfont, c
}
return
index
;
}
case
3
:
{
POINT
desU
=
{
0
,
0
};
double
devX
,
devY
;
int
write_dir
=
(
analysis
->
fRTL
&&
!
analysis
->
fLogicalOrder
)
?
-
1
:
1
;
GPOS_apply_CursiveAttachment
(
look
,
analysis
,
glyphs
,
glyph_index
,
glyph_count
,
ppem
,
&
desU
);
if
(
desU
.
x
||
desU
.
y
)
{
GPOS_convert_design_units_to_device
(
lpotm
,
lplogfont
,
desU
.
x
,
desU
.
y
,
&
devX
,
&
devY
);
/* Windows does not appear to apply X offsets here */
pGoffset
[
glyph_index
].
dv
=
round
(
devY
)
+
pGoffset
[
glyph_index
+
write_dir
].
dv
;
}
break
;
}
case
4
:
{
double
devX
,
devY
;
...
...
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