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

[XaraXtreme-commits] Commit Complete



Commit by  : luke
Repository : xara
Revision   : 773
Date       : Wed Apr  5 15:26:03 BST 2006

Changed paths:
   M /Trunk/XaraLX/wxOil/fontbase.cpp
   M /Trunk/XaraLX/wxOil/ftfonts.cpp

Martin Wuerthners fixes for line spacing and character widths


Diff:
Index: Trunk/XaraLX/wxOil/ftfonts.cpp
===================================================================
--- Trunk/XaraLX/wxOil/ftfonts.cpp	(revision 772)
+++ Trunk/XaraLX/wxOil/ftfonts.cpp	(revision 773)
@@ -923,7 +923,7 @@
 	// get the design size
 	INT32 DesignSize = pFreeTypeFace->units_per_EM;
 	*pAscent = ScaleToDefaultHeight(pFreeTypeFace->ascender, DesignSize);
-	*pDescent = ScaleToDefaultHeight(pFreeTypeFace->descender, DesignSize);
+	*pDescent = ScaleToDefaultHeight(-pFreeTypeFace->descender, DesignSize);
 	TRACEUSER("wuerthne", _T("returning ascent = %d, descent = %d"), *pAscent, *pDescent);
 	pango_fc_font_unlock_face(pPangoFcFont);
 	return TRUE;
Index: Trunk/XaraLX/wxOil/fontbase.cpp
===================================================================
--- Trunk/XaraLX/wxOil/fontbase.cpp	(revision 772)
+++ Trunk/XaraLX/wxOil/fontbase.cpp	(revision 773)
@@ -1074,10 +1074,11 @@
 				CharWidth = mpFontMetricsData[CacheEntry].GetFontEmWidth();
 			else
 			{
-				INT32 TempCharWidth = 0;
-				if (TextManager::GetCharWidth(pDC, ch, ch, &TempCharWidth)==FALSE)
+#ifdef __WXGTK__
+				// FTFontMan returns the scaled character width already
+				if (FTFontMan::GetCharWidth(FontDesc, ch, ch, &CharWidth)==FALSE)
+#endif
 					return FALSE;
-				CharWidth = MulDiv(TempCharWidth, DefaultHeight, DesignSize);
 			}
 		}
 	}


Xara