? .ChangeLog.swp
? oldies
? pango-1.13.1.tar.gz
? rocksolid-pango-20060505.patch
? rocksolid-pango.patch
? examples/HEXBOX
? examples/TEST
? examples/TEST-ARABIC
? examples/TEST-LINE
? examples/TT
? examples/X
? examples/XX
? examples/a.png
? examples/b.png
? examples/c.png
? examples/cairosimple-ps
? examples/cairosimple-ps-hexbox
? examples/t.ps
? examples/test.png
? examples/test.ps
? examples/test2.ps
? modules/indic/mprefixups.loT
? pango/description
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/pango/ChangeLog,v
retrieving revision 1.1446
diff -u -p -d -r1.1446 ChangeLog
--- ChangeLog	22 May 2006 19:03:25 -0000	1.1446
+++ ChangeLog	22 May 2006 20:06:59 -0000
@@ -1,5 +1,20 @@
 2006-05-22  Behdad Esfahbod  <behdad@gnome.org>
 
+	* pango/fonts.c (pango_font_describe),
+	(pango_font_describe_with_absolute_size):
+	* pango/pango-font.h:
+	* pango/pango.def:
+	* pango/pangocairo-font.c (_pango_cairo_font_get_hex_box_info):
+	* pango/pangocairo-win32font.c (create_metrics_for_context):
+	* pango/pangofc-font.c (pango_fc_font_class_init),
+	(pango_fc_font_describe_absolute),
+	(pango_fc_font_create_metrics_for_context):
+	* pango/pangowin32.c (pango_win32_font_class_init),
+	(pango_win32_font_get_metrics), (pango_win32_font_describe),
+	(pango_win32_font_describe_absolute):
+
+2006-05-22  Behdad Esfahbod  <behdad@gnome.org>
+
 	Bug 339730 – Pango needlessly falls back away from a Type 1 font into
 	a TTF font
 
Index: docs/pango-sections.txt
===================================================================
RCS file: /cvs/gnome/pango/docs/pango-sections.txt,v
retrieving revision 1.70
diff -u -p -d -r1.70 pango-sections.txt
--- docs/pango-sections.txt	29 Apr 2006 19:40:53 -0000	1.70
+++ docs/pango-sections.txt	22 May 2006 20:06:59 -0000
@@ -197,6 +197,7 @@ PANGO_FONT
 PANGO_IS_FONT
 pango_font_find_shaper
 pango_font_describe
+pango_font_describe_with_absolute_size
 pango_font_get_coverage
 pango_font_get_glyph_extents
 pango_font_get_metrics
Index: pango/fonts.c
===================================================================
RCS file: /cvs/gnome/pango/pango/fonts.c,v
retrieving revision 1.96
diff -u -p -d -r1.96 fonts.c
--- pango/fonts.c	22 May 2006 19:03:26 -0000	1.96
+++ pango/fonts.c	22 May 2006 20:06:59 -0000
@@ -1106,7 +1106,9 @@ pango_font_init (PangoFont *font)
  * pango_font_describe:
  * @font: a #PangoFont
  * 
- * Returns a description of the font.
+ * Returns a description of the font, with font size set in points.
+ * Use pango_font_describe_with_absolute_size() if you want the font
+ * size in device units.
  * 
  * Return value: a newly-allocated #PangoFontDescription object.
  **/
@@ -1116,6 +1118,30 @@ pango_font_describe (PangoFont      *fon
   g_return_val_if_fail (font != NULL, NULL);
 
   return PANGO_FONT_GET_CLASS (font)->describe (font);
+}
+
+/**
+ * pango_font_describe_with_absolute_size:
+ * @font: a #PangoFont
+ * 
+ * Returns a description of the font, with absolute font size set
+ * (in device units). Use pango_font_describe() if you want the font
+ * size in points.
+ * 
+ * Return value: a newly-allocated #PangoFontDescription object.
+ **/
+PangoFontDescription *
+pango_font_describe_with_absolute_size (PangoFont      *font)
+{
+  g_return_val_if_fail (font != NULL, NULL);
+
+  if (G_UNLIKELY (!PANGO_FONT_GET_CLASS (font)->describe_absolute))
+    {
+      g_warning ("describe_absolute not implemented for this font class, report this as a bug");
+      return pango_font_describe (font);
+    }
+
+  return PANGO_FONT_GET_CLASS (font)->describe_absolute (font);
 }
 
 /**
Index: pango/pango-font.h
===================================================================
RCS file: /cvs/gnome/pango/pango/pango-font.h,v
retrieving revision 1.34
diff -u -p -d -r1.34 pango-font.h
--- pango/pango-font.h	17 Feb 2006 07:26:16 -0000	1.34
+++ pango/pango-font.h	22 May 2006 20:07:00 -0000
@@ -304,6 +304,7 @@ struct _PangoFontFaceClass
 GType                 pango_font_get_type          (void) G_GNUC_CONST;
 
 PangoFontDescription *pango_font_describe          (PangoFont        *font);
+PangoFontDescription *pango_font_describe_with_absolute_size (PangoFont        *font);
 PangoCoverage *       pango_font_get_coverage      (PangoFont        *font,
 						    PangoLanguage    *language);
 PangoEngineShape *    pango_font_find_shaper       (PangoFont        *font,
@@ -349,12 +350,12 @@ struct _PangoFontClass
   PangoFontMetrics *    (*get_metrics)        (PangoFont      *font,
 					       PangoLanguage  *language);
   PangoFontMap *        (*get_font_map)       (PangoFont      *font);
+  PangoFontDescription *(*describe_absolute)  (PangoFont      *font);
   /*< private >*/
 
   /* Padding for future expansion */
   void (*_pango_reserved1) (void);
   void (*_pango_reserved2) (void);
