Class AddedGlyph
One glyph added by AddGlyphs(string): its raw pixel bytes plus the atlas placement the session reserved for it. The caller blits the bytes into its own texture.
public sealed class AddedGlyph
- Inheritance
-
AddedGlyph
- Inherited Members
Remarks
Blit contract: the glyph pixels go at (X + Padding.Left, Y + Padding.Up)
on page PageIndex — the same rule the atlas builder uses for full
generation. X/Y are the origin of the packed cell
(which includes padding); Char carries the padded cell dimensions.
Properties
Char
Ready-to-use BMFont char entry (padded dimensions, offsets, advance).
public CharEntry Char { get; }
Property Value
Codepoint
Unicode codepoint of the glyph.
public int Codepoint { get; }
Property Value
Height
Glyph bitmap height in pixels (unpadded).
public int Height { get; }
Property Value
PageIndex
Zero-based atlas page the glyph was placed on.
public int PageIndex { get; }
Property Value
Pitch
Bytes per row of RawPixels.
public int Pitch { get; }
Property Value
Pixels
The glyph as tightly-packed RGBA32 (Width * Height * 4 bytes),
ready for e.g. MonoGame's Texture2D.SetData. Grayscale glyphs are promoted to
white with the coverage value as alpha — the canonical Angelcode BMFont layout.
Computed lazily on first access and cached; callers that read only
RawPixels never pay for the expansion.
public byte[] Pixels { get; }
Property Value
- byte[]
PremultipliedPixels
The glyph as tightly-packed premultiplied RGBA32 (Width *
Height * 4 bytes) — each color channel scaled by its alpha, for
premultiplied-alpha pipelines such as MonoGame/XNA's default
BlendState.AlphaBlend; use Pixels with
BlendState.NonPremultiplied otherwise. Grayscale glyphs become
(a, a, a, a) — white coverage premultiplied by the coverage value.
Computed lazily on first access and cached; callers that read only
Pixels or RawPixels never pay for it.
public byte[] PremultipliedPixels { get; }
Property Value
- byte[]
RawFormat
Pixel format of RawPixels (usually Grayscale8).
public PixelFormat RawFormat { get; }
Property Value
RawPixels
The rasterization pipeline's own glyph buffer — zero-copy, in RawFormat with Pitch bytes per row. The fastest path for callers that can consume the native format directly. Treat as read-only.
public byte[] RawPixels { get; }
Property Value
- byte[]
Width
Glyph bitmap width in pixels (unpadded).
public int Width { get; }
Property Value
X
X origin of the packed cell on the page.
public int X { get; }
Property Value
Y
Y origin of the packed cell on the page.
public int Y { get; }