Index

Package: Font_API

Description

package Font_API is

Classes

Abstract_Font (abstract)

type Abstract_Font is abstract new Limited_Object with private;

Ancestors:

Immediate Children:

Font_API.Alfont_Fonts.Alfont_Font
Font_API.Allegro_Fonts.Allegro_Font

Primitive operations:

Objects.Construct (Inherited)
Objects.Delete (Inherited)
Objects.To_String (Inherited)
An Abstract_Font represents a specific font of a specific size. Two Abstract_Font instances are required to work with the same font in two different font sizes.

Types

Font_Type

type Font_Type is access all Abstract_Font'Class;

Constants & Global variables

FONT_EXCEPTION

FONT_EXCEPTION : exception;
Raised by Initialize on error, or on failure to load a font. Check the exception's message for details.

Subprograms & Entries

Initialize

procedure Initialize;
Initializes the font system and each underlying font API (ex: AlFont/FreeType). An exception will be raised on error.

Finalize

procedure Finalize;
Finalizes the font system and each underlying font API that was previously initialized. If Initialize has not been called then this will have no effect.

Load_Font

function Load_Font
( filename: String;
size: Positive ) return Font_Type;
Loads a font from disk at a specific size. The file format will be automatically detected; it must be a supported font format. An exception will be raised on error.

Text_Height (abstract)

function Text_Height
( this: access Abstract_Font ) return Positive is abstract;
Returns the height in pixels of a string rendered with the font.

Text_Length (abstract)

function Text_Length
( this: access Abstract_Font;
str: String ) return Natural is abstract;
Returns the length in pixels of a string rendered with the font.

Textout (abstract)

procedure Textout
( this: access Abstract_Font;
bmp: A_Bitmap;
str: String;
x, y: Integer;
color: Color_Type;
smooth: Boolean ) is abstract;
Renders a string to a bitmap. 'color' is the color of the letters. If 'smooth' is True, the text will be antialiased if possible.

Delete

procedure Delete
( this: in out Font_Type );
Deletes a font.