ExtensionsFontHost Class
Definition
Section titled “Definition”Extension methods to handle editing SadFont objects.
public static class ExtensionsFontHostInheritance object
Methods
Section titled “Methods”Edit_EnableEditing(IFont)
Section titled “Edit_EnableEditing(IFont)”Converts the font’s backing texture into a render target, if it isn’t one.
public static void Edit_EnableEditing(this IFont font)Parameters
Section titled “Parameters”font IFont
The font being edited.
Edit_DisableEditing(IFont)
Section titled “Edit_DisableEditing(IFont)”Converts the font’s backing texture from a render target to a normal texture.
public static void Edit_DisableEditing(this IFont font)Parameters
Section titled “Parameters”font IFont
The font being edited.
Edit_AddRows(SadFont, int)
Section titled “Edit_AddRows(SadFont, int)”Adds the specified number of rows to the font. Creates a new backing texture object that is a render target. Is hardware accelerated.
public static void Edit_AddRows(this SadFont font, int count)Parameters
Section titled “Parameters”font SadFont
The font being edited.
count int
The number of rows.
Exceptions
Section titled “Exceptions”ArgumentOutOfRangeException
Thrown when the number is zero or less.
Edit_CopyGlyph_GPU(IFont, IFont, int, int)
Section titled “Edit_CopyGlyph_GPU(IFont, IFont, int, int)”Copies a glyph from one font index to another. Is hardware accelerated.
public static void Edit_CopyGlyph_GPU(this IFont font, IFont source, int glyphIndexFrom, int glyphIndexTo)Parameters
Section titled “Parameters”font IFont
The font being edited.
source IFont
The font that contains the source texture.
glyphIndexFrom int
The source glyph index.
glyphIndexTo int
The target glyph index.
Edit_CopyGlyph_GPU(IFont, IFont, int, int, Color)
Section titled “Edit_CopyGlyph_GPU(IFont, IFont, int, int, Color)”Copies a glyph from one font index to another. Is hardware accelerated.
public static void Edit_CopyGlyph_GPU(this IFont font, IFont source, int glyphIndexFrom, int glyphIndexTo, Color blendColor)Parameters
Section titled “Parameters”font IFont
The font being edited.
source IFont
The font that contains the source texture.
glyphIndexFrom int
The source glyph index.
glyphIndexTo int
The target glyph index.
blendColor Microsoft.Xna.Framework.Color
Color to apply while copying the glyph.
Edit_CopyGlyph_GPU(IFont, IFont, Rectangle, Rectangle)
Section titled “Edit_CopyGlyph_GPU(IFont, IFont, Rectangle, Rectangle)”Copies a glyph from one font index to another. Is hardware accelerated.
public static void Edit_CopyGlyph_GPU(this IFont font, IFont source, Rectangle glyphRectangleFrom, Rectangle glyphRectangleTo)Parameters
Section titled “Parameters”font IFont
The font being edited.
source IFont
The font that contains the source texture.
glyphRectangleFrom Microsoft.Xna.Framework.Rectangle
The source glyph rectangle.
glyphRectangleTo Microsoft.Xna.Framework.Rectangle
The target glyph rectangle.
Edit_CopyGlyph_GPU(IFont, IFont, Rectangle, Rectangle, Color)
Section titled “Edit_CopyGlyph_GPU(IFont, IFont, Rectangle, Rectangle, Color)”Copies a glyph from one font index to another. Is hardware accelerated.
public static void Edit_CopyGlyph_GPU(this IFont font, IFont source, Rectangle glyphRectangleFrom, Rectangle glyphRectangleTo, Color blendColor)Parameters
Section titled “Parameters”font IFont
The font being edited.
source IFont
The font that contains the source texture.
glyphRectangleFrom Microsoft.Xna.Framework.Rectangle
The source glyph rectangle.
glyphRectangleTo Microsoft.Xna.Framework.Rectangle
The target glyph rectangle.
blendColor Microsoft.Xna.Framework.Color
Color to apply while copying the glyph.
Edit_EraseGlyph_CPU(IFont, int, bool, ref Color[])
Section titled “Edit_EraseGlyph_CPU(IFont, int, bool, ref Color[])”Erases a glyph in the font by index.
public static void Edit_EraseGlyph_CPU(this IFont font, int glyphIndex, bool doSetPixels, ref Color[] cachedFontTexturePixels)Parameters
Section titled “Parameters”font IFont
The font being edited.
glyphIndex int
The glyph index to erase.
doSetPixels bool
When true, pushes the updated pixel buffer, cachedFontTexturePixels, to the font texture.
cachedFontTexturePixels SadRogue.Primitives.Color[]
A cached array of all the font’s texture pixels.
Edit_SetGlyph_CPU(IFont, int, Color[], bool, ref Color[])
Section titled “Edit_SetGlyph_CPU(IFont, int, Color[], bool, ref Color[])”Sets the pixels of a font glyph by index.
public static void Edit_SetGlyph_CPU(this IFont font, int glyphIndex, Color[] pixels, bool doSetPixels, ref Color[] cachedFontTexturePixels)Parameters
Section titled “Parameters”font IFont
The font being edited.
glyphIndex int
The index of the glyph to update.
pixels SadRogue.Primitives.Color[]
The pixels to set on the glyph.
doSetPixels bool
When true, pushes the updated pixel buffer, cachedFontTexturePixels, to the font texture.
cachedFontTexturePixels SadRogue.Primitives.Color[]
A cached array of all the font’s texture pixels.
Exceptions
Section titled “Exceptions”ArgumentOutOfRangeException
The pixels count doesn’t match the size of a font glyph.
Edit_GetGlyph_CPU(IFont, int, ref Color[])
Section titled “Edit_GetGlyph_CPU(IFont, int, ref Color[])”Returns a glyph’s pixels packaged into a SadRogue.Primitives.Color array.
public static Color[] Edit_GetGlyph_CPU(this IFont font, int glyphIndex, ref Color[] cachedFontTexturePixels)Parameters
Section titled “Parameters”font IFont
The font being edited.
glyphIndex int
The index of the glyph to get.
cachedFontTexturePixels SadRogue.Primitives.Color[]
A cached array of all the font’s texture pixels.
Returns
Section titled “Returns”SadRogue.Primitives.Color[]
The pixels of the glyph.