Dashboard/Quik/Media/QGlyphMetrics.cs

54 lines
1.4 KiB
C#
Raw Normal View History

2023-06-29 13:17:32 +02:00
namespace Quik.Media
2022-08-19 15:13:19 +02:00
{
/// <summary>
/// Glyph properties with metrics based on FreeType glyph metrics.
/// </summary>
2023-06-29 13:17:32 +02:00
public struct QGlyphMetrics
2022-08-19 15:13:19 +02:00
{
/// <summary>
/// The code point for the character.
/// </summary>
2023-06-29 13:17:32 +02:00
public int Rune { get; }
2023-09-22 18:30:17 +02:00
// /// <summary>
// /// Location of the glyph on the atlas.
// /// </summary>
// public QRectangle Location { get; }
2023-06-29 13:17:32 +02:00
2022-08-19 15:13:19 +02:00
/// <summary>
/// Size of the glyph in units.
/// </summary>
public QVec2 Size { get; }
2023-06-29 13:17:32 +02:00
2022-08-19 15:13:19 +02:00
/// <summary>
/// Bearing vector for horizontal layout.
/// </summary>
public QVec2 HorizontalBearing { get; }
2023-06-29 13:17:32 +02:00
2022-08-19 15:13:19 +02:00
/// <summary>
/// Bearing vector for vertical layout.
/// </summary>
public QVec2 VerticalBearing { get; }
2023-06-29 13:17:32 +02:00
2022-08-19 15:13:19 +02:00
/// <summary>
/// Advance vector for vertical and horizontal layouts.
/// </summary>
public QVec2 Advance { get; }
2022-08-19 15:13:19 +02:00
2023-06-29 13:17:32 +02:00
public QGlyphMetrics(
2022-08-19 15:13:19 +02:00
int character,
2023-09-22 18:30:17 +02:00
// QRectangle location,
QVec2 size,
QVec2 horizontalBearing,
QVec2 verticalBearing,
QVec2 advance)
2022-08-19 15:13:19 +02:00
{
2023-06-29 13:17:32 +02:00
Rune = character;
2023-09-22 18:30:17 +02:00
// Location = location;
2022-08-19 15:13:19 +02:00
Size = size;
HorizontalBearing = horizontalBearing;
VerticalBearing = verticalBearing;
Advance = advance;
}
}
}