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
e94d9770
Commit
e94d9770
authored
Jul 15, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 15, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Partially implement GetGdiCompatibleGlyphAdvances().
parent
e1a65bed
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
6 deletions
+33
-6
dwrite_private.h
dlls/dwrite/dwrite_private.h
+7
-0
font.c
dlls/dwrite/font.c
+26
-6
No files found.
dlls/dwrite/dwrite_private.h
View file @
e94d9770
...
...
@@ -92,6 +92,13 @@ static inline const char *debugstr_range(const DWRITE_TEXT_RANGE *range)
return
wine_dbg_sprintf
(
"%u:%u"
,
range
->
startPosition
,
range
->
length
);
}
static
inline
const
char
*
debugstr_matrix
(
const
DWRITE_MATRIX
*
m
)
{
if
(
!
m
)
return
"(null)"
;
return
wine_dbg_sprintf
(
"{%.2f,%.2f,%.2f,%.2f,%.2f,%.2f}"
,
m
->
m11
,
m
->
m12
,
m
->
m21
,
m
->
m22
,
m
->
dx
,
m
->
dy
);
}
static
inline
unsigned
short
get_table_entry
(
const
unsigned
short
*
table
,
WCHAR
ch
)
{
return
table
[
table
[
table
[
ch
>>
8
]
+
((
ch
>>
4
)
&
0x0f
)]
+
(
ch
&
0xf
)];
...
...
dlls/dwrite/font.c
View file @
e94d9770
...
...
@@ -619,7 +619,7 @@ static void WINAPI dwritefontface1_GetMetrics(IDWriteFontFace2 *iface, DWRITE_FO
static
inline
int
round_metric
(
FLOAT
metric
)
{
return
(
int
)
floor
(
metric
+
0
.
5
);
return
(
int
)
floor
f
(
metric
+
0
.
5
f
);
}
static
HRESULT
WINAPI
dwritefontface1_GetGdiCompatibleMetrics
(
IDWriteFontFace2
*
iface
,
FLOAT
em_size
,
FLOAT
pixels_per_dip
,
...
...
@@ -729,13 +729,33 @@ static HRESULT WINAPI dwritefontface1_GetDesignGlyphAdvances(IDWriteFontFace2 *i
}
static
HRESULT
WINAPI
dwritefontface1_GetGdiCompatibleGlyphAdvances
(
IDWriteFontFace2
*
iface
,
FLOAT
em_size
,
FLOAT
p
ixels_per_dip
,
const
DWRITE_MATRIX
*
transfor
m
,
BOOL
use_gdi_natural
,
BOOL
is_sideways
,
UINT32
glyph_count
,
UINT16
const
*
indice
s
,
INT32
*
advances
)
FLOAT
em_size
,
FLOAT
p
pdip
,
const
DWRITE_MATRIX
*
m
,
BOOL
use_gdi_natural
,
BOOL
is_sideways
,
UINT32
glyph_count
,
UINT16
const
*
glyph
s
,
INT32
*
advances
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace2
(
iface
);
FIXME
(
"(%p)->(%f %f %p %d %d %u %p %p): stub
\n
"
,
This
,
em_size
,
pixels_per_dip
,
transform
,
use_gdi_natural
,
is_sideways
,
glyph_count
,
indices
,
advances
);
return
E_NOTIMPL
;
HRESULT
hr
;
UINT32
i
;
TRACE
(
"(%p)->(%.2f %.2f %p %d %d %u %p %p)
\n
"
,
This
,
em_size
,
ppdip
,
m
,
use_gdi_natural
,
is_sideways
,
glyph_count
,
glyphs
,
advances
);
if
(
m
&&
memcmp
(
m
,
&
identity
,
sizeof
(
*
m
)))
FIXME
(
"transform is not supported, %s
\n
"
,
debugstr_matrix
(
m
));
for
(
i
=
0
;
i
<
glyph_count
;
i
++
)
{
FLOAT
scale
;
hr
=
IDWriteFontFace2_GetDesignGlyphAdvances
(
iface
,
1
,
glyphs
+
i
,
advances
+
i
,
is_sideways
);
if
(
FAILED
(
hr
))
return
hr
;
scale
=
em_size
*
ppdip
/
This
->
metrics
.
designUnitsPerEm
;
#define SCALE_METRIC(x) x = round_metric(round_metric((x) * scale) / scale)
SCALE_METRIC
(
advances
[
i
]);
#undef SCALE_METRIC
}
return
S_OK
;
}
static
HRESULT
WINAPI
dwritefontface1_GetKerningPairAdjustments
(
IDWriteFontFace2
*
iface
,
UINT32
count
,
...
...
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