1
0
mirror of https://github.com/ncblakely/GiantsTools synced 2024-11-22 22:25:37 +01:00
GiantsTools/Sdk/External/DirectXTK/MakeSpriteFont/Glyph.cs

40 lines
960 B
C#
Raw Normal View History

2021-01-24 00:40:09 +01:00
// DirectXTK MakeSpriteFont tool
//
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
using System.Drawing;
namespace MakeSpriteFont
{
// Represents a single character within a font.
public class Glyph
{
// Constructor.
public Glyph(char character, Bitmap bitmap, Rectangle? subrect = null)
{
this.Character = character;
this.Bitmap = bitmap;
this.Subrect = subrect.GetValueOrDefault(new Rectangle(0, 0, bitmap.Width, bitmap.Height));
}
// Unicode codepoint.
public char Character;
// Glyph image data (may only use a portion of a larger bitmap).
public Bitmap Bitmap;
public Rectangle Subrect;
// Layout information.
public float XOffset;
public float YOffset;
public float XAdvance;
}
}