[Patch]: Added support for SVG graphics with dot
"Christian Eggers" <[email protected]>
| Newsgroups | gmane.text.doxygen.devel |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I've created a patch which adds support for generating Scaleable Vector Graphics instead
of bitmaps (for HTML output).
Most today's browsers have at least limited support für rendering svg graphics. I got the
best results with Opera, Konqueror is nearly Ok, Firefox has some work left...
SVG graphics are included with the <object></object> tag instead of <img>. I got most
information from SELFHTML (german only):
http://de.selfhtml.org/html/multimedia/objekte.htm#datendateien
For browsers which doens't support rendering SVG it's possible to show an alternative
content (e.g. a png graphic). Thus my patch creates additional png (fixed) graphics when
the user selects svg.
Patch description (generated with 'svn diff'):
- config.l:
o Added 'svg' item for DOT_IMAGE_FORMAT
- dot.h
o Added prototype for getPngImageSize() (see open issues)
- dot.cpp
o Implemented getPngImageSize() (see open issues)
o Generate an additional png file if the user selected svg format
o Include both files as mentioned in the above tutorial
- htmlvisitor.cpp:
o Generate an additional png file if the user selected svg format
o Include both files as mentioned in the above tutorial
I've tried to adopt the existing coding style as good as possible. There should be no
additional changes than those mentioned above. If the user doesn't select the svg format,
the patch shouldn't have any effects.
Open issues:
- Image size of the SVG graphics
It's not very straightforward to generate an svg file with the same image size compared to
an equal bitmap file. For reasons I don't understand the dot tool uses different sizes for
svg and png graphics. I've tried to change this by setting DPI to 96 in dot but the resulting
graphic was not rendered correctly in most of my browsers.
So I've decided to get the destination size from the png file (which is also created) and to
scale the svg to this value. This possibly strange way produced the most acceptable
results.
- Hyperlinks in the SVG graphics
For resons I don't know (perhaps a bug), all hyperlinks in the doxygen generated dot files
start with a '$' character. This char is also present in the generated map file. I've never
seen this before but it seems that it doesn't harm.
For svg graphics at least some browsers don't use the map file, they get information about
hyperlinks directly from the svg file. Dot also includes the $ from the dot file here. At least
in this case, my browsers failed to follow the link until I removed the $ char. Maybe it
would be the best to remove it at all.
regards
Christian
Der folgende Teil dieser Nachricht enthält einen Anhang im
sogenannten Internet MIME Nachrichtenformat.
Wenn Sie Pegasus Mail oder ein beliebiges anderes MIME-kompatibles
Email-System verwenden, sollte Sie den Anhang mit Ihrem Email-System
speichern oder anzeigen können. Anderenfalls fragen Sie Ihren Administrator.
The following section of this message contains a file attachment
prepared for transmission using the Internet MIME message format.
If you are using Pegasus Mail, or any another MIME-compliant system,
you should be able to save it or view it from within your mailer.
If you cannot, please ask your system administrator for assistance.
---- Datei Information/File information -----------
Datei/File: patch-svg.diff.gz
Datum/Date: 18 Nov 2007, 18:13
Größe/Size: 3296 bytes.
Typ/Type: Unbekannt
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Doxygen-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/doxygen-develop
patch-svg.diff.gz
(application/octet-stream, 3.2 KB) - not displayed