GNOME Bugzilla – Bug 153609
Wrong (too small) text size in multiline text using PANGO eps export, also in zoom
Last modified: 2006-10-08 09:33:45 UTC
If I create multiline text item (using default sans font) and then export the diagram using PANGO font eps export, the resultant eps file renders with some lines of the text in right size, but others in very tiny size. There is no definite pattern to this, but apparently last line tends to be right size while others are randomly wrong sizes (not always same wrong size). Similar problem appears to occur if I zoom in (e.g. 200%) while editing the diagram: multiline text in the zomoed view has its lines in different sizes. In this case the problem goes away if I return to 100% view. The visual effect is very similar to the eps export problem, thus I believe they may have same root cause. Workaround: do not create multiline text items. Instead create a text item for each line. Suboptimal, but bearable. --Sampo
Created attachment 31891 [details] Diagram demonstrating size problem in multiline text This diagram reproduces the bug. Pay attention to string Fonte unidireccional de radiação If you export this diagram as eps, the words "Fonte" and "Unidireccional" will appear (unreadably) tiny while "de radiação" (the last line) will appear currectly. There are some other multiline texts such as 50 mm that have similar problems. The exported eps will appear incorrect at least under gs-8.13 and acroread-5.0.5, both on ix86 Linux. I'll also attach the eps as exported by me. --Sampo
Created attachment 31892 [details] esp export of the previous .dia, demoing text size problem in multiline text Result of exporting demo.dia
*** Bug 159320 has been marked as a duplicate of this bug. ***
*** Bug 153842 has been marked as a duplicate of this bug. ***
Created attachment 34950 [details] [review] Patch to disable font caching, avoiding size corruption problem (workaround) Although I can't fix this (the code is just too complicated to trace for someone unfamiliar with it), I have found that disabling the pango layout hash table lookups solves the drawing problem. I also can't reproduce any problem with EPS files, but that might just be blind luck. Attached is a patch to disable that. It's not a solution, but it is a workaround for those of us who need something like Dia but can't get any work done with this bug. If any of the Dia developers are interested in helping me fix this (you'll probably just need to tell me why the pango layout stuff is called recursively and multiple times for each single draw operation), then either contact me via email or on Jabber at l.withers@jabber.org
I can confirm that this patch (removal of font caching) fixes the problem for me in both EPS export and zooming cases. Lack of font caching has no noticeable performance impact on my machine. I have also noticed that the Pango EPS export is inferior to the Latin-1 EPS export in many other ways. Most annoying is that if diagram is wider than high, the Pango EPS export gratuitously inserts some PS code (bounding box?) that causes epstopdf to turn the image in landscape orientation. Overall, I have come to seriously mistrust the Pango EPS export. --Sampo
I can't confirm there is no "notable performance impact". Here are the numbers (obvoiusly the cache gives no benefit when a particular size is used once, thus zooming out *and* in again) : render-test.dia, DiaGdkRenderer, cached data_render(100%) took 0.007594 seconds data_render(70.7107%) took 0.80772 seconds data_render(50%) took 1.17371 seconds data_render(35.3553%) took 0.52543 seconds data_render(25%) took 1.8894 seconds data_render(17.6777%) took 0.555931 seconds data_render(12.5%) took 0.197765 seconds data_render(8.83883%) took 0.58174 seconds ***tweak warning data_render(12.5%) took 0.016257 seconds data_render(17.6777%) took 0.030712 seconds data_render(25%) took 0.078582 seconds data_render(35.3553%) took 0.038963 seconds data_render(50%) took 0.061452 seconds data_render(70.7107%) took 0.051567 seconds data_render(100%) took 0.017604 seconds render-test.dia, DiaLibartRenderer, cached data_render(100%) took 0.218115 seconds data_render(70.7107%) took 0.865666 seconds data_render(50%) took 1.18098 seconds data_render(35.3553%) took 0.529298 seconds data_render(25%) took 1.8001 seconds data_render(17.6777%) took 0.579032 seconds data_render(12.5%) took 0.992647 seconds ***tweak warning data_render(17.6777%) took 0.047259 seconds data_render(25%) took 0.080562 seconds data_render(35.3553%) took 0.049305 seconds data_render(50%) took 0.069063 seconds data_render(70.7107%) took 0.063167 seconds data_render(100%) took 0.028715 seconds data_render(100%) took 0.027931 seconds data_render(70.7107%) took 0.061703 seconds data_render(50%) took 0.072573 seconds data_render(35.3553%) took 0.044825 seconds data_render(25%) took 0.078248 seconds data_render(17.6777%) took 0.046632 seconds data_render(25%) took 0.068329 seconds data_render(35.3553%) took 0.039873 seconds data_render(50%) took 0.055611 seconds data_render(70.7107%) took 0.054095 seconds data_render(100%) took 0.029269 seconds data_render(70.7107%) took 0.052236 seconds data_render(100%) took 0.029765 seconds ** removed the text data_render(100%) took 0.000134 seconds data_render(70.7107%) took 0.002269 seconds data_render(50%) took 0.006061 seconds data_render(35.3553%) took 0.005264 seconds data_render(25%) took 0.002132 seconds data_render(17.6777%) took 0.006327 seconds data_render(12.5%) took 0.006999 seconds data_render(17.6777%) took 0.00245 seconds data_render(25%) took 0.002175 seconds data_render(35.3553%) took 0.002041 seconds data_render(50%) took 0.002108 seconds data_render(70.7107%) took 0.010439 seconds data_render(100%) took 0.00578 seconds
*** Bug 161875 has been marked as a duplicate of this bug. ***
*** Bug 162320 has been marked as a duplicate of this bug. ***
*** Bug 166077 has been marked as a duplicate of this bug. ***
The patch is in current CVS. If you want to see slowdowns, see the attached leak.dia. I'm seeing render times of up to 6 seconds on this.
Created attachment 37138 [details] Diagram with lots of text
*** Bug 151544 has been marked as a duplicate of this bug. ***
*** Bug 166781 has been marked as a duplicate of this bug. ***
*** Bug 122429 has been marked as a duplicate of this bug. ***
*** Bug 167368 has been marked as a duplicate of this bug. ***
*** Bug 151533 has been marked as a duplicate of this bug. ***
*** Bug 171329 has been marked as a duplicate of this bug. ***
*** Bug 172833 has been marked as a duplicate of this bug. ***
*** Bug 300605 has been marked as a duplicate of this bug. ***
*** Bug 300672 has been marked as a duplicate of this bug. ***
*** Bug 304076 has been marked as a duplicate of this bug. ***
*** Bug 306867 has been marked as a duplicate of this bug. ***
*** Bug 307116 has been marked as a duplicate of this bug. ***
Current cvs still has the buggy font cache. And it can even crash on it, see bug #307320
*** Bug 309766 has been marked as a duplicate of this bug. ***
Confirming:)
*** Bug 310835 has been marked as a duplicate of this bug. ***
*** Bug 312052 has been marked as a duplicate of this bug. ***
*** Bug 317799 has been marked as a duplicate of this bug. ***
*** Bug 317743 has been marked as a duplicate of this bug. ***
Cache now ifdef'd out.
*** Bug 323438 has been marked as a duplicate of this bug. ***
*** Bug 324291 has been marked as a duplicate of this bug. ***
*** Bug 331261 has been marked as a duplicate of this bug. ***
*** Bug 333231 has been marked as a duplicate of this bug. ***
*** Bug 335232 has been marked as a duplicate of this bug. ***
*** Bug 356781 has been marked as a duplicate of this bug. ***