SF.net SVN: geany:[5690] trunk/scintilla/gtk/PlatGTK.cxx
colombanw at users.sourceforge.net
colombanw at xxxxx
Mon Apr 4 17:58:07 UTC 2011
Revision: 5690
http://geany.svn.sourceforge.net/geany/?rev=5690&view=rev
Author: colombanw
Date: 2011-04-04 17:58:07 +0000 (Mon, 04 Apr 2011)
Log Message:
-----------
Fix font rendering in the Scintilla when using Cairo
Always get the Pango context through 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.
Patch imported from upstream Mercurial (3596/070c7eb483bf).
Modified Paths:
--------------
trunk/scintilla/gtk/PlatGTK.cxx
Modified: trunk/scintilla/gtk/PlatGTK.cxx
===================================================================
--- trunk/scintilla/gtk/PlatGTK.cxx 2011-04-04 17:05:44 UTC (rev 5689)
+++ trunk/scintilla/gtk/PlatGTK.cxx 2011-04-04 17:58:07 UTC (rev 5690)
@@ -894,16 +894,11 @@
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 @@
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 @@
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;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Commits
mailing list