Dia export to Cairo PNG causes mangled text fonts

Bug #463078 reported by Tel
146
This bug affects 31 people
Affects Status Importance Assigned to Milestone
dia (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: dia

Description: Ubuntu 9.10
Release: 9.10

dia 0.97-2
dia-common 0.97-2
dia-libs 0.97-2
libcairo2 1.8.8-2ubuntu1
libfreetype6 2.3.9-5
libpango1.0-0 1.26.0-1
libpango1.0-common 1.26.0-1

Method to demonstrate: load the file "text.dia" then export to PNG using Cairo and export to PNG using Pixbuf -- the character layout has a strange gap in the Cairo output. Note that output PNG files are also attached to this bug report, and this problem happens with various other more complex dia outputs as well as this simple example.

Revision history for this message
Tel (lists) wrote :
Revision history for this message
Tel (lists) wrote :
Revision history for this message
Tel (lists) wrote :
Revision history for this message
Tel (lists) wrote :

Possibly the locale might be relevant here:

LANG=en_AU.UTF-8
GDM_LANG=en_AU.UTF-8
XTERM_LOCALE=en_AU.UTF-8

I tried changing the local to the basic "C" locale and got exactly the same result (just changing environment variables). My screen is only 1024x600 if that makes a difference (but fonts onscreen always display correctly so seems unlikely that would be a factor).

Revision history for this message
Stefan Haller (haliner) wrote :

I have the same issue, too.
I need a transparent png and this is only possible with Cairo. Currently I must export it as a svg image (without Cairo) and create a png image with inkscape.

Changed in dia (Ubuntu):
status: New → Confirmed
Revision history for this message
drberg1000 (drberg1000) wrote :

Bug #512472 is a duplicate of this. https://bugs.launchpad.net/ubuntu/+source/dia/+bug/512472

I have the same trouble with cairo-pdf, cairo-ps, and cairo-svg as well as with the cairo pngs.

Revision history for this message
Marius (mquintus-deactivatedaccount) wrote :

It is the same bug as #512472
https://bugs.launchpad.net/ubuntu/+source/dia/+bug/512472

As i pointed out, Cairo seems to have a problem with kerning.
http://en.wikipedia.org/wiki/Kerning

Revision history for this message
Marius (mquintus-deactivatedaccount) wrote :

There is a work-around that avoids the kerning. Insert a zero-width space between the problematic characters.

Revision history for this message
Darrell (darrell-infrabyte) wrote :

Running dia-normal 0.97.2 on ubuntu 13:10
This mangles text on certain characters when exporting to cairo pdf, png or when printing.

Has anyone found a fix for this yet?

Revision history for this message
Ajay Anand (aanand-ub) wrote :

Yes, I confirm what Darrell says but for Ubuntu 13.04.
Running dia-normal 0.97.2 on ubuntu 13.04 renders exactly one mangled letter in each of about 30% of the words in the exported files. Most of the mangled letters are uppercase but few lower case letters are also affected.

Revision history for this message
Nihad Keserovic (nihad-keserovic) wrote :

For me it works if I change font family, test example Arial and set it as default by doubleclicking the "T" icon, on Ubuntu 13:04, Dia 0.97.2

Revision history for this message
D. Sean ONeill (oneillds) wrote :

Thanks for the pointers. Tried swapping for Arial and it almost worked. Still having an issue with capital "A's". Need to put a space before them. Other than that, cleaned up the kerning issue.

penalvch (penalvch)
no longer affects: dia (Ubuntu)
affects: dia (Debian) → dia
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in dia (Ubuntu):
status: New → Confirmed
Revision history for this message
penalvch (penalvch) wrote :

Tel, thank you for reporting this and helping make Ubuntu better. Exporting to Cairo Scalable Vector Graphic (*.svg) is deprecated. Any problems with it will not be addressed in Dia. Please switch to a different SVG format. For more on this, please see https://bugzilla.gnome.org/show_bug.cgi?id=735493 .

affects: dia → dia (Ubuntu)
Changed in dia (Ubuntu):
status: New → Won't Fix
Revision history for this message
Rorschach (rorschach-rev) wrote :

Ubuntu status is "won't fix"
Ubuntu status is "won't use"

This is a serious problem that prevents us from sharing Dia files as images. As a result, my client is pushing me to some stupid cloud based flowchart system because I can't produce a flow chart they can read. If people are spending the time to come here and report bugs, you owe them more than this:
"Changed in dia (Ubuntu):
status: New → Won't Fix"

At least describe a work around if the problem truly is fonts. The DEFAULT should work - that's what made Linux so much better than Solaris, and why slackware lost against debian and redhat. Eventually redhat failed because it was "broken by default" too often. Is Ubuntu saying, "Broken by default is expected behavior" now?

Revision history for this message
penalvch (penalvch) wrote :

Rorschach, did you actually read any of https://bugs.launchpad.net/ubuntu/+source/dia/+bug/463078/comments/17 ?

If so, you not only know why this isn't supported, but that you have various other svg export options to choose from in Dia, except for exactly one:
Cairo Scalable Vector Graphic (*.svg)

As well, it's not a default for any other reason then it's in alphabetical order.

Revision history for this message
Rorschach (rorschach-rev) wrote :

I've exported to every image format including SVG and kerning is wrong on all of them.

Revision history for this message
penalvch (penalvch) wrote :

Rorschach, then you are experiencing a different problem then the one scoped to this report. Please file a new report via a terminal and please feel free to subscribe me to it:
ubuntu-bug dia

Revision history for this message
Martijn (kleptog-l) wrote :

Christopher,

The bug report is about exporting to PNG (see title), so saying "Won't fix" because export to SVG is deprecated seems odd.

The only reason SVG got mentioned in this bug report is because it appears to be the only format that *isn't* broken.

Can confirm that PNG & PDF are both broken here, and SVG export works fine (even if it is deprecated).

Ubuntu 14.04, dia 0.97.2-15ubuntu1

Revision history for this message
Martijn (kleptog-l) wrote :

Ok, I think I've found the confusion. This bug got linked to the wrong upstream bug. The upstream bug linked is gnome-bugs #735493 which is about SVG.

It should be linked to the following bugs (which I've tried to do):

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=714296
https://bugzilla.gnome.org/show_bug.cgi?id=696128
https://bugzilla.gnome.org/show_bug.cgi?id=705164
https://bugzilla.gnome.org/show_bug.cgi?id=573261

Debian has pushed a new version 0.97.2-16 which fixes this issue.

Changed in dia:
importance: Unknown → Medium
status: Unknown → Invalid
Changed in dia (Debian):
status: Unknown → Fix Released
Revision history for this message
Emeric Vigier (emeric-vigier) wrote :

As a workaround, I do this:
- View > Show grid > disable
- View > Show connection points > disable
- Ubuntu 14.04 > snapshot > select area to grab

Cumbersome but working :-/

Revision history for this message
penalvch (penalvch) wrote :

Tel, regarding the scope of this report, I am closing it because the bug has been fixed in the latest development version of Ubuntu - Vivid Vervet.

This is a significant bug in Ubuntu. If you need a fix for the bug in previous versions of Ubuntu, please perform as much as possible of the SRU Procedure [1] to bring the need to a developer's attention.

[1]: https://wiki.ubuntu.com/StableReleaseUpdates#Procedure

no longer affects: dia (Ubuntu)
affects: dia (Debian) → dia (Ubuntu)
Changed in dia (Ubuntu):
importance: Unknown → Undecided
status: Fix Released → New
no longer affects: dia (Ubuntu)
affects: dia → dia (Ubuntu)
Changed in dia (Ubuntu):
importance: Medium → Undecided
status: Invalid → New
importance: Undecided → Low
status: New → Fix Released
Revision history for this message
Jason LaPier (jason-lapier) wrote :

In case anyone else comes along with the same problem: I was able to work around by choosing the file type during export and instead of using Cairo PNG, I used PNG (anti-aliased). This doesn't give you a transparency option, but for my purposes it worked fine.

Revision history for this message
Albert Pool (albertpool) wrote :

This bug affects me too on Linux Mint 17.1 with dia 0.97.2-15ubuntu1 from the Ubuntu Trusty repository. I'll probably look at the procedure posted by penalvch tonight.

Revision history for this message
qetuR (petur-hjartarson) wrote :

Yes, this happend to me to. I changed all fonts from serif to monospace. All text looks "decent".

Revision history for this message
Jess (doubtful500) wrote :

Thanks to Petur's suggestion, I changed my fonts from sans to monospace, and that seems to help. I can now output PDFs via the Cairo library.

Revision history for this message
asavah (irherder) wrote :

Which fix was released?

I'm still having same problem on trusty 14.04.

Isn't it possible to fix the goddamn bug is SIX years?

Revision history for this message
Tel (lists) wrote : Re: [Bug 463078] Re: Dia export to Cairo PNG causes mangled text fonts

To asavah, check above I believe he said you need version 15.04 or better.

However, I will admit I have not tested it, having moved to CentOS some years ago.

Revision history for this message
Danny Howard (dannyman) wrote :

For asavah: you should be able to fix via backports: https://help.ubuntu.com/community/UbuntuBackports

Unfortunately, there does not seem to be a backport for this fix, so yes, LTS ... can be a bit frustrating ...

Revision history for this message
Cerin (chrisspen) wrote :

To anyone still confused by this, the workaround (at least in Ubuntu 14) is to simply not use any export option labeled "Cairo". Cairo simply doesn't handle text very well. If you need to export to PNG or SVG, use one of the PNG or SVG export option that's non-Cairo based. These worked perfectly for me.

Revision history for this message
Jonathan Seawright (jonathan-r-seawright) wrote :

Re @Cerin's workaround, I didn't have any other PDF options other than Cairo (on 14.04 and dia 0.97.2)
I went and manually installed the latest .debs from 16.04, and they fix the printing issues. Here's what I did:

Download the amd64 .deb from these URLs:
 * http://packages.ubuntu.com/xenial/amd64/dia-common/download
 * http://packages.ubuntu.com/xenial/amd64/dia-libs/download
 * http://packages.ubuntu.com/xenial/amd64/dia/download

sudo dpkg -i dia-common*.deb
sudo dpkg -i dia-libs*.deb
sudo dpkg -i dia*.deb

Now, I can print to PDF without any kerning issues.

I think this really needs to be sent back to 14.04 somehow, probably from the general updates repo. According to the https://wiki.ubuntu.com/UbuntuBackports page, this probably doesn't fall into the normal backports category since 0.97.3 doesn't provide any new features (I haven't checked, assuming so).

Revision history for this message
biljkus (biljkus) wrote :

Thank you Jonathan Seawright.

I have Ubuntu 14.04.5 LTS, and your suggestion worked for me.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.