[BlackBerry] Set up default fonts for BlackBerry
authorefidler@rim.com <efidler@rim.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Apr 2012 17:47:48 +0000 (17:47 +0000)
committerefidler@rim.com <efidler@rim.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Apr 2012 17:47:48 +0000 (17:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=83775

Reviewed by Antonio Gomes.

* PlatformBlackBerry.cmake:
* page/Settings.cpp:
(WebCore):
* page/blackberry/SettingsBlackBerry.cpp: Added.
(WebCore):
(WebCore::Settings::initializeDefaultFontFamilies):

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

Source/WebCore/ChangeLog
Source/WebCore/PlatformBlackBerry.cmake
Source/WebCore/page/Settings.cpp
Source/WebCore/page/blackberry/SettingsBlackBerry.cpp [new file with mode: 0644]

index 2b57c8f..400a57f 100644 (file)
@@ -1,3 +1,17 @@
+2012-04-12  Eli Fidler  <efidler@rim.com>
+
+        [BlackBerry] Set up default fonts for BlackBerry
+        https://bugs.webkit.org/show_bug.cgi?id=83775
+
+        Reviewed by Antonio Gomes.
+
+        * PlatformBlackBerry.cmake:
+        * page/Settings.cpp:
+        (WebCore):
+        * page/blackberry/SettingsBlackBerry.cpp: Added.
+        (WebCore):
+        (WebCore::Settings::initializeDefaultFontFamilies):
+
 2012-04-12  Jon Lee  <jonlee@apple.com>
 
         Implement Dictionary.h on mac (83472)
index 86304b5..c702d2f 100644 (file)
@@ -134,6 +134,7 @@ LIST(APPEND WebCore_SOURCES
     page/blackberry/AccessibilityObjectBlackBerry.cpp
     page/blackberry/DragControllerBlackBerry.cpp
     page/blackberry/EventHandlerBlackBerry.cpp
+    page/blackberry/SettingsBlackBerry.cpp
     platform/blackberry/ClipboardBlackBerry.cpp
     platform/blackberry/ContextMenuBlackBerry.cpp
     platform/blackberry/ContextMenuItemBlackBerry.cpp
index 986b338..47e4fff 100644 (file)
@@ -271,7 +271,7 @@ PassOwnPtr<Settings> Settings::create(Page* page)
     return adoptPtr(new Settings(page));
 } 
 
-#if !PLATFORM(MAC)
+#if !PLATFORM(MAC) && !PLATFORM(BLACKBERRY)
 void Settings::initializeDefaultFontFamilies()
 {
     // Other platforms can set up fonts from a client, but on Mac, we want it in WebCore to share code between WebKit1 and WebKit2.
diff --git a/Source/WebCore/page/blackberry/SettingsBlackBerry.cpp b/Source/WebCore/page/blackberry/SettingsBlackBerry.cpp
new file mode 100644 (file)
index 0000000..4bf593c
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "config.h"
+#include "Settings.h"
+
+namespace WebCore {
+
+void Settings::initializeDefaultFontFamilies()
+{
+    setCursiveFontFamily("Comic Sans MS");
+    setFantasyFontFamily("Impact");
+    setFixedFontFamily("Courier New");
+    setSansSerifFontFamily("Arial");
+    setSerifFontFamily("Times New Roman");
+    setStandardFontFamily("Times New Roman");
+
+    setStandardFontFamily("Adobe Ming Std L", USCRIPT_TRADITIONAL_HAN);
+
+    setStandardFontFamily("Adobe Heiti Std R", USCRIPT_SIMPLIFIED_HAN);
+
+    setFixedFontFamily("Ryo Gothic PlusN R", USCRIPT_KATAKANA_OR_HIRAGANA);
+    setSansSerifFontFamily("Ryo Gothic PlusN R", USCRIPT_KATAKANA_OR_HIRAGANA);
+    setSerifFontFamily("Ryo Text PlusN L", USCRIPT_KATAKANA_OR_HIRAGANA);
+    setStandardFontFamily("Ryo Gothic PlusN R", USCRIPT_KATAKANA_OR_HIRAGANA);
+
+    setStandardFontFamily("Adobe Gothic Std", USCRIPT_HANGUL);
+
+    setStandardFontFamily("Garuda", USCRIPT_THAI);
+
+    setStandardFontFamily("Tahoma", USCRIPT_ARABIC);
+
+    setStandardFontFamily("Tahoma", USCRIPT_HEBREW);
+
+    setStandardFontFamily("Bengali OTS", USCRIPT_BENGALI);
+    setStandardFontFamily("Devanagari OTS", USCRIPT_DEVANAGARI);
+    setStandardFontFamily("Gujarati OTS", USCRIPT_GUJARATI);
+    setStandardFontFamily("Gurmukhi OTS", USCRIPT_GURMUKHI);
+    setStandardFontFamily("Kannada OTS", USCRIPT_KANNADA);
+    setStandardFontFamily("Malayalam OTS", USCRIPT_MALAYALAM);
+    setStandardFontFamily("Sinhala OTS", USCRIPT_SINHALA);
+    setStandardFontFamily("Tamil OTS", USCRIPT_TAMIL);
+    setStandardFontFamily("Telugu OTS", USCRIPT_TELUGU);
+}
+
+
+} // namespace WebCore