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
69351a9c
Commit
69351a9c
authored
Jul 16, 2012
by
Aric Stewart
Committed by
Alexandre Julliard
Jul 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
usp10: Implement GPOS Anchor formats.
parent
940961fc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
98 additions
and
0 deletions
+98
-0
opentype.c
dlls/usp10/opentype.c
+98
-0
No files found.
dlls/usp10/opentype.c
View file @
69351a9c
...
...
@@ -286,6 +286,34 @@ typedef struct {
WORD
LookupList
;
}
GPOS_Header
;
typedef
struct
{
WORD
StartSize
;
WORD
EndSize
;
WORD
DeltaFormat
;
WORD
DeltaValue
[
1
];
}
OT_DeviceTable
;
typedef
struct
{
WORD
AnchorFormat
;
WORD
XCoordinate
;
WORD
YCoordinate
;
}
GPOS_AnchorFormat1
;
typedef
struct
{
WORD
AnchorFormat
;
WORD
XCoordinate
;
WORD
YCoordinate
;
WORD
AnchorPoint
;
}
GPOS_AnchorFormat2
;
typedef
struct
{
WORD
AnchorFormat
;
WORD
XCoordinate
;
WORD
YCoordinate
;
WORD
XDeviceTable
;
WORD
YDeviceTable
;
}
GPOS_AnchorFormat3
;
/**********
* CMAP
**********/
...
...
@@ -872,6 +900,76 @@ INT OpenType_apply_GSUB_lookup(LPCVOID table, INT lookup_index, WORD *glyphs, IN
/**********
* GPOS
**********/
static
INT
GPOS_get_device_table_value
(
const
OT_DeviceTable
*
DeviceTable
,
WORD
ppem
)
{
static
const
WORD
mask
[
3
]
=
{
3
,
0xf
,
0xff
};
if
(
DeviceTable
&&
ppem
>=
GET_BE_WORD
(
DeviceTable
->
StartSize
)
&&
ppem
<=
GET_BE_WORD
(
DeviceTable
->
EndSize
))
{
int
format
=
GET_BE_WORD
(
DeviceTable
->
DeltaFormat
);
int
index
=
ppem
-
GET_BE_WORD
(
DeviceTable
->
StartSize
);
int
value
;
TRACE
(
"device table, format %i, index %i
\n
"
,
format
,
index
);
index
=
index
<<
format
;
value
=
(
DeviceTable
->
DeltaValue
[
index
/
sizeof
(
WORD
)]
<<
(
index
%
sizeof
(
WORD
)))
&
mask
[
format
-
1
];
TRACE
(
"offset %i, value %i
\n
"
,
index
,
value
);
if
(
value
>
mask
[
format
-
1
]
/
2
)
value
=
-
1
*
((
mask
[
format
-
1
]
+
1
)
-
value
);
return
value
;
}
return
0
;
}
static
VOID
GPOS_get_anchor_values
(
LPCVOID
table
,
LPPOINT
pt
,
WORD
ppem
)
{
const
GPOS_AnchorFormat1
*
anchor1
=
(
const
GPOS_AnchorFormat1
*
)
table
;
switch
(
GET_BE_WORD
(
anchor1
->
AnchorFormat
))
{
case
1
:
{
TRACE
(
"Anchor Format 1
\n
"
);
pt
->
x
=
(
short
)
GET_BE_WORD
(
anchor1
->
XCoordinate
);
pt
->
y
=
(
short
)
GET_BE_WORD
(
anchor1
->
YCoordinate
);
break
;
}
case
2
:
{
const
GPOS_AnchorFormat2
*
anchor2
=
(
const
GPOS_AnchorFormat2
*
)
table
;
TRACE
(
"Anchor Format 2
\n
"
);
pt
->
x
=
(
short
)
GET_BE_WORD
(
anchor2
->
XCoordinate
);
pt
->
y
=
(
short
)
GET_BE_WORD
(
anchor2
->
YCoordinate
);
break
;
}
case
3
:
{
int
offset
;
const
GPOS_AnchorFormat3
*
anchor3
=
(
const
GPOS_AnchorFormat3
*
)
table
;
TRACE
(
"Anchor Format 3
\n
"
);
pt
->
x
=
(
short
)
GET_BE_WORD
(
anchor3
->
XCoordinate
);
pt
->
y
=
(
short
)
GET_BE_WORD
(
anchor3
->
YCoordinate
);
offset
=
GET_BE_WORD
(
anchor3
->
XDeviceTable
);
TRACE
(
"ppem %i
\n
"
,
ppem
);
if
(
offset
)
{
const
OT_DeviceTable
*
DeviceTableX
=
NULL
;
DeviceTableX
=
(
const
OT_DeviceTable
*
)((
const
BYTE
*
)
anchor3
+
offset
);
pt
->
x
+=
GPOS_get_device_table_value
(
DeviceTableX
,
ppem
);
}
offset
=
GET_BE_WORD
(
anchor3
->
YDeviceTable
);
if
(
offset
)
{
const
OT_DeviceTable
*
DeviceTableY
=
NULL
;
DeviceTableY
=
(
const
OT_DeviceTable
*
)((
const
BYTE
*
)
anchor3
+
offset
);
pt
->
y
+=
GPOS_get_device_table_value
(
DeviceTableY
,
ppem
);
}
break
;
}
default:
ERR
(
"Unknown Anchor Format %i
\n
"
,
GET_BE_WORD
(
anchor1
->
AnchorFormat
));
pt
->
x
=
0
;
pt
->
y
=
0
;
}
}
static
INT
GPOS_apply_lookup
(
LPOUTLINETEXTMETRICW
lpotm
,
LPLOGFONTW
lplogfont
,
INT
*
piAdvance
,
const
OT_LookupList
*
lookup
,
INT
lookup_index
,
const
WORD
*
glyphs
,
INT
glyph_index
,
INT
write_dir
,
INT
glyph_count
,
GOFFSET
*
pGoffset
)
{
...
...
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