forked from ppy/osu-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ICharacterGlyph.cs
42 lines (36 loc) · 1.46 KB
/
ICharacterGlyph.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
namespace osu.Framework.Text
{
/// <summary>
/// Interface for an object that contains associated spacing information for a character.
/// </summary>
public interface ICharacterGlyph
{
/// <summary>
/// How much the current x-position should be moved for drawing. This should not adjust the cursor position.
/// </summary>
float XOffset { get; }
/// <summary>
/// How much the current y-position should be moved for drawing. This should not adjust the cursor position.
/// </summary>
float YOffset { get; }
/// <summary>
/// How much the current x-position should be moved after drawing a character.
/// </summary>
float XAdvance { get; }
/// <summary>
/// The position of the baseline in this glyph.
/// </summary>
float Baseline { get; }
/// <summary>
/// The character represented by this glyph.
/// </summary>
char Character { get; }
/// <summary>
/// Retrieves the kerning between this <see cref="CharacterGlyph"/> and the one prior to it.
/// </summary>
/// <param name="lastGlyph">The <see cref="CharacterGlyph"/> prior to this one.</param>
float GetKerning<T>(T lastGlyph) where T : ICharacterGlyph;
}
}