-  void (*_pango_reserved3) (void);
 };
 
 /* used for very rare and miserable situtations that we cannot even
Index: pango/pango.def
===================================================================
RCS file: /cvs/gnome/pango/pango/pango.def,v
retrieving revision 1.41
diff -u -p -d -r1.41 pango.def
--- pango/pango.def	31 Mar 2006 00:21:30 -0000	1.41
+++ pango/pango.def	22 May 2006 20:07:00 -0000
@@ -86,6 +86,7 @@ EXPORTS
 	pango_find_map
 	pango_find_paragraph_boundary
 	pango_font_describe
+	pango_font_describe_with_absolute_size
 	pango_font_description_better_match
 	pango_font_description_copy
 	pango_font_description_copy_static
Index: pango/pangocairo-font.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pangocairo-font.c,v
retrieving revision 1.23
diff -u -p -d -r1.23 pangocairo-font.c
--- pango/pangocairo-font.c	29 Apr 2006 23:09:12 -0000	1.23
+++ pango/pangocairo-font.c	22 May 2006 20:07:00 -0000
@@ -184,13 +184,8 @@ _pango_cairo_font_get_hex_box_info (Pang
 
     fontmap = pango_font_get_font_map ((PangoFont *)cfont);
 
-    desc = pango_font_describe ((PangoFont *)cfont);
+    desc = pango_font_describe_with_absolute_size ((PangoFont *)cfont);
     size = pango_font_description_get_size (desc) / (1.*PANGO_SCALE);
-    if (pango_font_description_get_size_is_absolute (desc))
-      {
-        int dpi = pango_cairo_font_map_get_resolution (PANGO_CAIRO_FONT_MAP (fontmap));
-        size = size * 72. / dpi;
-      }
 
     mini_desc = pango_font_description_new ();
     pango_font_description_set_family_static (mini_desc, "monospace");
@@ -201,12 +196,12 @@ _pango_cairo_font_get_hex_box_info (Pang
     if (is_hinted)
       {
 	mini_size = HINT_Y (mini_size);
-      }
 
-    if (mini_size < 5.0)
-      {
-	rows = 1;
-	mini_size = MIN (MAX (size - 1, 0), 5.0);
+	if (mini_size < 5.0)
+	  {
+	    rows = 1;
+	    mini_size = MIN (MAX (size - 1, 0), 5.0);
+	  }
       }
 
     pango_font_description_set_size (mini_desc, mini_size * PANGO_SCALE);
Index: pango/pangocairo-win32font.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pangocairo-win32font.c,v
retrieving revision 1.23
diff -u -p -d -r1.23 pangocairo-win32font.c
--- pango/pangocairo-win32font.c	31 Mar 2006 01:42:54 -0000	1.23
+++ pango/pangocairo-win32font.c	22 May 2006 20:07:00 -0000
@@ -308,7 +308,7 @@ create_metrics_for_context (PangoFont   
 				&metrics->strikethrough_position);
 
   layout = pango_layout_new (context);
-  font_desc = pango_font_describe (font);
+  font_desc = pango_font_describe_with_absolute_size (font);
   pango_layout_set_font_description (layout, font_desc);
   pango_layout_set_text (layout, sample_str, -1);      
   pango_layout_get_extents (layout, NULL, &extents);
Index: pango/pangofc-font.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pangofc-font.c,v
retrieving revision 1.38
diff -u -p -d -r1.38 pangofc-font.c
--- pango/pangofc-font.c	22 May 2006 00:25:20 -0000	1.38
+++ pango/pangofc-font.c	22 May 2006 20:07:00 -0000
@@ -83,6 +83,7 @@ static PangoFontMetrics *    pango_fc_fo
 							 PangoLanguage    *language);
 static PangoFontMap *        pango_fc_font_get_font_map (PangoFont        *font);
 static PangoFontDescription *pango_fc_font_describe     (PangoFont        *font);
+static PangoFontDescription *pango_fc_font_describe_absolute (PangoFont        *font);
 
 
 #define PANGO_FC_FONT_LOCK_FACE(font)	(PANGO_FC_FONT_GET_CLASS (font)->lock_face (font))
@@ -103,6 +104,7 @@ pango_fc_font_class_init (PangoFcFontCla
   object_class->finalize = pango_fc_font_finalize;
   object_class->set_property = pango_fc_font_set_property;
   font_class->describe = pango_fc_font_describe;
+  font_class->describe_absolute = pango_fc_font_describe_absolute;
   font_class->find_shaper = pango_fc_font_find_shaper;
   font_class->get_coverage = pango_fc_font_get_coverage;
   font_class->get_metrics = pango_fc_font_get_metrics;
@@ -227,6 +229,19 @@ pango_fc_font_describe (PangoFont *font)
   return pango_font_description_copy (fcfont->description);
 }
 
+static PangoFontDescription *
+pango_fc_font_describe_absolute (PangoFont *font)
+{
+  PangoFcFont *fcfont = (PangoFcFont *)font;
+  PangoFontDescription *desc = pango_font_description_copy (fcfont->description);
+  double size;
+
+  if (FcPatternGetDouble (fcfont->font_pattern, FC_PIXEL_SIZE, 0, &size) == FcResultMatch)
+    pango_font_description_set_absolute_size (desc, size * PANGO_SCALE);
+
+  return desc;
+}
+
 static PangoMap *
 pango_fc_get_shaper_map (PangoLanguage *language)
 {
@@ -401,13 +416,15 @@ pango_fc_font_create_metrics_for_context
   PangoRectangle extents;
   PangoLanguage *language = pango_context_get_language (context);
   const char *sample_str = pango_language_get_sample_string (language);
+  PangoFontDescription *desc = pango_font_describe_with_absolute_size (fcfont);
   
   metrics = pango_font_metrics_new ();
   
   get_face_metrics (fcfont, metrics);
   
   layout = pango_layout_new (context);
-  pango_layout_set_font_description (layout, fcfont->description);
+  pango_layout_set_font_description (layout, desc);
+  pango_font_description_free (desc);
   
   pango_layout_set_text (layout, sample_str, -1);      
   pango_layout_get_extents (layout, NULL, &extents);
Index: pango/pangowin32.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pangowin32.c,v
retrieving revision 1.70
diff -u -p -d -r1.70 pangowin32.c
--- pango/pangowin32.c	21 May 2006 23:37:10 -0000	1.70
+++ pango/pangowin32.c	22 May 2006 20:07:00 -0000
@@ -49,6 +49,7 @@ static void     pango_win32_font_real_do
 static double   pango_win32_font_real_get_metrics_factor (PangoFont *font);
 
 static PangoFontDescription *pango_win32_font_describe          (PangoFont        *font);
+static PangoFontDescription *pango_win32_font_describe_absolute (PangoFont        *font);
 static PangoCoverage        *pango_win32_font_get_coverage      (PangoFont        *font,
 								 PangoLanguage    *lang);
 static void                  pango_win32_font_calc_coverage     (PangoFont        *font,
@@ -200,6 +201,7 @@ pango_win32_font_class_init (PangoWin32F
   object_class->dispose = pango_win32_font_dispose;
   
   font_class->describe = pango_win32_font_describe;
+  font_class->describe_absolute = pango_win32_font_describe;
   font_class->get_coverage = pango_win32_font_get_coverage;
   font_class->find_shaper = pango_win32_font_find_shaper;
   font_class->get_glyph_extents = pango_win32_font_get_glyph_extents;
@@ -582,7 +584,7 @@ pango_win32_font_get_metrics (PangoFont 
 	      /*  Get the average width of the chars in "0123456789" */
 	      context = pango_win32_get_context ();
 	      pango_context_set_language (context, language);
-	      font_desc = pango_font_describe (font);
+	      font_desc = pango_font_describe_with_absolute_size (font);
 	      pango_context_set_font_description (context, font_desc);
 	      layout = pango_layout_new (context);
 	      pango_layout_set_text (layout, "0123456789", -1);
@@ -782,7 +784,19 @@ pango_win32_font_describe (PangoFont *fo
   PangoWin32Font *win32font = PANGO_WIN32_FONT (font);
 
   desc = pango_font_description_copy (win32font->win32face->description);
-  pango_font_description_set_size (desc, win32font->size);
+  pango_font_description_set_size (desc, win32font->size /* TODO */);
+  
+  return desc;
+}
+
+static PangoFontDescription *
+pango_win32_font_describe_absolute (PangoFont *font)
+{
+  PangoFontDescription *desc;
+  PangoWin32Font *win32font = PANGO_WIN32_FONT (font);
+
+  desc = pango_font_description_copy (win32font->win32face->description);
+  pango_font_description_set_absolute_size (desc, win32font->size);
   
   return desc;
 }
