Class Factory4
- Namespace
- SharpDX.DirectWrite
- Assembly
- SharpDX.Direct2D1.dll
[Guid("4B0B5BD3-0797-4549-8AC5-FE915CC53856")]
public class Factory4 : Factory3
- Inheritance
-
Factory4
- Derived
- Inherited Members
Constructors
Factory4(nint)
public Factory4(nint nativePtr)
Parameters
nativePtr
nint
Methods
ComputeGlyphOrigins(GlyphRun, MeasuringMode, RawVector2, RawMatrix3x2?, RawVector2[])
Converts glyph run placements to glyph origins.
public void ComputeGlyphOrigins(GlyphRun glyphRun, MeasuringMode measuringMode, RawVector2 baselineOrigin, RawMatrix3x2? worldAndDpiTransform, RawVector2[] glyphOrigins)
Parameters
glyphRun
GlyphRunStructure containing the properties of the glyph run.
measuringMode
MeasuringModeThe measuring method for glyphs in the run, used with the other properties to determine the rendering mode.
baselineOrigin
RawVector2The position of the baseline origin, in DIPs, relative to the upper-left corner of the DIB.
worldAndDpiTransform
RawMatrix3x2?World transform multiplied by any DPI scaling. This is needed to compute glyph positions if the run contains color glyphs and the measuring mode is not DWRITE_MEASURING_MODE_NATURAL. If this parameter is
null
, and identity transform is assumed.glyphOrigins
RawVector2[]On return contains the glyph origins for the glyphrun.
Remarks
The transform and DPI have no effect on the origin scaling. They are solely used to compute glyph advances when not supplied and align glyphs in pixel aligned measuring modes.
ComputeGlyphOrigins(GlyphRun, RawVector2, RawVector2[])
Converts glyph run placements to glyph origins.
public void ComputeGlyphOrigins(GlyphRun glyphRun, RawVector2 baselineOrigin, RawVector2[] glyphOrigins)
Parameters
glyphRun
GlyphRunStructure containing the properties of the glyph run.
baselineOrigin
RawVector2The position of the baseline origin, in DIPs, relative to the upper-left corner of the DIB.
glyphOrigins
RawVector2[]On return contains the glyph origins for the glyphrun.
Remarks
The transform and DPI have no effect on the origin scaling. They are solely used to compute glyph advances when not supplied and align glyphs in pixel aligned measuring modes.
TranslateColorGlyphRun(RawVector2, GlyphRun, GlyphRunDescription, GlyphImageFormatS, MeasuringMode, RawMatrix3x2?, int, out ColorGlyphRunEnumerator1)
Translates a glyph run to a sequence of color glyph runs, which can be rendered to produce a color representation of the original "base" run.
public void TranslateColorGlyphRun(RawVector2 baselineOrigin, GlyphRun glyphRun, GlyphRunDescription glyphRunDescription, GlyphImageFormatS desiredGlyphImageFormats, MeasuringMode measuringMode, RawMatrix3x2? worldAndDpiTransform, int colorPaletteIndex, out ColorGlyphRunEnumerator1 colorLayers)
Parameters
baselineOrigin
RawVector2Horizontal and vertical origin of the base glyph run in pre-transform coordinates.
glyphRun
GlyphRunPointer to the original "base" glyph run.
glyphRunDescription
GlyphRunDescriptionOptional glyph run description.
desiredGlyphImageFormats
GlyphImageFormatSWhich data formats the runs should be split into.
measuringMode
MeasuringModeMeasuring mode, needed to compute the origins of each glyph.
worldAndDpiTransform
RawMatrix3x2?Matrix converting from the client's coordinate space to device coordinates (pixels), i.e., the world transform multiplied by any DPI scaling.
colorPaletteIndex
intZero-based index of the color palette to use. Valid indices are less than the number of palettes in the font, as returned by IDWriteFontFace2::GetColorPaletteCount.
colorLayers
ColorGlyphRunEnumerator1If the function succeeds, receives a reference to an enumerator object that can be used to obtain the color glyph runs. If the base run has no color glyphs, then the output reference is
null
and the method returns DWRITE_E_NOCOLOR.
Remarks
Calling IDWriteFactory2::TranslateColorGlyphRun is equivalent to calling IDWriteFactory4::TranslateColorGlyph run with the following formats specified: DWRITE_GLYPH_IMAGE_FORMATS_TRUETYPE|DWRITE_GLYPH_IMAGE_FORMATS_CFF|DWRITE_GLYPH_IMAGE_FORMATS_COLR.
Operators
explicit operator Factory4(nint)
public static explicit operator Factory4(nint nativePtr)
Parameters
nativePtr
nint