mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Massive Namespace Cleanup (#1544)
* Removed the Interfaces folder. * All objects inside the GameObjects subfolders are now in the GameObjects namespace. * Added a Resharper DotSettings file to mark the GameObjects subfolders as not providing namespaces. * Simplified Robust.client.Graphics namespace. * Automated remove redundant using statements.
This commit is contained in:
78
Robust.Client/Graphics/IFontManager.cs
Normal file
78
Robust.Client/Graphics/IFontManager.cs
Normal file
@@ -0,0 +1,78 @@
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace Robust.Client.Graphics
|
||||
{
|
||||
public interface IFontManager
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
internal interface IFontManagerInternal : IFontManager
|
||||
{
|
||||
IFontFaceHandle Load(Stream stream);
|
||||
IFontInstanceHandle MakeInstance(IFontFaceHandle handle, int size);
|
||||
void Initialize();
|
||||
}
|
||||
|
||||
internal interface IFontFaceHandle
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
internal interface IFontInstanceHandle
|
||||
{
|
||||
|
||||
|
||||
Texture? GetCharTexture(Rune codePoint, float scale);
|
||||
Texture? GetCharTexture(char chr, float scale) => GetCharTexture((Rune) chr, scale);
|
||||
CharMetrics? GetCharMetrics(Rune codePoint, float scale);
|
||||
CharMetrics? GetCharMetrics(char chr, float scale) => GetCharMetrics((Rune) chr, scale);
|
||||
|
||||
int GetAscent(float scale);
|
||||
int GetDescent(float scale);
|
||||
int GetHeight(float scale);
|
||||
int GetLineHeight(float scale);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metrics for a single glyph in a font.
|
||||
/// Refer to https://www.freetype.org/freetype2/docs/glyphs/glyphs-3.html for more information.
|
||||
/// </summary>
|
||||
public readonly struct CharMetrics
|
||||
{
|
||||
/// <summary>
|
||||
/// The horizontal distance between the origin and the left of the drawn glyph.
|
||||
/// </summary>
|
||||
public readonly int BearingX;
|
||||
|
||||
/// <summary>
|
||||
/// The vertical distance between the origin and the top of the drawn glyph.
|
||||
/// </summary>
|
||||
public readonly int BearingY;
|
||||
|
||||
/// <summary>
|
||||
/// How much to advance the origin after drawing the glyph.
|
||||
/// </summary>
|
||||
public readonly int Advance;
|
||||
|
||||
/// <summary>
|
||||
/// The width of the drawn glyph.
|
||||
/// </summary>
|
||||
public readonly int Width;
|
||||
|
||||
/// <summary>
|
||||
/// The height of the drawn glyph.
|
||||
/// </summary>
|
||||
public readonly int Height;
|
||||
|
||||
public CharMetrics(int bearingX, int bearingY, int advance, int width, int height)
|
||||
{
|
||||
BearingX = bearingX;
|
||||
BearingY = bearingY;
|
||||
Advance = advance;
|
||||
Width = width;
|
||||
Height = height;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user