cancel
Showing results for 
Search instead for 
Did you mean: 

ProcessDiagramGenerator.generateDiagram platform dependent

gromar
Champ in-the-making
Champ in-the-making
ProcessDiagramGenerator.generateDiagram generates platform dependent images.
The problem is usage of platform specific fonts. The difference is small but it differ. It is causing problems in automated tests. (I was not able to upload images)

How to solve this problem?

http://download.java.net/jdk8/docs/technotes/guides/2d/spec/j2d-intro.html
Truly platform-independent fonts are possible only when the fonts are built-in (provided as part of the JDK software), or when they are mathematically or programmatically generated. The Java 2D API does not currently support built-in or mathematically generated fonts, but it does enable the programmatic definition of entire fonts through their glyph set. Each glyph can in turn be defined by a Shape that consists of line segments and curves. Many fonts of particular styles and sizes can be derived from a single glyph set.
5 REPLIES 5

jbarrez
Star Contributor
Star Contributor
Yes, we're aware of that issue, but I'm afraid it's not something that is easily fixable…. or do you think there is an easy fix?

gromar
Champ in-the-making
Champ in-the-making
Quick fix:
Different approach could be to use SVG to generate platform independent graphs. I try to implement ProcessDiagramCanvas with SVG (follow link first implementation).

I run jUnit tests on different platforms and it seems it works. e.g. PNG <-> SVG result comparison example
PNG image:
[img]https://raw.github.com/gro-mar/activiti-crystalball/master/image-builder/src/test/resources/org/acti...[/img]

SVG output

pgadecki
Champ in-the-making
Champ in-the-making
I have mentioned about a solution in here http://forums.activiti.org/en/viewtopic.php?f=6&t=2874
I have even created a patch for it but I didn't get a legal permission to commit to open source projects so I can't do this.

gromar
Champ in-the-making
Champ in-the-making
I do not know how to "define of entire font by program". And I did not find any tutorial for that.

jbarrez
Star Contributor
Star Contributor
Sure, making it pluggable would be one step … but how many people would actually do that then?
I'd like to tackle in in a general way, where people don't need to tweak anything.