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
d5c9a8a5
Commit
d5c9a8a5
authored
Jun 29, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 30, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Clarify offsets and sizes in vdmx table lookup code.
parent
9353a36d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
12 deletions
+24
-12
freetype.c
dlls/gdi32/freetype.c
+24
-12
No files found.
dlls/gdi32/freetype.c
View file @
d5c9a8a5
...
...
@@ -4463,6 +4463,12 @@ static DWORD get_font_data( GdiFont *font, DWORD table, DWORD offset, LPVOID buf
#define MS_VDMX_TAG MS_MAKE_TAG('V', 'D', 'M', 'X')
typedef
struct
{
WORD
version
;
WORD
numRecs
;
WORD
numRatios
;
}
VDMX_Header
;
typedef
struct
{
BYTE
bCharSet
;
BYTE
xRatio
;
BYTE
yStartRatio
;
...
...
@@ -4475,9 +4481,15 @@ typedef struct {
BYTE
endsz
;
}
VDMX_group
;
typedef
struct
{
WORD
yPelHeight
;
WORD
yMax
;
WORD
yMin
;
}
VDMX_vTable
;
static
LONG
load_VDMX
(
GdiFont
*
font
,
LONG
height
)
{
WORD
hdr
[
3
]
;
VDMX_Header
hdr
;
VDMX_group
group
;
BYTE
devXRatio
,
devYRatio
;
USHORT
numRecs
,
numRatios
;
...
...
@@ -4485,7 +4497,7 @@ static LONG load_VDMX(GdiFont *font, LONG height)
LONG
ppem
=
0
;
int
i
;
result
=
get_font_data
(
font
,
MS_VDMX_TAG
,
0
,
hdr
,
sizeof
(
hdr
));
result
=
get_font_data
(
font
,
MS_VDMX_TAG
,
0
,
&
hdr
,
sizeof
(
hdr
));
if
(
result
==
GDI_ERROR
)
/* no vdmx table present, use linear scaling */
return
ppem
;
...
...
@@ -4494,14 +4506,14 @@ static LONG load_VDMX(GdiFont *font, LONG height)
devXRatio
=
1
;
devYRatio
=
1
;
numRecs
=
GET_BE_WORD
(
hdr
[
1
]
);
numRatios
=
GET_BE_WORD
(
hdr
[
2
]
);
numRecs
=
GET_BE_WORD
(
hdr
.
numRecs
);
numRatios
=
GET_BE_WORD
(
hdr
.
numRatios
);
TRACE
(
"
numRecs = %d numRatios = %d
\n
"
,
numRecs
,
numRatios
);
TRACE
(
"
version = %d numRecs = %d numRatios = %d
\n
"
,
GET_BE_WORD
(
hdr
.
version
)
,
numRecs
,
numRatios
);
for
(
i
=
0
;
i
<
numRatios
;
i
++
)
{
Ratios
ratio
;
offset
=
(
3
*
2
)
+
(
i
*
sizeof
(
Ratios
));
offset
=
sizeof
(
hdr
)
+
(
i
*
sizeof
(
Ratios
));
get_font_data
(
font
,
MS_VDMX_TAG
,
offset
,
&
ratio
,
sizeof
(
Ratios
));
offset
=
-
1
;
...
...
@@ -4516,11 +4528,11 @@ static LONG load_VDMX(GdiFont *font, LONG height)
devYRatio
>=
ratio
.
yStartRatio
&&
devYRatio
<=
ratio
.
yEndRatio
))
{
WORD
tmp
;
WORD
group_offset
;
offset
=
(
3
*
2
)
+
(
numRatios
*
4
)
+
(
i
*
2
);
get_font_data
(
font
,
MS_VDMX_TAG
,
offset
,
&
tmp
,
sizeof
(
tmp
));
offset
=
GET_BE_WORD
(
tmp
);
offset
=
sizeof
(
hdr
)
+
numRatios
*
sizeof
(
ratio
)
+
i
*
sizeof
(
group_offset
);
get_font_data
(
font
,
MS_VDMX_TAG
,
offset
,
&
group_offset
,
sizeof
(
group_offset
));
offset
=
GET_BE_WORD
(
group_offset
);
break
;
}
}
...
...
@@ -4538,8 +4550,8 @@ static LONG load_VDMX(GdiFont *font, LONG height)
TRACE
(
"recs=%d startsz=%d endsz=%d
\n
"
,
recs
,
startsz
,
endsz
);
vTable
=
HeapAlloc
(
GetProcessHeap
(),
0
,
recs
*
6
);
result
=
get_font_data
(
font
,
MS_VDMX_TAG
,
offset
+
4
,
vTable
,
recs
*
6
);
vTable
=
HeapAlloc
(
GetProcessHeap
(),
0
,
recs
*
sizeof
(
VDMX_vTable
)
);
result
=
get_font_data
(
font
,
MS_VDMX_TAG
,
offset
+
sizeof
(
group
),
vTable
,
recs
*
sizeof
(
VDMX_vTable
)
);
if
(
result
==
GDI_ERROR
)
{
FIXME
(
"Failed to retrieve vTable
\n
"
);
goto
end
;
...
...
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