Reviewed by Dan.
authorzimmermann@webkit.org <zimmermann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 6 Jan 2008 22:43:42 +0000 (22:43 +0000)
committerzimmermann@webkit.org <zimmermann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 6 Jan 2008 22:43:42 +0000 (22:43 +0000)
Add new helper function isArabicChar - SVG Fonts support needs it.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@29215 268f45cc-cd09-0410-ab3c-d52691b4dbfc

JavaScriptCore/ChangeLog
JavaScriptCore/wtf/unicode/icu/UnicodeIcu.h
JavaScriptCore/wtf/unicode/qt4/UnicodeQt4.h
WebCore/ChangeLog
WebCore/platform/graphics/mac/FontMac.mm

index 0527cf50eddf195dd797fb607f15502e3e3661ff..1bb373ea0f73e107ce896b5c003b41ab3c85ff9b 100644 (file)
@@ -1,3 +1,14 @@
+2008-01-06  Nikolas Zimmermann  <zimmermann@kde.org>
+
+        Reviewed by Dan.
+
+        Add new helper function isArabicChar - SVG Fonts support needs it.
+
+        * wtf/unicode/icu/UnicodeIcu.h:
+        (WTF::Unicode::isArabicChar):
+        * wtf/unicode/qt4/UnicodeQt4.h:
+        (WTF::Unicode::isArabicChar):
+
 2008-01-06  Alp Toker  <alp@atoker.com>
 
         Reviewed by Mark Rowe.
index 3ff84946f8fac9568119df61c132ad1ea3fd70d7..cc9ab8c1a754a2dcbe3b24cbb3f0ba5ec36308c8 100644 (file)
@@ -162,6 +162,11 @@ namespace WTF {
       return u_totitle(c);
     }
 
+    inline bool isArabicChar(UChar32 c)
+    {
+        return ublock_getCode(c) == UBLOCK_ARABIC;
+    }
+
     inline bool isFormatChar(UChar32 c)
     {
       return u_charType(c) == U_FORMAT_CHAR;
index ec57dfde890a3808f660b2e096ebe91623a11ffd..0fbd869f55931edc787969e71c92085b2584f848 100644 (file)
@@ -310,6 +310,11 @@ namespace WTF {
       return QChar::category(c) == QChar::Other_Format;
     }
 
+    inline bool isArabicChar(UChar32 c)
+    {
+        return c >= 0x0600 && c <= 0x06FF;
+    }
+
     inline bool isPrintableChar(UChar32 c)
     {
       const uint test = U_MASK(QChar::Other_Control) |
@@ -455,6 +460,11 @@ namespace WTF {
       return (c & 0xffff0000) == 0 && QChar((unsigned short)c).isPrint();
     }
 
+    inline bool isArabicChar(UChar32 c)
+    {
+        return c >= 0x0600 && c <= 0x06FF;
+    }
+
     inline bool isSeparatorSpace(UChar32 c)
     {
       return (c & 0xffff0000) == 0 && QChar((unsigned short)c).category() == QChar::Separator_Space;
index 86d3b50cea851319b7656541ce6874609fd726fd..3a123d72cb16639b0757fa58b35da99f6bb35921 100644 (file)
@@ -1,3 +1,12 @@
+2008-01-06  Nikolas Zimmermann  <zimmermann@kde.org>
+
+        Reviewed by Dan.
+
+        Use new helper function isArabicChar() - which also calls ublock_getCode() == UBLOCK_ARABIC on mac.
+
+        * platform/graphics/mac/FontMac.mm:
+        (WebCore::ATSULayoutParameters::initialize):
+
 2008-01-06  Andrew Wellington  <proton@wiretapped.net>
 
         Reviewed by Darin.
index 2dba6133d8fc2666a35d5050f4d87ea345eaf243..0df24e65c28ca1429cf2c2e9c613d606d10dc78f 100644 (file)
@@ -406,7 +406,7 @@ void ATSULayoutParameters::initialize(const Font* font, const GraphicsContext* g
                 else
                     break;
             }
-            if (!shapedArabic && ublock_getCode(m_run[i]) == UBLOCK_ARABIC && !r->shapesArabic()) {
+            if (!shapedArabic && WTF::Unicode::isArabicChar(m_run[i]) && !r->shapesArabic()) {
                 shapedArabic = true;
                 if (!m_charBuffer) {
                     m_charBuffer = new UChar[runLength];