mirror of
https://github.com/ncblakely/GiantsTools
synced 2024-11-22 22:25:37 +01:00
40 lines
960 B
C#
40 lines
960 B
C#
|
// 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;
|
||
|
}
|
||
|
}
|