1. private with Allegro.Fonts; 
  2.  
  3. private package Font_API.Allegro_Fonts is 
  4.  
  5.     -- Attempts to load an Allegro format font from disk. Returns null if 
  6.     -- 'filename' can't be found or isn't a supported format. 
  7.     function Load_Font( filename : String; size : Positive ) return Font_Type; 
  8.     pragma Precondition( filename'Length > 0 ); 
  9.  
  10. private 
  11.  
  12.     use Allegro.Fonts; 
  13.  
  14.     type Allegro_Font is new Abstract_Font with 
  15.         record 
  16.             ptr    : Allegro.Fonts.A_Font := null; 
  17.             height : Positive := 1; 
  18.         end record; 
  19.  
  20.     -- Raises an exception on error loading 'filename'. 
  21.     procedure Construct( this     : access Allegro_Font; 
  22.                          filename : String; 
  23.                          size     : Positive ); 
  24.     pragma Precondition( filename'Length > 0 ); 
  25.  
  26.     procedure Delete( this : in out Allegro_Font ); 
  27.  
  28.     function Text_Height( this : access Allegro_Font ) return Positive; 
  29.  
  30.     function Text_Length( this : access Allegro_Font; 
  31.                           str  : String ) return Natural; 
  32.  
  33.     procedure Textout( this   : access Allegro_Font; 
  34.                        bmp    : A_Bitmap; 
  35.                        str    : String; 
  36.                        x, y   : Integer; 
  37.                        color  : Color_Type; 
  38.                        smooth : Boolean ); 
  39.  
  40. end Font_API.Allegro_Fonts;