Luna::Font::IFontFile
Represents a font file that may contain one or multiple fonts.
interface Luna::Font::IFontFile : public virtual Interface
Base type
Member functions
-
virtual Span< const byte_t > get_data()=0
Gets the data of the font file.
-
Gets the number of fonts in the font file.
-
virtual glyph_t find_glyph(u32 font_index, u32 codepoint)=0
Gets the glyph index of the specified character in specified font.
-
virtual f32 scale_for_pixel_height(u32 font_index, f32 pixels)=0
Computes a scale factor to produce a font whose "height" is
pixels
tall. -
virtual void get_vmetrics(u32 font_index, i32 ascent, i32 descent, i32 *line_gap)=0
Gets the metrics information for a font in the vertical side.
-
Gets the metrics information for a glyph in the horizontal side.
-
virtual i32 get_kern_advance(u32 font_index, glyph_t ch1, glyph_t ch2)=0
Gets an additional amount to add to the 'advance' value between ch1 and ch2.
-
virtual void get_glyph_shape(u32 font_index, glyph_t glyph, Vector< i16 > &out_commands)=0
Gets commands in order to draw the specified glyph in unscaled space.
-
virtual RectI get_glyph_bounding_box(u32 font_index, glyph_t glyph)=0
Gets the bounding box of the visible part of the glyph.
-
Gets the bounding box of the bitmap centered around the glyph origin.
-
Renders a bitmap of the specified glyph into the buffer specified by the
output
., whereout_w
andout_h
is the width and height.