Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 374310 Details for
Bug 505928
=app-office/dia-0.97.2-r2 with =x11-libs/cairo-1.12.14-r4 - broken text export to Cairo formats
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
pango-cairo_kerning.patch
pangocairo-kerning.patch (text/plain), 2.36 KB, created by
Sergey S. Starikoff
on 2014-04-05 14:49:02 UTC
(
hide
)
Description:
pango-cairo_kerning.patch
Filename:
MIME Type:
Creator:
Sergey S. Starikoff
Created:
2014-04-05 14:49:02 UTC
Size:
2.36 KB
patch
obsolete
>diff --git a/plug-ins/cairo/diacairo-renderer.c b/plug-ins/cairo/diacairo-renderer.c >index 57f6184..079446e 100644 >--- a/plug-ins/cairo/diacairo-renderer.c >+++ b/plug-ins/cairo/diacairo-renderer.c >@@ -315,6 +315,15 @@ set_fillstyle(DiaRenderer *self, FillStyle mode) > DIAG_STATE(DIA_CAIRO_RENDERER (self)->cr) > } > >+/* There is a recurring bug with pangocairo related to kerning and font scaling. >+ * See: https://bugzilla.gnome.org/buglist.cgi?quicksearch=341481+573261+700592 >+ * Rather than waiting for another fix let's try to implement the ultimate work >+ * around. With Pango-1.32 and HarfBuzz the kludge in Pango is gone and apparently >+ * substituted with a precision problem. If we now use huge fonts when talking >+ * to Pango and downscale these with cairo it should work with all Pango versions. >+ */ >+#define FONT_SIZE_TWEAK (72.0) >+ > static void > set_font(DiaRenderer *self, DiaFont *font, real height) > { >@@ -327,7 +336,7 @@ set_font(DiaRenderer *self, DiaFont *font, real height) > > #ifdef HAVE_PANGOCAIRO_H > /* select font and size */ >- pango_font_description_set_absolute_size (pfd, (int)(size * PANGO_SCALE)); >+ pango_font_description_set_absolute_size (pfd, (int)(size * FONT_SIZE_TWEAK * PANGO_SCALE)); > pango_layout_set_font_description (renderer->layout, pfd); > pango_font_description_free (pfd); > #else >@@ -707,14 +716,17 @@ draw_string(DiaRenderer *self, > pango_layout_iter_get_line_extents (iter, NULL, &extents); > shift = alignment == ALIGN_CENTER ? PANGO_RBEARING(extents)/2 : > alignment == ALIGN_RIGHT ? PANGO_RBEARING(extents) : 0; >+ shift /= FONT_SIZE_TWEAK; >+ bline /= FONT_SIZE_TWEAK; > cairo_move_to (renderer->cr, pos->x - (double)shift / PANGO_SCALE, pos->y - (double)bline / PANGO_SCALE); > pango_layout_iter_free (iter); > } > /* does this hide bug #341481? */ >- pango_cairo_update_context (renderer->cr, pango_layout_get_context (renderer->layout)); >- pango_layout_context_changed (renderer->layout); >+ cairo_scale (renderer->cr, 1.0/FONT_SIZE_TWEAK, 1.0/FONT_SIZE_TWEAK); >+ pango_cairo_update_layout (renderer->cr, renderer->layout); > > pango_cairo_show_layout (renderer->cr, renderer->layout); >+ /* restoring the previous scale */ > cairo_restore (renderer->cr); > #else > /* using the 'toy API' */ >diff --git a/samples/Self/pango-kerning-bug.dia b/samples/Self/pango-kerning-bug.dia >new file mode 100644 >index 0000000..55a6ff9
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 505928
:
373620
|
373622
| 374310