[arch-commits] CVS update of extra/lib/xulrunner (2 files)
Alexander Baldeck
alexander at archlinux.org
Sat Oct 20 13:38:13 UTC 2007
Date: Saturday, October 20, 2007 @ 09:38:13
Author: alexander
Path: /home/cvs-extra/extra/lib/xulrunner
Added: firefox-1.5-xft-rangewidth.patch (1.1)
Modified: PKGBUILD (1.26 -> 1.27)
* fix for FS#8352
----------------------------------+
PKGBUILD | 20 ++
firefox-1.5-xft-rangewidth.patch | 283 +++++++++++++++++++++++++++++++++++++
2 files changed, 300 insertions(+), 3 deletions(-)
Index: extra/lib/xulrunner/PKGBUILD
diff -u extra/lib/xulrunner/PKGBUILD:1.26 extra/lib/xulrunner/PKGBUILD:1.27
--- extra/lib/xulrunner/PKGBUILD:1.26 Fri Oct 19 09:13:22 2007
+++ extra/lib/xulrunner/PKGBUILD Sat Oct 20 09:38:13 2007
@@ -1,8 +1,8 @@
-# $Id: PKGBUILD,v 1.26 2007/10/19 13:13:22 alexander Exp $
+# $Id: PKGBUILD,v 1.27 2007/10/20 13:38:13 alexander Exp $
# Maintainer: Jan de Groot <jgc at archlinux.org>
pkgname=xulrunner
pkgver=1.8.1.8
-pkgrel=1
+pkgrel=2
pkgdesc="Mozilla Runtime Environment"
arch=(i686 x86_64)
license=('MPL' 'GPL' 'LGPL')
@@ -21,7 +21,8 @@
nsIPermission.patch
firefox-2.0-pango-ligatures.patch
firefox-1.5-pango-underline.patch
- firefox-1.5-pango-justified-range.patch)
+ firefox-1.5-pango-justified-range.patch
+ firefox-1.5-xft-rangewidth.patch)
md5sums=('923c38e16464113a8e89f8d85f66e9a1'
'b2b5ce5ddf6e84858b8acb1e71b4682f'
'7d74ce02dbebeff16bf27cbe4888fe59'
@@ -46,6 +47,7 @@
patch -Np1 -i ${startdir}/src/firefox-2.0-pango-ligatures.patch || return 1
patch -Np1 -i ${startdir}/src/firefox-1.5-pango-underline.patch || return 1
patch -Np1 -i ${startdir}/src/firefox-1.5-pango-justified-range.patch || return 1
+ patch -Np1 -i ${startdir}/src/firefox-1.5-xft-rangewidth.patch || return 1
if [ "${CARCH}" = "x86_64" ]; then
echo "ac_cv_visibility_pragma=no" >> ${startdir}/src/mozconfig
@@ -68,3 +70,15 @@
sed -i -e "s/xulrunner-${pkgver}/xulrunner/" \
${startdir}/pkg/opt/mozilla/lib/pkgconfig/*.pc
}
+md5sums=('923c38e16464113a8e89f8d85f66e9a1'
+ 'b2b5ce5ddf6e84858b8acb1e71b4682f'
+ '7d74ce02dbebeff16bf27cbe4888fe59'
+ '288fb7db871700ff5cf7286db6192b45'
+ '11b221ff41078d97c131e17361072e47'
+ '29194973e2a535b460c6b7f92c635eaf'
+ '2082c2a2d1cedd08e83179271aacf337'
+ 'c24033e06bde73b3bd3d935ea87c22df'
+ '505728f57ff903e68afd3abea01be2e4'
+ '713a9587dd024f5d03f1fe9c095da9de'
+ '4d0713c0a94a367a4e84d5f7e56de631'
+ 'affb470ca6bac11a7f3005e2508621a8')
Index: extra/lib/xulrunner/firefox-1.5-xft-rangewidth.patch
diff -u /dev/null extra/lib/xulrunner/firefox-1.5-xft-rangewidth.patch:1.1
--- /dev/null Sat Oct 20 09:38:13 2007
+++ extra/lib/xulrunner/firefox-1.5-xft-rangewidth.patch Sat Oct 20 09:38:13 2007
@@ -0,0 +1,283 @@
+diff -pruN -x '.moz*' -x .libs -x .deps -x dist -x 'config*' -x 'firefox*' -x '*a' -x '*so' -x '*o' -x build -x '*html' mozilla.orig/gfx/src/gtk/nsFontMetricsXft.cpp mozilla/gfx/src/gtk/nsFontMetricsXft.cpp
+--- mozilla.orig/gfx/src/gtk/nsFontMetricsXft.cpp 2006-04-25 08:58:36.000000000 +0900
++++ mozilla/gfx/src/gtk/nsFontMetricsXft.cpp 2007-02-08 01:50:05.000000000 +0900
+@@ -227,10 +227,14 @@ static nsresult EnumFontsXft (nsIAto
+
+ static void ConvertCharToUCS4 (const char *aString,
+ PRUint32 aLength,
++ PRUint32 aStart,
++ PRUint32 aEnd,
+ nsAutoFcChar32Buffer &aOutBuffer,
+ PRUint32 *aOutLen);
+ static void ConvertUnicharToUCS4 (const PRUnichar *aString,
+ PRUint32 aLength,
++ PRUint32 aStart,
++ PRUint32 aEnd,
+ nsAutoFcChar32Buffer &aOutBuffer,
+ PRUint32 *aOutLen);
+ static nsresult ConvertUCS4ToCustom (FcChar32 *aSrc, PRUint32 aSrcLen,
+@@ -507,7 +511,7 @@ nsFontMetricsXft::GetWidth(const PRUnich
+ return NS_OK;
+ }
+
+- gint rawWidth = RawGetWidth(aString, aLength);
++ gint rawWidth = RawGetWidth(aString, aLength, 0, aLength);
+
+ float f;
+ f = mDeviceContext->DevUnitsToAppUnits();
+@@ -533,7 +537,7 @@ nsFontMetricsXft::GetTextDimensions(cons
+ return NS_OK;
+
+ nsresult rv;
+- rv = EnumerateGlyphs(aString, aLength,
++ rv = EnumerateGlyphs(aString, aLength, 0, aLength,
+ &nsFontMetricsXft::TextDimensionsCallback,
+ &aDimensions);
+
+@@ -608,7 +612,7 @@ nsFontMetricsXft::DrawString(const char
+ nsAutoDrawSpecBuffer drawBuffer(data.draw, &data.color);
+ data.drawBuffer = &drawBuffer;
+
+- return EnumerateGlyphs(aString, aLength,
++ return EnumerateGlyphs(aString, aLength, 0, aLength,
+ &nsFontMetricsXft::DrawStringCallback, &data);
+ }
+
+@@ -638,7 +642,7 @@ nsFontMetricsXft::DrawString(const PRUni
+ nsAutoDrawSpecBuffer drawBuffer(data.draw, &data.color);
+ data.drawBuffer = &drawBuffer;
+
+- return EnumerateGlyphs(aString, aLength,
++ return EnumerateGlyphs(aString, aLength, 0, aLength,
+ &nsFontMetricsXft::DrawStringCallback, &data);
+ }
+
+@@ -662,7 +666,7 @@ nsFontMetricsXft::GetBoundingMetrics(con
+ data.firstTime = PR_TRUE;
+
+ nsresult rv;
+- rv = EnumerateGlyphs(aString, aLength,
++ rv = EnumerateGlyphs(aString, aLength, 0, aLength,
+ &nsFontMetricsXft::BoundingMetricsCallback, &data);
+ NS_ENSURE_SUCCESS(rv, rv);
+
+@@ -700,7 +704,7 @@ nsFontMetricsXft::GetBoundingMetrics(con
+ data.firstTime = PR_TRUE;
+
+ nsresult rv;
+- rv = EnumerateGlyphs(aString, aLength,
++ rv = EnumerateGlyphs(aString, aLength, 0, aLength,
+ &nsFontMetricsXft::BoundingMetricsCallback, &data);
+ NS_ENSURE_SUCCESS(rv, rv);
+
+@@ -758,7 +762,17 @@ nsFontMetricsXft::GetRangeWidth(const PR
+ PRUint32 aEnd,
+ PRUint32 &aWidth)
+ {
+- return NS_ERROR_NOT_IMPLEMENTED;
++ if (!aLength) {
++ aWidth = 0;
++ return NS_OK;
++ }
++
++ gint rawWidth = RawGetWidth(aText, aLength, aStart, aEnd);
++ float f = mDeviceContext->DevUnitsToAppUnits();
++
++ aWidth = NSToCoordRound(rawWidth * f);
++
++ return NS_OK;
+ }
+
+ nsresult
+@@ -768,7 +782,17 @@ nsFontMetricsXft::GetRangeWidth(const ch
+ PRUint32 aEnd,
+ PRUint32 &aWidth)
+ {
+- return NS_ERROR_NOT_IMPLEMENTED;
++ if (!aLength) {
++ aWidth = 0;
++ return NS_OK;
++ }
++
++ gint rawWidth = RawGetWidth(aText, aLength, aStart, aEnd);
++ float f = mDeviceContext->DevUnitsToAppUnits();
++
++ aWidth = NSToCoordRound(rawWidth * f);
++
++ return NS_OK;
+ }
+
+ PRUint32
+@@ -850,12 +874,12 @@ nsFontMetricsXft::CacheFontMetrics(void)
+ // mSpaceWidth (width of a space)
+ gint rawWidth;
+ PRUnichar unispace(' ');
+- rawWidth = RawGetWidth(&unispace, 1);
++ rawWidth = RawGetWidth(&unispace, 1, 0, 1);
+ mSpaceWidth = NSToCoordRound(rawWidth * f);
+
+ // mAveCharWidth (width of an 'average' char)
+ PRUnichar xUnichar('x');
+- rawWidth = RawGetWidth(&xUnichar, 1);
++ rawWidth = RawGetWidth(&xUnichar, 1, 0, 1);
+ mAveCharWidth = NSToCoordRound(rawWidth * f);
+
+ // mXHeight (height of an 'x' character)
+@@ -1226,12 +1250,27 @@ nsFontMetricsXft::DoMatch(PRBool aMatchA
+ }
+
+ gint
+-nsFontMetricsXft::RawGetWidth(const PRUnichar* aString, PRUint32 aLength)
++nsFontMetricsXft::RawGetWidth(const PRUnichar* aString, PRUint32 aLength, PRUint32 aStart, PRUint32 aEnd)
++{
++ nscoord width = 0;
++ nsresult rv;
++
++ rv = EnumerateGlyphs(aString, aLength, aStart, aEnd,
++ &nsFontMetricsXft::GetWidthCallback, &width);
++
++ if (NS_FAILED(rv))
++ width = 0;
++
++ return width;
++}
++
++gint
++nsFontMetricsXft::RawGetWidth(const char* aString, PRUint32 aLength, PRUint32 aStart, PRUint32 aEnd)
+ {
+ nscoord width = 0;
+ nsresult rv;
+
+- rv = EnumerateGlyphs(aString, aLength,
++ rv = EnumerateGlyphs(aString, aLength, aStart, aEnd,
+ &nsFontMetricsXft::GetWidthCallback, &width);
+
+ if (NS_FAILED(rv))
+@@ -1457,6 +1496,8 @@ nsFontMetricsXft::EnumerateXftGlyphs(con
+ nsresult
+ nsFontMetricsXft::EnumerateGlyphs(const PRUnichar *aString,
+ PRUint32 aLen,
++ PRUint32 aStart,
++ PRUint32 aEnd,
+ GlyphEnumeratorCallback aCallback,
+ void *aCallbackData)
+ {
+@@ -1465,7 +1506,7 @@ nsFontMetricsXft::EnumerateGlyphs(const
+
+ NS_ENSURE_TRUE(aLen, NS_OK);
+
+- ConvertUnicharToUCS4(aString, aLen, charBuffer, &len);
++ ConvertUnicharToUCS4(aString, aLen, aStart, aEnd, charBuffer, &len);
+ if (!len)
+ return NS_ERROR_OUT_OF_MEMORY;
+
+@@ -1475,6 +1516,8 @@ nsFontMetricsXft::EnumerateGlyphs(const
+ nsresult
+ nsFontMetricsXft::EnumerateGlyphs(const char *aString,
+ PRUint32 aLen,
++ PRUint32 aStart,
++ PRUint32 aEnd,
+ GlyphEnumeratorCallback aCallback,
+ void *aCallbackData)
+ {
+@@ -1484,7 +1527,7 @@ nsFontMetricsXft::EnumerateGlyphs(const
+ NS_ENSURE_TRUE(aLen, NS_OK);
+
+ // Convert the incoming string into an array of UCS4 chars
+- ConvertCharToUCS4(aString, aLen, charBuffer, &len);
++ ConvertCharToUCS4(aString, aLen, aStart, aEnd, charBuffer, &len);
+ if (!len)
+ return NS_ERROR_OUT_OF_MEMORY;
+
+@@ -2343,7 +2386,7 @@ EnumFontsXft(nsIAtom* aLangGroup, const
+
+ /* static */
+ void
+-ConvertCharToUCS4(const char *aString, PRUint32 aLength,
++ConvertCharToUCS4(const char *aString, PRUint32 aLength, PRUint32 aStart, PRUint32 aEnd,
+ nsAutoFcChar32Buffer &aOutBuffer, PRUint32 *aOutLen)
+ {
+ *aOutLen = 0;
+@@ -2352,19 +2395,21 @@ ConvertCharToUCS4(const char *aString, P
+ if (!aOutBuffer.EnsureElemCapacity(aLength))
+ return;
+ outBuffer = aOutBuffer.get();
++ if (aEnd > aLength)
++ aEnd = aLength;
+
+- for (PRUint32 i = 0; i < aLength; ++i) {
+- outBuffer[i] = PRUint8(aString[i]); // to convert char >= 0x80 correctly
++ for (PRUint32 i = aStart; i < aLength && i < aEnd; ++i) {
++ outBuffer[i - aStart] = PRUint8(aString[i]); // to convert char >= 0x80 correctly
+ }
+
+- *aOutLen = aLength;
++ *aOutLen = aEnd - aStart;
+ }
+
+ // Convert the incoming string into an array of UCS4 chars
+
+ /* static */
+ void
+-ConvertUnicharToUCS4(const PRUnichar *aString, PRUint32 aLength,
++ConvertUnicharToUCS4(const PRUnichar *aString, PRUint32 aLength, PRUint32 aStart, PRUint32 aEnd,
+ nsAutoFcChar32Buffer &aOutBuffer, PRUint32 *aOutLen)
+ {
+ *aOutLen = 0;
+@@ -2378,7 +2423,7 @@ ConvertUnicharToUCS4(const PRUnichar *aS
+
+ // Walk the passed in string looking for surrogates to convert to
+ // their full ucs4 representation.
+- for (PRUint32 i = 0; i < aLength; ++i) {
++ for (PRUint32 i = aStart; i < aLength && i < aEnd; ++i) {
+ PRUnichar c = aString[i];
+
+ // Optimized for the non-surrogate case
+@@ -2693,12 +2738,12 @@ ConvertUCS4ToCustom(FcChar32 *aSrc, PRU
+ #endif
+ // Convert 16bit custom font codes to UCS4
+ ConvertUnicharToUCS4(NS_REINTERPRET_CAST(PRUnichar *, med),
+- medLen >> 1, aResult, &aDestLen);
++ medLen >> 1, 0, medLen >> 1, aResult, &aDestLen);
+ rv = aDestLen ? rv : NS_ERROR_OUT_OF_MEMORY;
+ }
+ else {
+ // Convert 8bit custom font codes to UCS4
+- ConvertCharToUCS4(med, medLen, aResult, &aDestLen);
++ ConvertCharToUCS4(med, medLen, 0, medLen, aResult, &aDestLen);
+ rv = aDestLen ? rv : NS_ERROR_OUT_OF_MEMORY;
+ }
+
+diff -pruN -x '.moz*' -x .libs -x .deps -x dist -x 'config*' -x 'firefox*' -x '*a' -x '*so' -x '*o' -x build -x '*html' mozilla.orig/gfx/src/gtk/nsFontMetricsXft.h mozilla/gfx/src/gtk/nsFontMetricsXft.h
+--- mozilla.orig/gfx/src/gtk/nsFontMetricsXft.h 2005-05-03 05:48:30.000000000 +0900
++++ mozilla/gfx/src/gtk/nsFontMetricsXft.h 2007-02-08 01:38:27.000000000 +0900
+@@ -259,7 +259,13 @@ private:
+ void DoMatch (PRBool aMatchAll);
+
+ gint RawGetWidth (const PRUnichar* aString,
+- PRUint32 aLength);
++ PRUint32 aLength,
++ PRUint32 aStart,
++ PRUint32 aEnd);
++ gint RawGetWidth (const char* aString,
++ PRUint32 aLength,
++ PRUint32 aStart,
++ PRUint32 aEnd);
+ nsresult SetupMiniFont (void);
+ nsresult DrawUnknownGlyph (FcChar32 aChar,
+ nscoord aX,
+@@ -272,10 +278,14 @@ private:
+ void *aCallbackData);
+ nsresult EnumerateGlyphs (const char *aString,
+ PRUint32 aLen,
++ PRUint32 aStart,
++ PRUint32 aEnd,
+ GlyphEnumeratorCallback aCallback,
+ void *aCallbackData);
+ nsresult EnumerateGlyphs (const PRUnichar *aString,
+ PRUint32 aLen,
++ PRUint32 aStart,
++ PRUint32 aEnd,
+ GlyphEnumeratorCallback aCallback,
+ void *aCallbackData);
+ void PrepareToDraw (nsRenderingContextGTK *aContext,
More information about the arch-commits
mailing list