| 1 |
diff -ru vcl/inc/vcl/glyphcache.hxx vcl/inc/vcl/glyphcache.hxx
|
| 2 |
--- openoffice.org.orig/vcl/inc/vcl/glyphcache.hxx 2008-04-15 08:44:36.000000000 +0100
|
| 3 |
+++ openoffice.org/vcl/inc/vcl/glyphcache.hxx 2008-04-15 16:24:06.000000000 +0100
|
| 4 |
@@ -105,8 +105,9 @@
|
| 5 |
struct IFSD_Hash{ size_t operator()( const ImplFontSelectData& ) const; };
|
| 6 |
typedef ::std::hash_map<ImplFontSelectData,ServerFont*,IFSD_Hash,IFSD_Equal > FontList;
|
| 7 |
FontList maFontList;
|
| 8 |
-
|
| 9 |
+public:
|
| 10 |
ULONG mnMaxSize; // max overall cache size in bytes
|
| 11 |
+private:
|
| 12 |
mutable ULONG mnBytesUsed;
|
| 13 |
mutable long mnLruIndex;
|
| 14 |
mutable int mnGlyphCount;
|
| 15 |
diff -ru vcl/inc/vcl/settings.hxx vcl/inc/vcl/settings.hxx
|
| 16 |
--- openoffice.org.orig/vcl/inc/vcl/settings.hxx 2008-04-15 08:44:37.000000000 +0100
|
| 17 |
+++ openoffice.org/vcl/inc/vcl/settings.hxx 2008-04-15 08:47:15.000000000 +0100
|
| 18 |
@@ -432,6 +432,7 @@
|
| 19 |
ULONG mnPreferredSymbolsStyle;
|
| 20 |
USHORT mnSkipDisabledInMenus;
|
| 21 |
Wallpaper maWorkspaceGradient;
|
| 22 |
+ const void* mpFontOptions;
|
| 23 |
};
|
| 24 |
|
| 25 |
#define DEFAULT_WORKSPACE_GRADIENT_START_COLOR Color( 0xa3, 0xae, 0xb8 )
|
| 26 |
@@ -734,6 +735,11 @@
|
| 27 |
BOOL GetSkipDisabledInMenus() const
|
| 28 |
{ return (BOOL) mpData->mnSkipDisabledInMenus; }
|
| 29 |
|
| 30 |
+ void SetCairoFontOptions( const void *pOptions )
|
| 31 |
+ { CopyData(); mpData->mpFontOptions = pOptions; }
|
| 32 |
+ const void* GetCairoFontOptions() const
|
| 33 |
+ { return mpData->mpFontOptions; }
|
| 34 |
+
|
| 35 |
void SetAppFont( const Font& rFont )
|
| 36 |
{ CopyData(); mpData->maAppFont = rFont; }
|
| 37 |
const Font& GetAppFont() const
|
| 38 |
diff -ru vcl/source/app/settings.cxx vcl/source/app/settings.cxx
|
| 39 |
--- openoffice.org.orig/vcl/source/app/settings.cxx 2008-04-15 08:44:34.000000000 +0100
|
| 40 |
+++ openoffice.org/vcl/source/app/settings.cxx 2008-04-15 08:48:27.000000000 +0100
|
| 41 |
@@ -466,6 +466,7 @@
|
| 42 |
mnToolbarIconSize = STYLE_TOOLBAR_ICONSIZE_UNKNOWN;
|
| 43 |
mnSymbolsStyle = STYLE_SYMBOLS_AUTO;
|
| 44 |
mnPreferredSymbolsStyle = STYLE_SYMBOLS_AUTO;
|
| 45 |
+ mpFontOptions = NULL;
|
| 46 |
|
| 47 |
SetStandardStyles();
|
| 48 |
}
|
| 49 |
@@ -568,6 +569,7 @@
|
| 50 |
mnToolbarIconSize = rData.mnToolbarIconSize;
|
| 51 |
mnSymbolsStyle = rData.mnSymbolsStyle;
|
| 52 |
mnPreferredSymbolsStyle = rData.mnPreferredSymbolsStyle;
|
| 53 |
+ mpFontOptions = rData.mpFontOptions;
|
| 54 |
}
|
| 55 |
|
| 56 |
// -----------------------------------------------------------------------
|
| 57 |
diff -ru vcl/source/window/winproc.cxx vcl/source/window/winproc.cxx
|
| 58 |
--- openoffice.org.orig/vcl/source/window/winproc.cxx 2008-04-15 08:44:34.000000000 +0100
|
| 59 |
+++ openoffice.org/vcl/source/window/winproc.cxx 2008-04-15 16:40:53.000000000 +0100
|
| 60 |
@@ -64,6 +64,7 @@
|
| 61 |
#include <vcl/dockwin.hxx>
|
| 62 |
#include <vcl/salgdi.hxx>
|
| 63 |
#include <vcl/menu.hxx>
|
| 64 |
+#include <vcl/glyphcache.hxx>
|
| 65 |
|
| 66 |
#include <dndlcon.hxx>
|
| 67 |
#include <com/sun/star/datatransfer/dnd/XDragSource.hpp>
|
| 68 |
@@ -2217,9 +2218,14 @@
|
| 69 |
nType = DATACHANGED_DISPLAY;
|
| 70 |
break;
|
| 71 |
case SALEVENT_FONTCHANGED:
|
| 72 |
+ {
|
| 73 |
+ ULONG nOldSize = GlyphCache::GetInstance().mnMaxSize;
|
| 74 |
+ GlyphCache::GetInstance().mnMaxSize = 0;
|
| 75 |
OutputDevice::ImplUpdateAllFontData( TRUE );
|
| 76 |
+ GlyphCache::GetInstance().mnMaxSize = nOldSize;
|
| 77 |
nType = DATACHANGED_FONTS;
|
| 78 |
break;
|
| 79 |
+ }
|
| 80 |
case SALEVENT_DATETIMECHANGED:
|
| 81 |
nType = DATACHANGED_DATETIME;
|
| 82 |
break;
|
| 83 |
diff -ru vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
|
| 84 |
--- openoffice.org.orig/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx 2008-04-15 08:44:28.000000000 +0100
|
| 85 |
+++ openoffice.org/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx 2008-04-15 16:21:17.000000000 +0100
|
| 86 |
@@ -3465,6 +3465,11 @@
|
| 87 |
// FIXME: need some way of fetching toolbar icon size.
|
| 88 |
// aStyleSet.SetToolbarIconSize( STYLE_TOOLBAR_ICONSIZE_SMALL );
|
| 89 |
|
| 90 |
+ const cairo_font_options_t *pNewOptions = 0;
|
| 91 |
+ if (GdkScreen* pScreen = gdk_display_get_screen( gdk_display_get_default(), m_nScreen ))
|
| 92 |
+ pNewOptions = gdk_screen_get_font_options(pScreen);
|
| 93 |
+ aStyleSet.SetCairoFontOptions( pNewOptions );
|
| 94 |
+
|
| 95 |
// finally update the collected settings
|
| 96 |
rSettings.SetStyleSettings( aStyleSet );
|
| 97 |
|
| 98 |
diff -ru vcl/unx/gtk/window/gtkframe.cxx vcl/unx/gtk/window/gtkframe.cxx
|
| 99 |
--- openoffice.org.orig/vcl/unx/gtk/window/gtkframe.cxx 2008-04-15 08:44:28.000000000 +0100
|
| 100 |
+++ openoffice.org/vcl/unx/gtk/window/gtkframe.cxx 2008-04-15 16:38:26.000000000 +0100
|
| 101 |
@@ -2942,10 +2942,13 @@
|
| 102 |
// redraw itself to adjust to the new style
|
| 103 |
// where there IS no new style resulting in tremendous unnecessary flickering
|
| 104 |
if( pPrevious != NULL )
|
| 105 |
+ {
|
| 106 |
// signalStyleSet does NOT usually have the gdk lock
|
| 107 |
// so post user event to safely dispatch the SALEVENT_SETTINGSCHANGED
|
| 108 |
// note: settings changed for multiple frames is avoided in winproc.cxx ImplHandleSettings
|
| 109 |
pThis->getDisplay()->SendInternalEvent( pThis, NULL, SALEVENT_SETTINGSCHANGED );
|
| 110 |
+ pThis->getDisplay()->SendInternalEvent( pThis, NULL, SALEVENT_FONTCHANGED );
|
| 111 |
+ }
|
| 112 |
|
| 113 |
/* #i64117# gtk sets a nice background pixmap
|
| 114 |
* but we actually don't really want that, so save
|
| 115 |
diff -ru vcl/unx/source/gdi/salgdi3.cxx vcl/unx/source/gdi/salgdi3.cxx
|
| 116 |
--- openoffice.org.orig/vcl/unx/source/gdi/salgdi3.cxx 2008-04-15 08:44:29.000000000 +0100
|
| 117 |
+++ openoffice.org/vcl/unx/source/gdi/salgdi3.cxx 2008-04-15 11:58:46.000000000 +0100
|
| 118 |
@@ -782,6 +782,7 @@
|
| 119 |
void (*mp_set_font_matrix)(cairo_t *, const cairo_matrix_t *);
|
| 120 |
void (*mp_show_glyphs)(cairo_t *, const cairo_glyph_t *, int );
|
| 121 |
void (*mp_set_source_rgb)(cairo_t *, double , double , double );
|
| 122 |
+ void (*mp_set_font_options)(cairo_t *, const void *);
|
| 123 |
|
| 124 |
bool canEmbolden() const { return false; }
|
| 125 |
|
| 126 |
@@ -817,6 +818,8 @@
|
| 127 |
{ (*mp_show_glyphs)(cr, glyphs, no_glyphs); }
|
| 128 |
void set_source_rgb(cairo_t *cr, double red, double green, double blue)
|
| 129 |
{ (*mp_set_source_rgb)(cr, red, green, blue); }
|
| 130 |
+ void set_font_options(cairo_t *cr, const void *options)
|
| 131 |
+ { (*mp_set_font_options)(cr, options); }
|
| 132 |
};
|
| 133 |
|
| 134 |
static CairoWrapper* pCairoInstance = NULL;
|
| 135 |
@@ -875,6 +878,8 @@
|
| 136 |
osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_show_glyphs" );
|
| 137 |
mp_set_source_rgb = (void (*)(cairo_t *, double , double , double ))
|
| 138 |
osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_set_source_rgb" );
|
| 139 |
+ mp_set_font_options = (void (*)(cairo_t *, const void *options ))
|
| 140 |
+ osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_set_font_options" );
|
| 141 |
|
| 142 |
if( !(
|
| 143 |
mp_xlib_surface_create_with_xrender_format &&
|
| 144 |
@@ -891,7 +896,8 @@
|
| 145 |
mp_matrix_rotate &&
|
| 146 |
mp_set_font_matrix &&
|
| 147 |
mp_show_glyphs &&
|
| 148 |
- mp_set_source_rgb
|
| 149 |
+ mp_set_source_rgb &&
|
| 150 |
+ mp_set_font_options
|
| 151 |
) )
|
| 152 |
{
|
| 153 |
osl_unloadModule( mpCairoLib );
|
| 154 |
@@ -1009,6 +1015,9 @@
|
| 155 |
cairo_t *cr = rCairo.create(surface);
|
| 156 |
rCairo.surface_destroy(surface);
|
| 157 |
|
| 158 |
+ if (const void *pOptions = Application::GetSettings().GetStyleSettings().GetCairoFontOptions())
|
| 159 |
+ rCairo.set_font_options(cr, pOptions);
|
| 160 |
+
|
| 161 |
if( pClipRegion_ && !XEmptyRegion( pClipRegion_ ) )
|
| 162 |
{
|
| 163 |
for (long i = 0; i < pClipRegion_->numRects; ++i)
|