Duality.Resources.Font.GetGlyphBitmap C# (CSharp) Method

GetGlyphBitmap() public method

Retrieves the rasterized System.Drawing.Bitmap for a single glyph.
public GetGlyphBitmap ( char glyph ) : Duality.Resources.Pixmap.Layer
glyph char The glyph of which to retrieve the Bitmap.
return Duality.Resources.Pixmap.Layer
        public Pixmap.Layer GetGlyphBitmap(char glyph)
        {
            Rect targetRect;
            int charIndex = (int)glyph > CharLookup.Length ? 0 : CharLookup[(int)glyph];
            this.pixelData.LookupAtlas(charIndex, out targetRect);
            Pixmap.Layer subImg = new Pixmap.Layer(
                MathF.RoundToInt(targetRect.W),
                MathF.RoundToInt(targetRect.H));
            this.pixelData.MainLayer.DrawOnto(subImg, BlendMode.Solid,
                -MathF.RoundToInt(targetRect.X),
                -MathF.RoundToInt(targetRect.Y));
            return subImg;
        }