Files
Voile/DaggerFramework/Source/Resources/Loaders/FontLoader.cs

17 lines
402 B
C#

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