1. -- 
  2. -- Copyright (c) 2012 Kevin Wellwood 
  3. -- All rights reserved. 
  4. -- 
  5. -- This source code is distributed under the Modified BSD License. For terms and 
  6. -- conditions, see license.txt. 
  7. -- 
  8.  
  9. private with Allegro.Fonts; 
  10.  
  11. private package Font_API.Allegro_Fonts is 
  12.  
  13.     -- Attempts to load an Allegro format font from disk. Returns null if 
  14.     -- 'filename' can't 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 Allegro.Fonts; 
  21.  
  22.     type Allegro_Font is new Abstract_Font with 
  23.         record 
  24.             ptr    : Allegro.Fonts.A_Font := null; 
  25.             height : Positive := 1; 
  26.         end record; 
  27.  
  28.     -- Raises an exception on error loading 'filename'. 
  29.     procedure Construct( this     : access Allegro_Font; 
  30.                          filename : String; 
  31.                          size     : Positive ); 
  32.     pragma Precondition( filename'Length > 0 ); 
  33.  
  34.     procedure Delete( this : in out Allegro_Font ); 
  35.  
  36.     function Text_Height( this : access Allegro_Font ) return Positive; 
  37.  
  38.     function Text_Length( this : access Allegro_Font; 
  39.                           str  : String ) return Natural; 
  40.  
  41.     procedure Textout( this   : access Allegro_Font; 
  42.                        bmp    : A_Bitmap; 
  43.                        str    : String; 
  44.                        x, y   : Integer; 
  45.                        color  : Color_Type; 
  46.                        smooth : Boolean ); 
  47.  
  48. end Font_API.Allegro_Fonts;