1. ------------------------------------------------------------------------------ 
  2. --                                                                          -- 
  3. --      Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet       -- 
  4. --                     Copyright (C) 2000-2014, AdaCore                     -- 
  5. --                                                                          -- 
  6. -- This library is free software;  you can redistribute it and/or modify it -- 
  7. -- under terms of the  GNU General Public License  as published by the Free -- 
  8. -- Software  Foundation;  either version 3,  or (at your  option) any later -- 
  9. -- version. This library is distributed in the hope that it will be useful, -- 
  10. -- but WITHOUT ANY WARRANTY;  without even the implied warranty of MERCHAN- -- 
  11. -- TABILITY or FITNESS FOR A PARTICULAR PURPOSE.                            -- 
  12. --                                                                          -- 
  13. -- As a special exception under Section 7 of GPL version 3, you are granted -- 
  14. -- additional permissions described in the GCC Runtime Library Exception,   -- 
  15. -- version 3.1, as published by the Free Software Foundation.               -- 
  16. --                                                                          -- 
  17. -- You should have received a copy of the GNU General Public License and    -- 
  18. -- a copy of the GCC Runtime Library Exception along with this program;     -- 
  19. -- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    -- 
  20. -- <http://www.gnu.org/licenses/>.                                          -- 
  21. --                                                                          -- 
  22. ------------------------------------------------------------------------------ 
  23.  
  24. --  <description> 
  25. --  An object that represents the set of fonts available for a particular 
  26. --  rendering system 
  27. -- 
  28. --  </description> 
  29. pragma Ada_2005; 
  30.  
  31. pragma Warnings (Off, "*is already use-visible*"); 
  32. with Glib;              use Glib; 
  33. with Glib.Object;       use Glib.Object; 
  34. with Pango.Context;     use Pango.Context; 
  35. with Pango.Font;        use Pango.Font; 
  36. with Pango.Font_Family; use Pango.Font_Family; 
  37. with Pango.Fontset;     use Pango.Fontset; 
  38. with Pango.Language;    use Pango.Language; 
  39.  
  40. package Pango.Font_Map is 
  41.  
  42.    type Pango_Font_Map_Record is new GObject_Record with null record; 
  43.    type Pango_Font_Map is access all Pango_Font_Map_Record'Class; 
  44.  
  45.    ------------------ 
  46.    -- Constructors -- 
  47.    ------------------ 
  48.  
  49.    function Get_Type return Glib.GType; 
  50.    pragma Import (C, Get_Type, "pango_font_map_get_type"); 
  51.  
  52.    ------------- 
  53.    -- Methods -- 
  54.    ------------- 
  55.  
  56.    function Create_Context 
  57.       (Self : not null access Pango_Font_Map_Record) 
  58.        return Pango.Context.Pango_Context; 
  59.    --  Creates a Pango.Context.Pango_Context connected to Fontmap. This is 
  60.    --  equivalent to Pango.Context.Gdk_New followed by 
  61.    --  pango_context_set_font_map. 
  62.    --  If you are using Pango as part of a higher-level system, that system 
  63.    --  may have it's own way of create a Pango.Context.Pango_Context. For 
  64.    --  instance, the GTK+ toolkit has, among others, 
  65.    --  gdk_pango_context_get_for_screen, and Gtk.Widget.Get_Pango_Context. Use 
  66.    --  those instead. 
  67.    --  Since: gtk+ 1.22 
  68.  
  69.    function Get_Serial 
  70.       (Self : not null access Pango_Font_Map_Record) return Guint; 
  71.    --  Returns the current serial number of Fontmap. The serial number is 
  72.    --  initialized to an small number larger than zero when a new fontmap is 
  73.    --  created and is increased whenever the fontmap is changed. It may wrap, 
  74.    --  but will never have the value 0. Since it can wrap, never compare it 
  75.    --  with "less than", always use "not equals". 
  76.    --  The fontmap can only be changed using backend-specific API, like 
  77.    --  changing fontmap resolution. 
  78.    --  This can be used to automatically detect changes to a 
  79.    --  Pango.Font_Map.Pango_Font_Map, like in Pango.Context.Pango_Context. 
  80.    --  Since: gtk+ 1.32.4 
  81.  
  82.    function List_Families 
  83.       (Self : not null access Pango_Font_Map_Record) 
  84.        return Pango_Font_Family_Array; 
  85.    --  List all families for a fontmap. 
  86.  
  87.    function Load_Font 
  88.       (Self    : not null access Pango_Font_Map_Record; 
  89.        Context : not null access Pango.Context.Pango_Context_Record'Class; 
  90.        Desc    : Pango.Font.Pango_Font_Description) 
  91.        return Pango.Font.Pango_Font; 
  92.    --  Load the font in the fontmap that is the closest match for Desc. 
  93.    --  "context": the Pango.Context.Pango_Context the font will be used with 
  94.    --  "desc": a Pango.Font.Pango_Font_Description describing the font to load 
  95.  
  96.    function Load_Fontset 
  97.       (Self     : not null access Pango_Font_Map_Record; 
  98.        Context  : not null access Pango.Context.Pango_Context_Record'Class; 
  99.        Desc     : Pango.Font.Pango_Font_Description; 
  100.        Language : Pango.Language.Pango_Language) 
  101.        return Pango.Fontset.Pango_Fontset; 
  102.    --  Load a set of fonts in the fontmap that can be used to render a font 
  103.    --  matching Desc. 
  104.    --  "context": the Pango.Context.Pango_Context the font will be used with 
  105.    --  "desc": a Pango.Font.Pango_Font_Description describing the font to load 
  106.    --  "language": a Pango.Language.Pango_Language the fonts will be used for 
  107.  
  108. end Pango.Font_Map;