Files
Voile/DaggerFramework/Source/Resources/Loaders/FontLoader.cs
2023-06-20 00:18:35 +02:00

19 lines
447 B
C#

namespace DaggerFramework.Resources;
public class FontLoader : IResourceLoader
{
public IEnumerable<string> SupportedExtensions => new string[]
{
"ttf"
};
public Type ResourceType => typeof(Font);
public Resource Load(string path)
{
byte[] fileBuffer = File.ReadAllBytes(path);
var result = new Font(path, fileBuffer);
result.BufferSize = fileBuffer.Length;
return result;
}
}