[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

rpms/mozilla/devel firefox-1.0-pango-cairo.patch, NONE, 1.1 mozilla.spec, 1.70, 1.71



Author: caillon

Update of /cvs/dist/rpms/mozilla/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv29456

Modified Files:
	mozilla.spec 
Added Files:
	firefox-1.0-pango-cairo.patch 
Log Message:
* Wed Jul 20 2005 Christopher Aillon <caillon redhat com> 37:1.7.10-3
- Add firefox-1.0-pango-cairo.patch to get rid of the last few Xft
  references, fixing the "no fonts" problem.


firefox-1.0-pango-cairo.patch:
 nsFontMetricsPango.cpp |   46 ++++++++++++++++++++++++----------------------
 1 files changed, 24 insertions(+), 22 deletions(-)

--- NEW FILE firefox-1.0-pango-cairo.patch ---
--- mozilla/gfx/src/gtk/nsFontMetricsPango.cpp.foo2	2005-06-20 13:12:24.000000000 -0400
+++ mozilla/gfx/src/gtk/nsFontMetricsPango.cpp	2005-06-20 10:16:59.000000000 -0400
@@ -53,7 +53,6 @@
 #include "nsUnicharUtils.h"
 #include "nsQuickSort.h"
 
-#include <pango/pangoxft.h>
 #include <fontconfig/fontconfig.h>
 #include <gdk/gdk.h>
 #include <gdk/gdkx.h>
@@ -301,12 +300,11 @@
 
     // Get our font face
     FT_Face face;
+    face = pango_fc_font_lock_face(fcfont);
+    if (!face)
+    	return NS_ERROR_NOT_AVAILABLE;
+    	
     TT_OS2 *os2;
-    XftFont *xftFont = pango_xft_font_get_font(PANGO_FONT(fcfont));
-    if (!xftFont)
-        return NS_ERROR_NOT_AVAILABLE;
-
-    face = XftLockFace(xftFont);
     os2 = (TT_OS2 *) FT_Get_Sfnt_Table(face, ft_sfnt_os2);
 
     // mEmHeight (size in pixels of EM height)
@@ -318,10 +316,12 @@
     mEmHeight = PR_MAX(1, nscoord(size * f));
 
     // mMaxAscent
-    mMaxAscent = nscoord(xftFont->ascent * f);
+    val = MOZ_FT_TRUNC(face->size->metrics.ascender);
+    mMaxAscent = NSToIntRound(val * f);
 
     // mMaxDescent
-    mMaxDescent = nscoord(xftFont->descent * f);
+    val = -MOZ_FT_TRUNC(face->size->metrics.descender);
+    mMaxDescent = NSToIntRound(val * f);
 
     nscoord lineHeight = mMaxAscent + mMaxDescent;
 
@@ -341,7 +341,8 @@
     mEmDescent = mEmHeight - mEmAscent;
 
     // mMaxAdvance
-    mMaxAdvance = nscoord(xftFont->max_advance_width * f);
+    val = MOZ_FT_TRUNC(face->size->metrics.max_advance);
+    mMaxAdvance = NSToIntRound(val * f);
 
     // mPangoSpaceWidth
     PangoLayout *layout = pango_layout_new(mPangoContext);
@@ -364,17 +365,16 @@
     mAveCharWidth = tmpWidth;
 
     // mXHeight (height of an 'x' character)
-    PRUnichar xUnichar('x');
-    XGlyphInfo extents;
-    if (FcCharSetHasChar(xftFont->charset, xUnichar)) {
-        XftTextExtents16(GDK_DISPLAY(), xftFont, &xUnichar, 1, &extents);
-        mXHeight = extents.height;
+    if (pango_fc_font_has_char(fcfont, 'x')) {
+        PangoRectangle rect;
+        PangoGlyph glyph = pango_fc_font_get_glyph (fcfont, 'x');
+        pango_font_get_glyph_extents (PANGO_FONT (fcfont), glyph, &rect, NULL);
+        mXHeight = NSToIntRound(rect.height * f / PANGO_SCALE);
     }
     else {
         // 56% of ascent, best guess for non-true type or asian fonts
-        mXHeight = nscoord(((float)mMaxAscent) * 0.56);
+        mXHeight = nscoord(((float)mMaxAscent) * 0.56 * f);
     }
-    mXHeight = nscoord(mXHeight * f);
 
     // mUnderlineOffset (offset for underlines)
     val = CONVERT_DESIGN_UNITS_TO_PIXELS(face->underline_position,
@@ -384,7 +394,8 @@
     }
     else {
         mUnderlineOffset =
-            -NSToIntRound(PR_MAX(1, floor(0.1 * xftFont->height + 0.5)) * f);
+            -NSToIntRound(PR_MAX(1, floor(0.1 *
+                MOZ_FT_TRUNC(face->size->metrics.height) + 0.5)) * f);
     }
 
     // mUnderlineSize (thickness of an underline)
@@ -395,7 +406,8 @@
     }
     else {
         mUnderlineSize =
-            NSToIntRound(PR_MAX(1, floor(0.05 * xftFont->height + 0.5)) * f);
+            NSToIntRound(PR_MAX(1,
+               floor(0.05 * MOZ_FT_TRUNC(face->size->metrics.height) + 0.5)) * f);
     }
 
     // mSuperscriptOffset
@@ -426,7 +438,7 @@
     // mStrikeoutSize
     mStrikeoutSize = mUnderlineSize;
 
-    XftUnlockFace(xftFont);
+    pango_fc_font_unlock_face(fcfont);
 
     /*
     printf("%i\n", mXHeight);
@@ -893,7 +905,7 @@
 {
     if (aIsRTL) {
         if (!mRTLPangoContext) {
-            mRTLPangoContext = pango_xft_get_context(GDK_DISPLAY(), 0);
+            mRTLPangoContext = gdk_pango_context_get();
             pango_context_set_base_dir(mRTLPangoContext, PANGO_DIRECTION_RTL);
 
             gdk_pango_context_set_colormap(mRTLPangoContext, gdk_rgb_get_cmap());
@@ -1163,7 +1175,7 @@
     NS_ConvertUCS2toUTF8 name(aName);
 
     nsresult rv = NS_ERROR_FAILURE;
-    PangoContext *context = pango_xft_get_context(GDK_DISPLAY(), 0);
+    PangoContext *context = gdk_pango_context_get();
     PangoFontFamily **familyList;
     int n;
 
@@ -1262,7 +1274,7 @@
 
     // Now that we have the font description set up, create the
     // context.
-    mLTRPangoContext = pango_xft_get_context(GDK_DISPLAY(), 0);
+    mLTRPangoContext = gdk_pango_context_get();
     mPangoContext = mLTRPangoContext;
 
     // Make sure to set the base direction to LTR - if layout needs to


Index: mozilla.spec
===================================================================
RCS file: /cvs/dist/rpms/mozilla/devel/mozilla.spec,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -r1.70 -r1.71
--- mozilla.spec	20 Jul 2005 02:37:12 -0000	1.70
+++ mozilla.spec	20 Jul 2005 16:21:09 -0000	1.71
@@ -10,7 +10,7 @@
 Name:        mozilla
 Summary:     Web browser and mail reader
 Version:     1.7.10
-Release:     2
+Release:     3
 Epoch:       37
 License:     MPL/NPL/GPL/LGPL
 Source0:     mozilla-%{version}-source.tar.bz2
@@ -54,6 +54,7 @@
 Patch33:     firefox-1.0-pango-rounding.patch
 Patch34:     firefox-1.0-pango-direction.patch
 Patch35:     firefox-1.0-pango-bidi-justify.patch
+Patch36:     firefox-1.0-pango-cairo.patch
 
 Patch91:     mozilla-1.7.3-gtk-file-chooser-trunk.patch
 Patch92:     mozilla-1.7.3-gtk-file-chooser-updates.patch
@@ -195,6 +196,7 @@
 %patch33 -p1
 %patch34 -p1
 %patch35 -p0
+%patch36 -p1
 
 # GTK+ File Chooser
 %patch91 -p0
@@ -792,6 +794,10 @@
 %{mozdir}/xpt_link
 
 %changelog
+* Wed Jul 20 2005 Christopher Aillon <caillon redhat com> 37:1.7.10-3
+- Add firefox-1.0-pango-cairo.patch to get rid of the last few Xft
+  references, fixing the "no fonts" problem.
+
 * Tue Jul 19 2005 Christopher Aillon <caillon redhat com> 37:1.7.10-2
 - Mozilla 1.7.10
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]