diff options
author | Colomban Wendling <ban@herbesfolles.org> | 2011-04-04 00:02:09 +0200 |
---|---|---|
committer | Colomban Wendling <ban@herbesfolles.org> | 2011-04-04 00:02:09 +0200 |
commit | d8849ff4fafc047bad56fe6bd4c2b6d76ca26d9a (patch) | |
tree | 8f6016221bd3b0b58f046d6f3e2d3359215edcdf | |
parent | 0f684a5b30d62ead00e955607e88558846ababe3 (diff) | |
download | scintilla-mirror-d8849ff4fafc047bad56fe6bd4c2b6d76ca26d9a.tar.gz |
Fix font rendering in the GTK+ backend when using Cairo
Always get the Pango context though GTK+ API rather than creating it
from a Cairo context to always get a context set up for the screen.
This fixes font size issues when using Cairo rendering.
-rw-r--r-- | gtk/PlatGTK.cxx | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index 651805e65..4e2247355 100644 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -894,16 +894,11 @@ void SurfaceImpl::Init(WindowID wid) { context = cairo_create(psurf); } createdGC = true; - pcontext = pango_cairo_create_context(context); - PLATFORM_ASSERT(pcontext); - layout = pango_cairo_create_layout(context); - PLATFORM_ASSERT(layout); -#else +#endif pcontext = gtk_widget_create_pango_context(PWidget(wid)); PLATFORM_ASSERT(pcontext); layout = pango_layout_new(pcontext); PLATFORM_ASSERT(layout); -#endif inited = true; } @@ -916,17 +911,10 @@ void SurfaceImpl::Init(SurfaceID sid, WindowID wid) { context = gdk_cairo_create(drawable_); #else gc = gdk_gc_new(drawable_); + drawable = drawable_; #endif -#ifdef USE_CAIRO - pcontext = pango_cairo_create_context(context); - PLATFORM_ASSERT(pcontext); - layout = pango_cairo_create_layout(context); - PLATFORM_ASSERT(layout); -#else pcontext = gtk_widget_create_pango_context(PWidget(wid)); layout = pango_layout_new(pcontext); - drawable = drawable_; -#endif #ifdef USE_CAIRO cairo_set_line_width(context, 1); #else @@ -948,20 +936,16 @@ void SurfaceImpl::InitPixMap(int width, int height, Surface *surface_, WindowID PLATFORM_ASSERT(surfImpl->drawable); gc = gdk_gc_new(surfImpl->drawable); #endif -#ifdef USE_CAIRO - pcontext = pango_cairo_create_context(context); + pcontext = gtk_widget_create_pango_context(PWidget(wid)); PLATFORM_ASSERT(pcontext); - layout = pango_cairo_create_layout(context); + layout = pango_layout_new(pcontext); PLATFORM_ASSERT(layout); +#ifdef USE_CAIRO if (height > 0 && width > 0) psurf = gdk_window_create_similar_surface( gtk_widget_get_window(PWidget(wid)), CAIRO_CONTENT_COLOR_ALPHA, width, height); #else - pcontext = gtk_widget_create_pango_context(PWidget(wid)); - PLATFORM_ASSERT(pcontext); - layout = pango_layout_new(pcontext); - PLATFORM_ASSERT(layout); if (height > 0 && width > 0) ppixmap = gdk_pixmap_new(surfImpl->drawable, width, height, -1); drawable = ppixmap; |