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. pragma Ada_2005; 
  25.  
  26. pragma Warnings (Off, "*is already use-visible*"); 
  27. with Glib; use Glib; 
  28.  
  29. package Pango.Font_Metrics is 
  30.  
  31.    type Pango_Font_Metrics is new Glib.C_Boxed with null record; 
  32.    Null_Pango_Font_Metrics : constant Pango_Font_Metrics; 
  33.  
  34.    function From_Object (Object : System.Address) return Pango_Font_Metrics; 
  35.    function From_Object_Free (B : access Pango_Font_Metrics'Class) return Pango_Font_Metrics; 
  36.    pragma Inline (From_Object_Free, From_Object); 
  37.  
  38.    ------------------ 
  39.    -- Constructors -- 
  40.    ------------------ 
  41.  
  42.    function Get_Type return Glib.GType; 
  43.    pragma Import (C, Get_Type, "pango_font_metrics_get_type"); 
  44.  
  45.    ------------- 
  46.    -- Methods -- 
  47.    ------------- 
  48.  
  49.    function Get_Approximate_Char_Width 
  50.       (Self : Pango_Font_Metrics) return Gint; 
  51.    --  Gets the approximate character width for a font metrics structure. This 
  52.    --  is merely a representative value useful, for example, for determining 
  53.    --  the initial size for a window. Actual characters in text will be wider 
  54.    --  and narrower than this. 
  55.  
  56.    function Get_Approximate_Digit_Width 
  57.       (Self : Pango_Font_Metrics) return Gint; 
  58.    --  Gets the approximate digit width for a font metrics structure. This is 
  59.    --  merely a representative value useful, for example, for determining the 
  60.    --  initial size for a window. Actual digits in text can be wider or 
  61.    --  narrower than this, though this value is generally somewhat more 
  62.    --  accurate than the result of 
  63.    --  Pango.Font_Metrics.Get_Approximate_Char_Width for digits. 
  64.  
  65.    function Get_Ascent (Self : Pango_Font_Metrics) return Gint; 
  66.    --  Gets the ascent from a font metrics structure. The ascent is the 
  67.    --  distance from the baseline to the logical top of a line of text. (The 
  68.    --  logical top may be above or below the top of the actual drawn ink. It is 
  69.    --  necessary to lay out the text to figure where the ink will be.) 
  70.  
  71.    function Get_Descent (Self : Pango_Font_Metrics) return Gint; 
  72.    --  Gets the descent from a font metrics structure. The descent is the 
  73.    --  distance from the baseline to the logical bottom of a line of text. (The 
  74.    --  logical bottom may be above or below the bottom of the actual drawn ink. 
  75.    --  It is necessary to lay out the text to figure where the ink will be.) 
  76.  
  77.    function Get_Strikethrough_Position 
  78.       (Self : Pango_Font_Metrics) return Gint; 
  79.    --  Gets the suggested position to draw the strikethrough. The value 
  80.    --  returned is the distance *above* the baseline of the top of the 
  81.    --  strikethrough. 
  82.    --  Since: gtk+ 1.6 
  83.  
  84.    function Get_Strikethrough_Thickness 
  85.       (Self : Pango_Font_Metrics) return Gint; 
  86.    --  Gets the suggested thickness to draw for the strikethrough. 
  87.    --  Since: gtk+ 1.6 
  88.  
  89.    function Get_Underline_Position (Self : Pango_Font_Metrics) return Gint; 
  90.    --  Gets the suggested position to draw the underline. The value returned 
  91.    --  is the distance *above* the baseline of the top of the underline. Since 
  92.    --  most fonts have underline positions beneath the baseline, this value is 
  93.    --  typically negative. 
  94.    --  Since: gtk+ 1.6 
  95.  
  96.    function Get_Underline_Thickness (Self : Pango_Font_Metrics) return Gint; 
  97.    --  Gets the suggested thickness to draw for the underline. 
  98.    --  Since: gtk+ 1.6 
  99.  
  100.    function Ref (Self : Pango_Font_Metrics) return Pango_Font_Metrics; 
  101.    --  Increase the reference count of a font metrics structure by one. 
  102.  
  103.    procedure Unref (Self : Pango_Font_Metrics); 
  104.    --  Decrease the reference count of a font metrics structure by one. If the 
  105.    --  result is zero, frees the structure and any associated memory. 
  106.  
  107. private 
  108.  
  109.    Null_Pango_Font_Metrics : constant Pango_Font_Metrics := (Glib.C_Boxed with null record); 
  110.  
  111. end Pango.Font_Metrics;