After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 350726 - WMF/EMF export does not use correct fonts
WMF/EMF export does not use correct fonts
Status: RESOLVED FIXED
Product: dia
Classification: Other
Component: exports
0.95
Other All
: Normal normal
: 0.97
Assigned To: Dia maintainers
Dia maintainers
Depends on:
Blocks:
 
 
Reported: 2006-08-10 12:27 UTC by Boyan Brezinsky
Modified: 2008-05-03 14:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
an idea to have more correct fonts (7.63 KB, patch)
2007-01-03 22:39 UTC, Hans Breuer
needs-work Details | Review

Description Boyan Brezinsky 2006-08-10 12:27:42 UTC
Please describe the problem:
When exporting to WMF or EMF under Windows, dia sometimes does not format the text according to diagram formatting, but leaves fonts to default.

Steps to reproduce:
1. Create a new diagram and add some text.
2. Change the text formatting - e.g. change the font to Courier. Please note that this is NOT a TrueType font.
3. Export to EMF.
4. Open the EMF to see that the text is displayed with some kind of sans serif font, but not Courier. This also affects layout - the text in the exported file takes a different amount of space (usually more) than in the original diagram.

Since by default dia uses the font "sans" for new text and it is not clear to the user which Windows font, if any, maps to "sans", this causes layout problems in the exported files.

However, when using TrueType fonts for text, the export is performed correctly. 

Actual results:


Expected results:
The WMF/EMF file to have text formatted in the same way as in the original diagram.

Does this happen every time?
yes

Other information:
OS: Windows Server 2003
Appearance - "Windows Classic style" with no customizations.
Comment 1 Hans Breuer 2007-01-03 22:39:16 UTC
Created attachment 79334 [details] [review]
an idea to have more correct fonts

It is not possible to select a non TrueType font from the menus under windows because Pango simply does filter them. But there are "magic" font names like "sans", "serif", "monospace", maybe even "courier" which wont lead to the same font being rendered on display as on WMF/EMF. Infact the font name from Pango is passed literally to the GDI.
One way to solve this would be to map Pango's special names to the correct bits in CreateFont. The probably better one would be to render the text with Pango. A hacked version which does this is attached. I dont like it enough to be applied as is.
Comment 2 Hans Breuer 2008-05-03 14:46:14 UTC
finally solved:

2008-05-03  Hans Breuer  <hans@breuer.org>

	* plug-ins/wmf/wmf.cpp : use Pango for loading the font but not for 
	rendering (taking the better part of my patch to fix bug #350726)
	* plug-ins/makefile.msc : link wmf with pangowin32.lib, clean-up