1 module d2d.font.ifont; 2 3 import d2d; 4 5 /// Interface for font loaders. 6 interface IFont : IDisposable, IVerifiable 7 { 8 /// Loads the font from a file. Size may not do anything with bitmap fonts, use IText.scale instead! 9 void load(string file, int sizeInPt); 10 11 /// Renders a string to an IText. 12 IText render(string text, float scale = 1.0f); 13 14 /// Renders a multiline string to an IText. 15 IText renderMultiline(string text, float scale = 1.0f); 16 17 /// Returns the dimensions of a string with this font. 18 vec2 measureText(string text, float scale = 1.0f); 19 20 /// Returns the dimensions of a multiline string with this font. 21 vec2 measureTextMultiline(string text, float scale = 1.0f); 22 }