IDWriteTextRenderer1

<summary> The text renderer interface represents a set of application-defined callbacks that perform rendering of text, inline objects, and decorations such as underlines. </summary>

Members

Functions

DrawGlyphRun
HRESULT DrawGlyphRun(void* clientDrawingContext, FLOAT baselineOriginX, FLOAT baselineOriginY, DWRITE_GLYPH_ORIENTATION_ANGLE orientationAngle, DWRITE_MEASURING_MODE measuringMode, const(DWRITE_GLYPH_RUN)* glyphRun, const(DWRITE_GLYPH_RUN_DESCRIPTION)* glyphRunDescription, IUnknown clientDrawingEffect)

<summary> IDWriteTextLayout::Draw calls this function to instruct the client to render a run of glyphs. </summary> <param name="clientDrawingContext">The context passed to IDWriteTextLayout::Draw.</param> <param name="baselineOriginX">X-coordinate of the baseline.</param> <param name="baselineOriginY">Y-coordinate of the baseline.</param> <param name="orientationAngle">Orientation of the glyph run.</param> <param name="measuringMode">Specifies measuring method for glyphs in the run. Renderer implementations may choose different rendering modes for given measuring methods, but best results are seen when the rendering mode matches the corresponding measuring mode: DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL for DWRITE_MEASURING_MODE_NATURAL DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC for DWRITE_MEASURING_MODE_GDI_CLASSIC DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL for DWRITE_MEASURING_MODE_GDI_NATURAL </param> <param name="glyphRun">The glyph run to draw.</param> <param name="glyphRunDescription">Properties of the characters associated with this run.</param> <param name="clientDrawingEffect">The drawing effect set in IDWriteTextLayout::SetDrawingEffect.</param> <returns> Standard HRESULT error code. </returns> <remarks> If a non-identity orientation is passed, the glyph run should be rotated around the given baseline x and y coordinates. The function IDWriteAnalyzer2::GetGlyphOrientationTransform will return the necessary transform for you, which can be combined with any existing world transform on the drawing context. </remarks>

DrawInlineObject
HRESULT DrawInlineObject(void* clientDrawingContext, FLOAT originX, FLOAT originY, DWRITE_GLYPH_ORIENTATION_ANGLE orientationAngle, IDWriteInlineObject inlineObject, BOOL isSideways, BOOL isRightToLeft, IUnknown clientDrawingEffect)

<summary> IDWriteTextLayout::Draw calls this application callback when it needs to draw an inline object. </summary> <param name="clientDrawingContext">The context passed to IDWriteTextLayout::Draw.</param> <param name="originX">X-coordinate at the top-left corner of the inline object.</param> <param name="originY">Y-coordinate at the top-left corner of the inline object.</param> <param name="orientationAngle">Orientation of the inline object.</param> <param name="inlineObject">The object set using IDWriteTextLayout::SetInlineObject.</param> <param name="isSideways">The object should be drawn on its side.</param> <param name="isRightToLeft">The object is in an right-to-left context and should be drawn flipped.</param> <param name="clientDrawingEffect">The drawing effect set in IDWriteTextLayout::SetDrawingEffect.</param> <returns> Standard HRESULT error code. </returns> <remarks> The right-to-left flag is a hint to draw the appropriate visual for that reading direction. For example, it would look strange to draw an arrow pointing to the right to indicate a submenu. The sideways flag similarly hints that the object is drawn in a different orientation. If a non-identity orientation is passed, the top left of the inline object should be rotated around the given x and y coordinates. IDWriteAnalyzer2::GetGlyphOrientationTransform returns the necessary transform for this. </remarks>

DrawStrikethrough
HRESULT DrawStrikethrough(void* clientDrawingContext, FLOAT baselineOriginX, FLOAT baselineOriginY, DWRITE_GLYPH_ORIENTATION_ANGLE orientationAngle, const(DWRITE_STRIKETHROUGH)* strikethrough, IUnknown clientDrawingEffect)

<summary> IDWriteTextLayout::Draw calls this function to instruct the client to draw a strikethrough. </summary> <param name="clientDrawingContext">The context passed to IDWriteTextLayout::Draw.</param> <param name="baselineOriginX">X-coordinate of the baseline.</param> <param name="baselineOriginY">Y-coordinate of the baseline.</param> <param name="orientationAngle">Orientation of the strikethrough.</param> <param name="strikethrough">Strikethrough logical information.</param> <param name="clientDrawingEffect">The drawing effect set in IDWriteTextLayout::SetDrawingEffect.</param> <returns> Standard HRESULT error code. </returns> <remarks> A single strikethrough can be broken into multiple calls, depending on how the formatting changes attributes. Strikethrough is not averaged across font sizes/styles changes. To get the correct top coordinate of the strikethrough rect, add strikethrough::offset to the baseline's Y. Like underlines, the x coordinate will always be passed as the left side, regardless of text directionality. </remarks>

DrawUnderline
HRESULT DrawUnderline(void* clientDrawingContext, FLOAT baselineOriginX, FLOAT baselineOriginY, DWRITE_GLYPH_ORIENTATION_ANGLE orientationAngle, const(DWRITE_UNDERLINE)* underline, IUnknown clientDrawingEffect)

<summary> IDWriteTextLayout::Draw calls this function to instruct the client to draw an underline. </summary> <param name="clientDrawingContext">The context passed to IDWriteTextLayout::Draw.</param> <param name="baselineOriginX">X-coordinate of the baseline.</param> <param name="baselineOriginY">Y-coordinate of the baseline.</param> <param name="orientationAngle">Orientation of the underline.</param> <param name="underline">Underline logical information.</param> <param name="clientDrawingEffect">The drawing effect set in IDWriteTextLayout::SetDrawingEffect.</param> <returns> Standard HRESULT error code. </returns> <remarks> A single underline can be broken into multiple calls, depending on how the formatting changes attributes. If font sizes/styles change within an underline, the thickness and offset will be averaged weighted according to characters.

Meta