ID2D1DeviceContext4::GetSvgGlyphImage method (d2d1_3.h)

Retrieves an image of the SVG glyph from the color glyph cache. If the cache does not already contain the requested resource, it will be created. This method may be used to extend the lifetime of a glyph image even after it is evicted from the color glyph cache.

Syntax

HRESULT GetSvgGlyphImage(
                 D2D1_POINT_2F           glyphOrigin,
  [in]           IDWriteFontFace         *fontFace,
                 FLOAT                   fontEmSize,
                 UINT16                  glyphIndex,
                 BOOL                    isSideways,
  [in, optional] const D2D1_MATRIX_3X2_F *worldTransform,
  [in, optional] ID2D1Brush              *defaultFillBrush,
  [in, optional] ID2D1SvgGlyphStyle      *svgGlyphStyle,
                 UINT32                  colorPaletteIndex,
  [out]          D2D1_MATRIX_3X2_F       *glyphTransform,
  [out]          ID2D1CommandList        **glyphImage
);

Parameters

glyphOrigin

Type: D2D1_POINT_2F

Origin of the glyph.

[in] fontFace

Type: IDWriteFontFace*

Reference to a font face which contains font face type, appropriate file references, face identification data and various font data such as metrics, names and glyph outlines.

fontEmSize

Type: FLOAT

The specified font size affects the output glyphTransform, causing it to properly scale the glyph.

glyphIndex

Type: UINT16

Index of the glyph to retrieve.

isSideways

Type: BOOL

If true, specifies that glyphs are rotated 90 degrees to the left and vertical metrics are used. Vertical writing is achieved by specifying isSideways as true and rotating the entire run 90 degrees to the right via a rotate transform.

[in, optional] worldTransform

Type: const D2D1_MATRIX_3X2_F*

The transform to apply to the image.

[in, optional] defaultFillBrush

Type: ID2D1Brush*

Describes how the area is painted.

[in, optional] svgGlyphStyle

Type: ID2D1SvgGlyphStyle*

The values for context-fill, context-stroke, and context-value that are used when rendering SVG glyphs.

colorPaletteIndex

Type: UINT32

The index used to select a color palette within a color font. Note that this not the same as the paletteIndex in the DWRITE_COLOR_GLYPH_RUN struct, which is not relevant for SVG glyphs.

[out] glyphTransform

Type: D2D1_MATRIX_3X2_F*

Output transform, which transforms from the glyph's space to the same output space as the worldTransform. This includes the input glyphOrigin, the glyph's offset from the glyphOrigin, and any other required transformations.

[out] glyphImage

Type: ID2D1CommandList**

On completion, contains the retrieved glyph image.

Return value

Type: HRESULT

This method returns an HRESULT success or error code.

Requirements

Requirement Value
Target Platform Windows
Header d2d1_3.h
DLL D2d1.dll

See also

ID2D1DeviceContext4