FontExtensions Class
Definition
Section titled “Definition”Extensions for IFont.
public static class FontExtensionsInheritance object
Methods
Section titled “Methods”GetRenderRect(IFont, int, int, Point)
Section titled “GetRenderRect(IFont, int, int, Point)”Returns a rectangle that is positioned and sized based on the font and the cell position specified.
public static Rectangle GetRenderRect(this IFont font, int x, int y, Point fontSize)Parameters
Section titled “Parameters”font IFont
Unused.
x int
The x-axis of the cell position.
y int
The y-axis of the cell position.
fontSize SadRogue.Primitives.Point
The size of the output cell.
Returns
Section titled “Returns”SadRogue.Primitives.Rectangle
A rectangle to representing a specific cell.
GetWorldPosition(IFont, Point, Point)
Section titled “GetWorldPosition(IFont, Point, Point)”Gets the pixel position of a cell position based on the font size.
public static Point GetWorldPosition(this IFont font, Point position, Point fontSize)Parameters
Section titled “Parameters”font IFont
Unused.
position SadRogue.Primitives.Point
The cell position to convert.
fontSize SadRogue.Primitives.Point
The size of the font used to calculate the pixel position.
Returns
Section titled “Returns”SadRogue.Primitives.Point
A new pixel-positioned point.
GetGlyphRatio(IFont, Point)
Section titled “GetGlyphRatio(IFont, Point)”Returns the ratio in size difference between the font’s glyph width and height.
public static (float X, float Y) GetGlyphRatio(this IFont font, Point fontSize)Parameters
Section titled “Parameters”font IFont
Unused.
fontSize SadRogue.Primitives.Point
The glyph size of the font used.
Returns
Section titled “Returns”(float X, float Y)
A tuple with the names (X, Y) where X is the difference of width to height and Y is the difference of height to width.