1. with Allegro.Bitmaps;                   use Allegro.Bitmaps; 
  2. with Allegro.Truecolor;                 use Allegro.Truecolor; 
  3. with Objects;                           use Objects; 
  4.  
  5. package Font_API is 
  6.  
  7.     -- Raises an exception on failure. 
  8.     procedure Initialize; 
  9.  
  10.     procedure Finalize; 
  11.  
  12.     ---------------------------------------------------------------------------- 
  13.  
  14.     type Abstract_Font is abstract new Limited_Object with private; 
  15.     type Font_Type is access all Abstract_Font'Class; 
  16.  
  17.     -- Raises an exception on error. 
  18.     function Load_Font( filename : String; size : Positive ) return Font_Type; 
  19.     pragma Precondition( filename'Length > 0 ); 
  20.  
  21.     -- Returns the height in pixels of a string rendered with the font. 
  22.     function Text_Height( this : access Abstract_Font ) return Positive is abstract; 
  23.  
  24.     -- Returns the length in pixels of a string rendered with the font. 
  25.     function Text_Length( this : access Abstract_Font; 
  26.                           str  : String ) return Natural is abstract; 
  27.  
  28.     procedure Textout( this   : access Abstract_Font; 
  29.                        bmp    : A_Bitmap; 
  30.                        str    : String; 
  31.                        x, y   : Integer; 
  32.                        color  : Color_Type; 
  33.                        smooth : Boolean ) is abstract; 
  34.  
  35.     procedure Delete( this : in out Font_Type ); 
  36.     pragma Postcondition( this = null ); 
  37.  
  38.     FONT_EXCEPTION : exception; 
  39.  
  40. private 
  41.  
  42.     type Abstract_Font is abstract new Limited_Object with null record; 
  43.  
  44. end Font_API;