1. private with Alfont; 
  2.  
  3. private package Font_API.Alfont_Fonts is 
  4.  
  5.     -- Initializes the AlFont API. This must be called before attempting to load 
  6.     -- a font. Raises an exception on error. 
  7.     procedure Initialize; 
  8.  
  9.     -- Finalizes the AlFont API. Call this on application exit. 
  10.     procedure Finalize; 
  11.  
  12.     -- Attempts to load 'filename' with AlFont. The AlFont API supports all 
  13.     -- formats that are supported by FreeType 2. Returns null if the file can't 
  14.     -- be found or isn't a supported format. 
  15.     function Load_Font( filename : String; size : Positive ) return Font_Type; 
  16.     pragma Precondition( filename'Length > 0 ); 
  17.  
  18. private 
  19.  
  20.     use Alfont; 
  21.  
  22.     type Alfont_Font is new Abstract_Font with 
  23.         record 
  24.             ptr : A_Alfont_Font := null; 
  25.         end record; 
  26.  
  27.     -- Raises an exception on error loading 'filename'. 
  28.     procedure Construct( this     : access Alfont_Font; 
  29.                          filename : String; 
  30.                          size     : Positive ); 
  31.  
  32.     procedure Delete( this : in out Alfont_Font ); 
  33.  
  34.     function Text_Height( this : access Alfont_Font ) return Positive; 
  35.  
  36.     function Text_Length( this : access Alfont_Font; 
  37.                           str  : String ) return Natural; 
  38.  
  39.     procedure Textout( this   : access Alfont_Font; 
  40.                        bmp    : A_Bitmap; 
  41.                        str    : String; 
  42.                        x, y   : Integer; 
  43.                        color  : Color_Type; 
  44.                        smooth : Boolean ); 
  45.  
  46. end Font_API.Alfont_Fonts;