dwrite: For object creation helpers with many arguments pack them in structures.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
05a10d5fc8
commit
5fb8acc536
|
@ -111,13 +111,39 @@ static inline FLOAT get_scaled_advance_width(INT32 advance, FLOAT emSize, const
|
|||
return (FLOAT)advance * emSize / (FLOAT)metrics->designUnitsPerEm;
|
||||
}
|
||||
|
||||
struct textlayout_desc
|
||||
{
|
||||
IDWriteFactory3 *factory;
|
||||
const WCHAR *string;
|
||||
UINT32 length;
|
||||
IDWriteTextFormat *format;
|
||||
FLOAT max_width;
|
||||
FLOAT max_height;
|
||||
BOOL is_gdi_compatible;
|
||||
/* fields below are only meaningful for gdi-compatible layout */
|
||||
FLOAT ppdip;
|
||||
const DWRITE_MATRIX *transform;
|
||||
BOOL use_gdi_natural;
|
||||
};
|
||||
|
||||
struct glyphrunanalysis_desc
|
||||
{
|
||||
const DWRITE_GLYPH_RUN *run;
|
||||
const DWRITE_MATRIX *transform;
|
||||
DWRITE_RENDERING_MODE rendering_mode;
|
||||
DWRITE_MEASURING_MODE measuring_mode;
|
||||
DWRITE_GRID_FIT_MODE gridfit_mode;
|
||||
DWRITE_TEXT_ANTIALIAS_MODE aa_mode;
|
||||
FLOAT origin_x;
|
||||
FLOAT origin_y;
|
||||
FLOAT ppdip;
|
||||
};
|
||||
|
||||
extern HRESULT convert_fontface_to_logfont(IDWriteFontFace*, LOGFONTW*) DECLSPEC_HIDDEN;
|
||||
extern HRESULT create_numbersubstitution(DWRITE_NUMBER_SUBSTITUTION_METHOD,const WCHAR *locale,BOOL,IDWriteNumberSubstitution**) DECLSPEC_HIDDEN;
|
||||
extern HRESULT create_textformat(const WCHAR*,IDWriteFontCollection*,DWRITE_FONT_WEIGHT,DWRITE_FONT_STYLE,DWRITE_FONT_STRETCH,
|
||||
FLOAT,const WCHAR*,IDWriteTextFormat**) DECLSPEC_HIDDEN;
|
||||
extern HRESULT create_textlayout(IDWriteFactory3*,const WCHAR*,UINT32,IDWriteTextFormat*,FLOAT,FLOAT,IDWriteTextLayout**) DECLSPEC_HIDDEN;
|
||||
extern HRESULT create_gdicompat_textlayout(IDWriteFactory3*,const WCHAR*,UINT32,IDWriteTextFormat*,FLOAT,FLOAT,FLOAT,
|
||||
const DWRITE_MATRIX*,BOOL,IDWriteTextLayout**) DECLSPEC_HIDDEN;
|
||||
extern HRESULT create_textlayout(const struct textlayout_desc*,IDWriteTextLayout**) DECLSPEC_HIDDEN;
|
||||
extern HRESULT create_trimmingsign(IDWriteFactory3*,IDWriteTextFormat*,IDWriteInlineObject**) DECLSPEC_HIDDEN;
|
||||
extern HRESULT create_typography(IDWriteTypography**) DECLSPEC_HIDDEN;
|
||||
extern HRESULT create_gdiinterop(IDWriteFactory3*,IDWriteGdiInterop1**) DECLSPEC_HIDDEN;
|
||||
|
@ -133,8 +159,7 @@ extern HRESULT create_font_file(IDWriteFontFileLoader *loader, const void *refer
|
|||
extern HRESULT create_localfontfileloader(IDWriteLocalFontFileLoader** iface) DECLSPEC_HIDDEN;
|
||||
extern HRESULT create_fontface(DWRITE_FONT_FACE_TYPE,UINT32,IDWriteFontFile* const*,UINT32,DWRITE_FONT_SIMULATIONS,IDWriteFontFace3**) DECLSPEC_HIDDEN;
|
||||
extern HRESULT create_font_collection(IDWriteFactory3*,IDWriteFontFileEnumerator*,BOOL,IDWriteFontCollection**) DECLSPEC_HIDDEN;
|
||||
extern HRESULT create_glyphrunanalysis(DWRITE_RENDERING_MODE,DWRITE_MEASURING_MODE,DWRITE_GLYPH_RUN const*,FLOAT,const DWRITE_MATRIX*,
|
||||
DWRITE_GRID_FIT_MODE,DWRITE_TEXT_ANTIALIAS_MODE,FLOAT,FLOAT,IDWriteGlyphRunAnalysis**) DECLSPEC_HIDDEN;
|
||||
extern HRESULT create_glyphrunanalysis(const struct glyphrunanalysis_desc*,IDWriteGlyphRunAnalysis**) DECLSPEC_HIDDEN;
|
||||
extern BOOL is_system_collection(IDWriteFontCollection*) DECLSPEC_HIDDEN;
|
||||
extern HRESULT get_local_refkey(const WCHAR*,const FILETIME*,void**,UINT32*) DECLSPEC_HIDDEN;
|
||||
extern HRESULT get_filestream_from_file(IDWriteFontFile*,IDWriteFontFileStream**) DECLSPEC_HIDDEN;
|
||||
|
|
|
@ -4864,9 +4864,7 @@ static inline void transform_2d_vec(D2D_POINT_2F *vec, const DWRITE_MATRIX *m)
|
|||
*vec = ret;
|
||||
}
|
||||
|
||||
HRESULT create_glyphrunanalysis(DWRITE_RENDERING_MODE rendering_mode, DWRITE_MEASURING_MODE measuring_mode, DWRITE_GLYPH_RUN const *run,
|
||||
FLOAT ppdip, const DWRITE_MATRIX *transform, DWRITE_GRID_FIT_MODE gridfit_mode, DWRITE_TEXT_ANTIALIAS_MODE aa_mode,
|
||||
FLOAT originX, FLOAT originY, IDWriteGlyphRunAnalysis **ret)
|
||||
HRESULT create_glyphrunanalysis(const struct glyphrunanalysis_desc *desc, IDWriteGlyphRunAnalysis **ret)
|
||||
{
|
||||
struct dwrite_glyphrunanalysis *analysis;
|
||||
FLOAT rtl_factor;
|
||||
|
@ -4875,7 +4873,7 @@ HRESULT create_glyphrunanalysis(DWRITE_RENDERING_MODE rendering_mode, DWRITE_MEA
|
|||
*ret = NULL;
|
||||
|
||||
/* check for valid rendering mode */
|
||||
if ((UINT32)rendering_mode >= DWRITE_RENDERING_MODE_OUTLINE || rendering_mode == DWRITE_RENDERING_MODE_DEFAULT)
|
||||
if ((UINT32)desc->rendering_mode >= DWRITE_RENDERING_MODE_OUTLINE || desc->rendering_mode == DWRITE_RENDERING_MODE_DEFAULT)
|
||||
return E_INVALIDARG;
|
||||
|
||||
analysis = heap_alloc(sizeof(*analysis));
|
||||
|
@ -4884,27 +4882,27 @@ HRESULT create_glyphrunanalysis(DWRITE_RENDERING_MODE rendering_mode, DWRITE_MEA
|
|||
|
||||
analysis->IDWriteGlyphRunAnalysis_iface.lpVtbl = &glyphrunanalysisvtbl;
|
||||
analysis->ref = 1;
|
||||
analysis->rendering_mode = rendering_mode;
|
||||
analysis->rendering_mode = desc->rendering_mode;
|
||||
analysis->flags = 0;
|
||||
analysis->bitmap = NULL;
|
||||
analysis->ppdip = ppdip;
|
||||
analysis->origin.x = originX * ppdip;
|
||||
analysis->origin.y = originY * ppdip;
|
||||
analysis->ppdip = desc->ppdip;
|
||||
analysis->origin.x = desc->origin_x * desc->ppdip;
|
||||
analysis->origin.y = desc->origin_y * desc->ppdip;
|
||||
SetRectEmpty(&analysis->bounds);
|
||||
analysis->run = *run;
|
||||
analysis->run = *desc->run;
|
||||
IDWriteFontFace_AddRef(analysis->run.fontFace);
|
||||
analysis->glyphs = heap_alloc(run->glyphCount*sizeof(*run->glyphIndices));
|
||||
analysis->advances = heap_alloc(run->glyphCount*sizeof(*analysis->advances));
|
||||
if (run->glyphOffsets) {
|
||||
analysis->advanceoffsets = heap_alloc(run->glyphCount*sizeof(*analysis->advanceoffsets));
|
||||
analysis->ascenderoffsets = heap_alloc(run->glyphCount*sizeof(*analysis->ascenderoffsets));
|
||||
analysis->glyphs = heap_alloc(desc->run->glyphCount*sizeof(*desc->run->glyphIndices));
|
||||
analysis->advances = heap_alloc(desc->run->glyphCount*sizeof(*analysis->advances));
|
||||
if (desc->run->glyphOffsets) {
|
||||
analysis->advanceoffsets = heap_alloc(desc->run->glyphCount*sizeof(*analysis->advanceoffsets));
|
||||
analysis->ascenderoffsets = heap_alloc(desc->run->glyphCount*sizeof(*analysis->ascenderoffsets));
|
||||
}
|
||||
else {
|
||||
analysis->advanceoffsets = NULL;
|
||||
analysis->ascenderoffsets = NULL;
|
||||
}
|
||||
|
||||
if (!analysis->glyphs || !analysis->advances || ((!analysis->advanceoffsets || !analysis->ascenderoffsets) && run->glyphOffsets)) {
|
||||
if (!analysis->glyphs || !analysis->advances || ((!analysis->advanceoffsets || !analysis->ascenderoffsets) && desc->run->glyphOffsets)) {
|
||||
heap_free(analysis->glyphs);
|
||||
heap_free(analysis->advances);
|
||||
heap_free(analysis->advanceoffsets);
|
||||
|
@ -4920,8 +4918,8 @@ HRESULT create_glyphrunanalysis(DWRITE_RENDERING_MODE rendering_mode, DWRITE_MEA
|
|||
}
|
||||
|
||||
/* check if transform is usable */
|
||||
if (transform && memcmp(transform, &identity, sizeof(*transform))) {
|
||||
analysis->m = *transform;
|
||||
if (desc->transform && memcmp(desc->transform, &identity, sizeof(*desc->transform))) {
|
||||
analysis->m = *desc->transform;
|
||||
analysis->flags |= RUNANALYSIS_USE_TRANSFORM;
|
||||
}
|
||||
else
|
||||
|
@ -4931,16 +4929,16 @@ HRESULT create_glyphrunanalysis(DWRITE_RENDERING_MODE rendering_mode, DWRITE_MEA
|
|||
analysis->run.glyphAdvances = NULL;
|
||||
analysis->run.glyphOffsets = NULL;
|
||||
|
||||
rtl_factor = run->bidiLevel & 1 ? -1.0f : 1.0f;
|
||||
rtl_factor = desc->run->bidiLevel & 1 ? -1.0f : 1.0f;
|
||||
|
||||
if (analysis->flags & RUNANALYSIS_USE_TRANSFORM)
|
||||
transform_2d_vec(&analysis->origin, &analysis->m);
|
||||
|
||||
memcpy(analysis->glyphs, run->glyphIndices, run->glyphCount*sizeof(*run->glyphIndices));
|
||||
memcpy(analysis->glyphs, desc->run->glyphIndices, desc->run->glyphCount*sizeof(*desc->run->glyphIndices));
|
||||
|
||||
if (run->glyphAdvances) {
|
||||
for (i = 0; i < run->glyphCount; i++) {
|
||||
init_2d_vec(analysis->advances + i, rtl_factor * run->glyphAdvances[i] * ppdip, run->isSideways);
|
||||
if (desc->run->glyphAdvances) {
|
||||
for (i = 0; i < desc->run->glyphCount; i++) {
|
||||
init_2d_vec(analysis->advances + i, rtl_factor * desc->run->glyphAdvances[i] * desc->ppdip, desc->run->isSideways);
|
||||
if (analysis->flags & RUNANALYSIS_USE_TRANSFORM)
|
||||
transform_2d_vec(analysis->advances + i, &analysis->m);
|
||||
}
|
||||
|
@ -4949,31 +4947,31 @@ HRESULT create_glyphrunanalysis(DWRITE_RENDERING_MODE rendering_mode, DWRITE_MEA
|
|||
DWRITE_FONT_METRICS metrics;
|
||||
IDWriteFontFace1 *fontface1;
|
||||
|
||||
IDWriteFontFace_GetMetrics(run->fontFace, &metrics);
|
||||
IDWriteFontFace_QueryInterface(run->fontFace, &IID_IDWriteFontFace1, (void**)&fontface1);
|
||||
IDWriteFontFace_GetMetrics(desc->run->fontFace, &metrics);
|
||||
IDWriteFontFace_QueryInterface(desc->run->fontFace, &IID_IDWriteFontFace1, (void**)&fontface1);
|
||||
|
||||
for (i = 0; i < run->glyphCount; i++) {
|
||||
for (i = 0; i < desc->run->glyphCount; i++) {
|
||||
HRESULT hr;
|
||||
INT32 a;
|
||||
|
||||
switch (measuring_mode)
|
||||
switch (desc->measuring_mode)
|
||||
{
|
||||
case DWRITE_MEASURING_MODE_NATURAL:
|
||||
hr = IDWriteFontFace1_GetDesignGlyphAdvances(fontface1, 1, run->glyphIndices + i, &a, run->isSideways);
|
||||
hr = IDWriteFontFace1_GetDesignGlyphAdvances(fontface1, 1, desc->run->glyphIndices + i, &a, desc->run->isSideways);
|
||||
if (FAILED(hr))
|
||||
a = 0;
|
||||
init_2d_vec(analysis->advances + i, rtl_factor * get_scaled_advance_width(a, run->fontEmSize, &metrics) * ppdip,
|
||||
run->isSideways);
|
||||
init_2d_vec(analysis->advances + i, rtl_factor * get_scaled_advance_width(a, desc->run->fontEmSize, &metrics) * desc->ppdip,
|
||||
desc->run->isSideways);
|
||||
break;
|
||||
case DWRITE_MEASURING_MODE_GDI_CLASSIC:
|
||||
case DWRITE_MEASURING_MODE_GDI_NATURAL:
|
||||
hr = IDWriteFontFace1_GetGdiCompatibleGlyphAdvances(fontface1, run->fontEmSize, ppdip, transform,
|
||||
measuring_mode == DWRITE_MEASURING_MODE_GDI_NATURAL, run->isSideways, 1, run->glyphIndices + i, &a);
|
||||
hr = IDWriteFontFace1_GetGdiCompatibleGlyphAdvances(fontface1, desc->run->fontEmSize, desc->ppdip, desc->transform,
|
||||
desc->measuring_mode == DWRITE_MEASURING_MODE_GDI_NATURAL, desc->run->isSideways, 1, desc->run->glyphIndices + i, &a);
|
||||
if (FAILED(hr))
|
||||
init_2d_vec(analysis->advances + i, 0.0f, FALSE);
|
||||
else
|
||||
init_2d_vec(analysis->advances + i, rtl_factor * floorf(a * run->fontEmSize * ppdip / metrics.designUnitsPerEm + 0.5f),
|
||||
run->isSideways);
|
||||
init_2d_vec(analysis->advances + i, rtl_factor * floorf(a * desc->run->fontEmSize * desc->ppdip / metrics.designUnitsPerEm + 0.5f),
|
||||
desc->run->isSideways);
|
||||
break;
|
||||
default:
|
||||
;
|
||||
|
@ -4986,11 +4984,11 @@ HRESULT create_glyphrunanalysis(DWRITE_RENDERING_MODE rendering_mode, DWRITE_MEA
|
|||
IDWriteFontFace1_Release(fontface1);
|
||||
}
|
||||
|
||||
if (run->glyphOffsets) {
|
||||
for (i = 0; i < run->glyphCount; i++) {
|
||||
init_2d_vec(analysis->advanceoffsets + i, rtl_factor * run->glyphOffsets[i].advanceOffset * ppdip, run->isSideways);
|
||||
if (desc->run->glyphOffsets) {
|
||||
for (i = 0; i < desc->run->glyphCount; i++) {
|
||||
init_2d_vec(analysis->advanceoffsets + i, rtl_factor * desc->run->glyphOffsets[i].advanceOffset * desc->ppdip, desc->run->isSideways);
|
||||
/* Positive ascender offset moves glyph up. Keep it orthogonal to advance direction. */
|
||||
init_2d_vec(analysis->ascenderoffsets + i, -run->glyphOffsets[i].ascenderOffset * ppdip, !run->isSideways);
|
||||
init_2d_vec(analysis->ascenderoffsets + i, -desc->run->glyphOffsets[i].ascenderOffset * desc->ppdip, !desc->run->isSideways);
|
||||
if (analysis->flags & RUNANALYSIS_USE_TRANSFORM) {
|
||||
transform_2d_vec(analysis->advanceoffsets + i, &analysis->m);
|
||||
transform_2d_vec(analysis->ascenderoffsets + i, &analysis->m);
|
||||
|
|
|
@ -4441,8 +4441,7 @@ static HRESULT layout_format_from_textformat(struct dwrite_textlayout *layout, I
|
|||
return IDWriteTextFormat_GetFontCollection(format, &layout->format.collection);
|
||||
}
|
||||
|
||||
static HRESULT init_textlayout(IDWriteFactory3 *factory, const WCHAR *str, UINT32 len, IDWriteTextFormat *format,
|
||||
FLOAT maxwidth, FLOAT maxheight, struct dwrite_textlayout *layout)
|
||||
static HRESULT init_textlayout(const struct textlayout_desc *desc, struct dwrite_textlayout *layout)
|
||||
{
|
||||
struct layout_range_header *range, *strike, *underline, *effect, *spacing, *typography;
|
||||
static const DWRITE_TEXT_RANGE r = { 0, ~0u };
|
||||
|
@ -4453,7 +4452,7 @@ static HRESULT init_textlayout(IDWriteFactory3 *factory, const WCHAR *str, UINT3
|
|||
layout->IDWriteTextAnalysisSink1_iface.lpVtbl = &dwritetextlayoutsinkvtbl;
|
||||
layout->IDWriteTextAnalysisSource1_iface.lpVtbl = &dwritetextlayoutsourcevtbl;
|
||||
layout->ref = 1;
|
||||
layout->len = len;
|
||||
layout->len = desc->length;
|
||||
layout->recompute = RECOMPUTE_EVERYTHING;
|
||||
layout->nominal_breakpoints = NULL;
|
||||
layout->actual_breakpoints = NULL;
|
||||
|
@ -4476,20 +4475,20 @@ static HRESULT init_textlayout(IDWriteFactory3 *factory, const WCHAR *str, UINT3
|
|||
list_init(&layout->typographies);
|
||||
memset(&layout->format, 0, sizeof(layout->format));
|
||||
memset(&layout->metrics, 0, sizeof(layout->metrics));
|
||||
layout->metrics.layoutWidth = maxwidth;
|
||||
layout->metrics.layoutHeight = maxheight;
|
||||
layout->metrics.layoutWidth = desc->max_width;
|
||||
layout->metrics.layoutHeight = desc->max_height;
|
||||
layout->measuringmode = DWRITE_MEASURING_MODE_NATURAL;
|
||||
|
||||
layout->ppdip = 0.0f;
|
||||
memset(&layout->transform, 0, sizeof(layout->transform));
|
||||
|
||||
layout->str = heap_strdupnW(str, len);
|
||||
if (len && !layout->str) {
|
||||
layout->str = heap_strdupnW(desc->string, desc->length);
|
||||
if (desc->length && !layout->str) {
|
||||
hr = E_OUTOFMEMORY;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
hr = layout_format_from_textformat(layout, format);
|
||||
hr = layout_format_from_textformat(layout, desc->format);
|
||||
if (FAILED(hr))
|
||||
goto fail;
|
||||
|
||||
|
@ -4510,7 +4509,14 @@ static HRESULT init_textlayout(IDWriteFactory3 *factory, const WCHAR *str, UINT3
|
|||
goto fail;
|
||||
}
|
||||
|
||||
layout->factory = factory;
|
||||
if (desc->is_gdi_compatible)
|
||||
layout->measuringmode = desc->use_gdi_natural ? DWRITE_MEASURING_MODE_GDI_NATURAL : DWRITE_MEASURING_MODE_GDI_CLASSIC;
|
||||
else
|
||||
layout->measuringmode = DWRITE_MEASURING_MODE_NATURAL;
|
||||
layout->ppdip = desc->ppdip;
|
||||
layout->transform = desc->transform ? *desc->transform : identity;
|
||||
|
||||
layout->factory = desc->factory;
|
||||
IDWriteFactory3_AddRef(layout->factory);
|
||||
list_add_head(&layout->ranges, &range->entry);
|
||||
list_add_head(&layout->strike_ranges, &strike->entry);
|
||||
|
@ -4525,55 +4531,26 @@ fail:
|
|||
return hr;
|
||||
}
|
||||
|
||||
HRESULT create_textlayout(IDWriteFactory3 *factory, const WCHAR *str, UINT32 len, IDWriteTextFormat *format,
|
||||
FLOAT maxwidth, FLOAT maxheight, IDWriteTextLayout **ret)
|
||||
HRESULT create_textlayout(const struct textlayout_desc *desc, IDWriteTextLayout **ret)
|
||||
{
|
||||
struct dwrite_textlayout *layout;
|
||||
HRESULT hr;
|
||||
|
||||
*ret = NULL;
|
||||
|
||||
if (!format || !str)
|
||||
if (!desc->format || !desc->string)
|
||||
return E_INVALIDARG;
|
||||
|
||||
layout = heap_alloc(sizeof(struct dwrite_textlayout));
|
||||
if (!layout) return E_OUTOFMEMORY;
|
||||
|
||||
hr = init_textlayout(factory, str, len, format, maxwidth, maxheight, layout);
|
||||
hr = init_textlayout(desc, layout);
|
||||
if (hr == S_OK)
|
||||
*ret = (IDWriteTextLayout*)&layout->IDWriteTextLayout3_iface;
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
HRESULT create_gdicompat_textlayout(IDWriteFactory3 *factory, const WCHAR *str, UINT32 len, IDWriteTextFormat *format,
|
||||
FLOAT maxwidth, FLOAT maxheight, FLOAT ppdip, const DWRITE_MATRIX *transform, BOOL use_gdi_natural, IDWriteTextLayout **ret)
|
||||
{
|
||||
struct dwrite_textlayout *layout;
|
||||
HRESULT hr;
|
||||
|
||||
*ret = NULL;
|
||||
|
||||
if (!format || !str)
|
||||
return E_INVALIDARG;
|
||||
|
||||
layout = heap_alloc(sizeof(struct dwrite_textlayout));
|
||||
if (!layout) return E_OUTOFMEMORY;
|
||||
|
||||
hr = init_textlayout(factory, str, len, format, maxwidth, maxheight, layout);
|
||||
if (hr == S_OK) {
|
||||
layout->measuringmode = use_gdi_natural ? DWRITE_MEASURING_MODE_GDI_NATURAL : DWRITE_MEASURING_MODE_GDI_CLASSIC;
|
||||
|
||||
/* set gdi-specific properties */
|
||||
layout->ppdip = ppdip;
|
||||
layout->transform = transform ? *transform : identity;
|
||||
|
||||
*ret = (IDWriteTextLayout*)&layout->IDWriteTextLayout3_iface;
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI dwritetrimmingsign_QueryInterface(IDWriteInlineObject *iface, REFIID riid, void **obj)
|
||||
{
|
||||
struct dwrite_trimmingsign *This = impl_from_IDWriteInlineObject(iface);
|
||||
|
|
|
@ -1072,26 +1072,47 @@ static HRESULT WINAPI dwritefactory_GetGdiInterop(IDWriteFactory3 *iface, IDWrit
|
|||
}
|
||||
|
||||
static HRESULT WINAPI dwritefactory_CreateTextLayout(IDWriteFactory3 *iface, WCHAR const* string,
|
||||
UINT32 len, IDWriteTextFormat *format, FLOAT max_width, FLOAT max_height, IDWriteTextLayout **layout)
|
||||
UINT32 length, IDWriteTextFormat *format, FLOAT max_width, FLOAT max_height, IDWriteTextLayout **layout)
|
||||
{
|
||||
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
|
||||
struct textlayout_desc desc;
|
||||
|
||||
TRACE("(%p)->(%s:%u %p %f %f %p)\n", This, debugstr_wn(string, len), len, format, max_width, max_height, layout);
|
||||
TRACE("(%p)->(%s:%u %p %f %f %p)\n", This, debugstr_wn(string, length), length, format, max_width, max_height, layout);
|
||||
|
||||
return create_textlayout(iface, string, len, format, max_width, max_height, layout);
|
||||
desc.factory = iface;
|
||||
desc.string = string;
|
||||
desc.length = length;
|
||||
desc.format = format;
|
||||
desc.max_width = max_width;
|
||||
desc.max_height = max_height;
|
||||
desc.is_gdi_compatible = FALSE;
|
||||
desc.ppdip = 1.0f;
|
||||
desc.transform = NULL;
|
||||
desc.use_gdi_natural = FALSE;
|
||||
return create_textlayout(&desc, layout);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI dwritefactory_CreateGdiCompatibleTextLayout(IDWriteFactory3 *iface, WCHAR const* string,
|
||||
UINT32 len, IDWriteTextFormat *format, FLOAT layout_width, FLOAT layout_height, FLOAT pixels_per_dip,
|
||||
UINT32 length, IDWriteTextFormat *format, FLOAT max_width, FLOAT max_height, FLOAT pixels_per_dip,
|
||||
DWRITE_MATRIX const* transform, BOOL use_gdi_natural, IDWriteTextLayout **layout)
|
||||
{
|
||||
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
|
||||
struct textlayout_desc desc;
|
||||
|
||||
TRACE("(%p)->(%s:%u %p %f %f %f %p %d %p)\n", This, debugstr_wn(string, len), len, format, layout_width, layout_height,
|
||||
TRACE("(%p)->(%s:%u %p %f %f %f %p %d %p)\n", This, debugstr_wn(string, length), length, format, max_width, max_height,
|
||||
pixels_per_dip, transform, use_gdi_natural, layout);
|
||||
|
||||
return create_gdicompat_textlayout(iface, string, len, format, layout_width, layout_height, pixels_per_dip, transform,
|
||||
use_gdi_natural, layout);
|
||||
desc.factory = iface;
|
||||
desc.string = string;
|
||||
desc.length = length;
|
||||
desc.format = format;
|
||||
desc.max_width = max_width;
|
||||
desc.max_height = max_height;
|
||||
desc.is_gdi_compatible = TRUE;
|
||||
desc.ppdip = pixels_per_dip;
|
||||
desc.transform = transform;
|
||||
desc.use_gdi_natural = use_gdi_natural;
|
||||
return create_textlayout(&desc, layout);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI dwritefactory_CreateEllipsisTrimmingSign(IDWriteFactory3 *iface, IDWriteTextFormat *format,
|
||||
|
@ -1122,6 +1143,7 @@ static HRESULT WINAPI dwritefactory_CreateGlyphRunAnalysis(IDWriteFactory3 *ifac
|
|||
DWRITE_MEASURING_MODE measuring_mode, FLOAT originX, FLOAT originY, IDWriteGlyphRunAnalysis **analysis)
|
||||
{
|
||||
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
|
||||
struct glyphrunanalysis_desc desc;
|
||||
|
||||
TRACE("(%p)->(%p %.2f %p %d %d %.2f %.2f %p)\n", This, run, ppdip, transform, rendering_mode,
|
||||
measuring_mode, originX, originY, analysis);
|
||||
|
@ -1131,8 +1153,16 @@ static HRESULT WINAPI dwritefactory_CreateGlyphRunAnalysis(IDWriteFactory3 *ifac
|
|||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
return create_glyphrunanalysis(rendering_mode, measuring_mode, run, ppdip, transform, DWRITE_GRID_FIT_MODE_DEFAULT,
|
||||
DWRITE_TEXT_ANTIALIAS_MODE_CLEARTYPE, originX, originY, analysis);
|
||||
desc.run = run;
|
||||
desc.ppdip = ppdip;
|
||||
desc.transform = transform;
|
||||
desc.rendering_mode = rendering_mode;
|
||||
desc.measuring_mode = measuring_mode;
|
||||
desc.gridfit_mode = DWRITE_GRID_FIT_MODE_DEFAULT;
|
||||
desc.aa_mode = DWRITE_TEXT_ANTIALIAS_MODE_CLEARTYPE;
|
||||
desc.origin_x = originX;
|
||||
desc.origin_y = originY;
|
||||
return create_glyphrunanalysis(&desc, analysis);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI dwritefactory1_GetEudcFontCollection(IDWriteFactory3 *iface, IDWriteFontCollection **collection,
|
||||
|
@ -1232,11 +1262,21 @@ static HRESULT WINAPI dwritefactory2_CreateGlyphRunAnalysis(IDWriteFactory3 *ifa
|
|||
IDWriteGlyphRunAnalysis **analysis)
|
||||
{
|
||||
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
|
||||
struct glyphrunanalysis_desc desc;
|
||||
|
||||
TRACE("(%p)->(%p %p %d %d %d %d %.2f %.2f %p)\n", This, run, transform, rendering_mode, measuring_mode,
|
||||
gridfit_mode, aa_mode, originX, originY, analysis);
|
||||
|
||||
return create_glyphrunanalysis(rendering_mode, measuring_mode, run, 1.0f, transform, gridfit_mode, aa_mode, originX, originY, analysis);
|
||||
desc.run = run;
|
||||
desc.ppdip = 1.0f;
|
||||
desc.transform = transform;
|
||||
desc.rendering_mode = rendering_mode;
|
||||
desc.measuring_mode = measuring_mode;
|
||||
desc.gridfit_mode = gridfit_mode;
|
||||
desc.aa_mode = aa_mode;
|
||||
desc.origin_x = originX;
|
||||
desc.origin_y = originY;
|
||||
return create_glyphrunanalysis(&desc, analysis);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI dwritefactory3_CreateGlyphRunAnalysis(IDWriteFactory3 *iface, DWRITE_GLYPH_RUN const *run,
|
||||
|
|
Loading…
Reference in New Issue