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; }
|
|
|
|
|
2022-08-19 15:13:19 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Location of the glyph on the atlas.
|
|
|
|
/// </summary>
|
2023-06-29 09:42:02 +02:00
|
|
|
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>
|
2023-06-29 09:42:02 +02:00
|
|
|
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>
|
2023-06-29 09:42:02 +02:00
|
|
|
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>
|
2023-06-29 09:42:02 +02:00
|
|
|
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>
|
2023-06-29 09:42:02 +02:00
|
|
|
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-06-29 09:42:02 +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;
|
2022-08-19 15:13:19 +02:00
|
|
|
Location = location;
|
|
|
|
Size = size;
|
|
|
|
HorizontalBearing = horizontalBearing;
|
|
|
|
VerticalBearing = verticalBearing;
|
|
|
|
Advance = advance;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|