1 From cc68104ed4bad5443882d272582df6672a2429dd Mon Sep 17 00:00:00 2001
2 From: Holger Freyther <ich@tamarin.(none)>
3 Date: Sun, 19 Apr 2009 23:16:56 +0200
4 Subject: [PATCH] [Font] Disable italic (by force), attempt to force Liberation
6 Attempt to work around font config selection when using the
7 generic sans-serif, serif, monospace names. These manage to
8 pick up Dejavu, Liberation and Free* for various glyphs when
9 using one font should be enough...
11 WebCore/platform/graphics/Font.cpp | 9 +++++++++
12 .../platform/graphics/gtk/FontPlatformDataGtk.cpp | 5 +----
13 WebKit/gtk/webkit/webkitwebsettings.cpp | 12 ++++++------
14 3 files changed, 16 insertions(+), 10 deletions(-)
16 diff --git a/WebCore/platform/graphics/Font.cpp b/WebCore/platform/graphics/Font.cpp
17 index f49d7c4..04b52f9 100644
18 --- a/WebCore/platform/graphics/Font.cpp
19 +++ b/WebCore/platform/graphics/Font.cpp
20 @@ -75,6 +75,15 @@ Font::Font(const FontDescription& fd, short letterSpacing, short wordSpacing)
21 , m_isPlatformFont(false)
24 + * force certain families.... The idea is to have three default
25 + * fonts and allow to switch to non latin fonts to get certain
26 + * other characters...
28 + if (!fd.family().family().isEmpty()) {
29 + m_fontDescription.setItalic(false);
33 * Select between two sizes.... we support.
34 * Everything that is smaller than MINIMAL_SIZE + 3 gets the
35 * minimal size, the rest gets the MAXIMAL_SIZE
36 diff --git a/WebCore/platform/graphics/gtk/FontPlatformDataGtk.cpp b/WebCore/platform/graphics/gtk/FontPlatformDataGtk.cpp
37 index 17d789b..7f31230 100644
38 --- a/WebCore/platform/graphics/gtk/FontPlatformDataGtk.cpp
39 +++ b/WebCore/platform/graphics/gtk/FontPlatformDataGtk.cpp
40 @@ -47,12 +47,9 @@ FontPlatformData::FontPlatformData(const FontDescription& fontDescription, const
42 CString familyNameString = familyName.string().utf8();
43 const char* fcfamily = familyNameString.data();
44 - int fcslant = FC_SLANT_ROMAN;
45 // FIXME: Map all FontWeight values to fontconfig weights.
46 int fcweight = FC_WEIGHT_NORMAL;
47 double fcsize = fontDescription.computedPixelSize();
48 - if (fontDescription.italic())
49 - fcslant = FC_SLANT_ITALIC;
50 if (fontDescription.weight() >= FontWeight600)
51 fcweight = FC_WEIGHT_BOLD;
53 @@ -90,7 +87,7 @@ FontPlatformData::FontPlatformData(const FontDescription& fontDescription, const
55 if (!FcPatternAddInteger(pattern, FC_WEIGHT, fcweight))
57 - if (!FcPatternAddInteger(pattern, FC_SLANT, fcslant))
58 + if (!FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ROMAN))
60 if (!FcPatternAddDouble(pattern, FC_PIXEL_SIZE, fcsize))
62 diff --git a/WebKit/gtk/webkit/webkitwebsettings.cpp b/WebKit/gtk/webkit/webkitwebsettings.cpp
63 index 62e23e5..d041de7 100644
64 --- a/WebKit/gtk/webkit/webkitwebsettings.cpp
65 +++ b/WebKit/gtk/webkit/webkitwebsettings.cpp
66 @@ -134,7 +134,7 @@ static void webkit_web_settings_class_init(WebKitWebSettingsClass* klass)
67 "cursive-font-family",
68 "Cursive Font Family",
69 "The default Cursive font family used to display text.",
74 g_object_class_install_property(gobject_class,
75 @@ -143,7 +143,7 @@ static void webkit_web_settings_class_init(WebKitWebSettingsClass* klass)
76 "default-font-family",
77 "Default Font Family",
78 "The default font family used to display text.",
83 g_object_class_install_property(gobject_class,
84 @@ -152,7 +152,7 @@ static void webkit_web_settings_class_init(WebKitWebSettingsClass* klass)
85 "fantasy-font-family",
86 "Fantasy Font Family",
87 "The default Fantasy font family used to display text.",
92 g_object_class_install_property(gobject_class,
93 @@ -161,7 +161,7 @@ static void webkit_web_settings_class_init(WebKitWebSettingsClass* klass)
94 "monospace-font-family",
95 "Monospace Font Family",
96 "The default font family used to display monospace text.",
101 g_object_class_install_property(gobject_class,
102 @@ -170,7 +170,7 @@ static void webkit_web_settings_class_init(WebKitWebSettingsClass* klass)
103 "sans-serif-font-family",
104 "Sans Serif Font Family",
105 "The default Sans Serif font family used to display text.",
110 g_object_class_install_property(gobject_class,
111 @@ -179,7 +179,7 @@ static void webkit_web_settings_class_init(WebKitWebSettingsClass* klass)
114 "The default Serif font family used to display text.",
116 + "Liberation Serif",
119 g_object_class_install_property(gobject_class,