lowpoly-walking-simulator/directx11_hellovr/DirectXTK/MakeSpriteFont/Glyph.cs

44 lines
1.1 KiB
C#
Raw Permalink Normal View History

2024-11-14 11:54:38 +00:00
// DirectXTK MakeSpriteFont tool
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// 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;
}
}