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
415e0b3f
Commit
415e0b3f
authored
Dec 09, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 09, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Implement GetDesignGlyphAdvances().
parent
730b2f4c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
3 deletions
+70
-3
font.c
dlls/dwrite/font.c
+17
-3
font.c
dlls/dwrite/tests/font.c
+53
-0
No files found.
dlls/dwrite/font.c
View file @
415e0b3f
...
...
@@ -500,11 +500,25 @@ static BOOL WINAPI dwritefontface1_IsMonospacedFont(IDWriteFontFace2 *iface)
}
static
HRESULT
WINAPI
dwritefontface1_GetDesignGlyphAdvances
(
IDWriteFontFace2
*
iface
,
UINT32
glyph_count
,
UINT16
const
*
indice
s
,
INT32
*
advances
,
BOOL
is_sideways
)
UINT32
glyph_count
,
UINT16
const
*
glyph
s
,
INT32
*
advances
,
BOOL
is_sideways
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace2
(
iface
);
FIXME
(
"(%p)->(%u %p %p %d): stub
\n
"
,
This
,
glyph_count
,
indices
,
advances
,
is_sideways
);
return
E_NOTIMPL
;
UINT32
i
;
TRACE
(
"(%p)->(%u %p %p %d)
\n
"
,
This
,
glyph_count
,
glyphs
,
advances
,
is_sideways
);
for
(
i
=
0
;
i
<
glyph_count
;
i
++
)
{
DWRITE_GLYPH_METRICS
metrics
=
{
0
};
HRESULT
hr
;
hr
=
IDWriteFontFace2_GetDesignGlyphMetrics
(
iface
,
glyphs
+
i
,
1
,
&
metrics
,
is_sideways
);
if
(
FAILED
(
hr
))
return
hr
;
advances
[
i
]
=
is_sideways
?
metrics
.
advanceHeight
:
metrics
.
advanceWidth
;
}
return
S_OK
;
}
static
HRESULT
WINAPI
dwritefontface1_GetGdiCompatibleGlyphAdvances
(
IDWriteFontFace2
*
iface
,
...
...
dlls/dwrite/tests/font.c
View file @
415e0b3f
...
...
@@ -2636,6 +2636,58 @@ static void test_IsMonospacedFont(void)
IDWriteFontCollection_Release
(
collection
);
}
static
void
test_GetDesignGlyphAdvances
(
void
)
{
IDWriteFontFace1
*
fontface1
;
IDWriteFontFace
*
fontface
;
IDWriteFactory
*
factory
;
IDWriteFontFile
*
file
;
HRESULT
hr
;
factory
=
create_factory
();
create_testfontfile
(
test_fontfile
);
hr
=
IDWriteFactory_CreateFontFileReference
(
factory
,
test_fontfile
,
NULL
,
&
file
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDWriteFactory_CreateFontFace
(
factory
,
DWRITE_FONT_FACE_TYPE_TRUETYPE
,
1
,
&
file
,
0
,
DWRITE_FONT_SIMULATIONS_NONE
,
&
fontface
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
IDWriteFontFile_Release
(
file
);
hr
=
IDWriteFontFace_QueryInterface
(
fontface
,
&
IID_IDWriteFontFace1
,
(
void
**
)
&
fontface1
);
if
(
hr
==
S_OK
)
{
UINT32
codepoint
;
UINT16
index
;
INT32
advance
;
codepoint
=
'A'
;
index
=
0
;
hr
=
IDWriteFontFace1_GetGlyphIndices
(
fontface1
,
&
codepoint
,
1
,
&
index
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
index
>
0
,
"got %u
\n
"
,
index
);
advance
=
0
;
hr
=
IDWriteFontFace1_GetDesignGlyphAdvances
(
fontface1
,
1
,
&
index
,
&
advance
,
FALSE
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
advance
==
1000
,
"got %i
\n
"
,
advance
);
advance
=
0
;
hr
=
IDWriteFontFace1_GetDesignGlyphAdvances
(
fontface1
,
1
,
&
index
,
&
advance
,
TRUE
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
advance
==
2048
,
"got %i
\n
"
,
advance
);
IDWriteFontFace1_Release
(
fontface1
);
}
else
win_skip
(
"GetDesignGlyphAdvances() is not supported.
\n
"
);
IDWriteFontFace_Release
(
fontface
);
IDWriteFactory_Release
(
factory
);
DeleteFileW
(
test_fontfile
);
}
START_TEST
(
font
)
{
IDWriteFactory
*
factory
;
...
...
@@ -2670,6 +2722,7 @@ START_TEST(font)
test_CreateStreamFromKey
();
test_ReadFileFragment
();
test_GetDesignGlyphMetrics
();
test_GetDesignGlyphAdvances
();
test_IsMonospacedFont
();
IDWriteFactory_Release
(
factory
);
...
...
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