Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » UppHub » SvgDraw
SvgDraw [message #14814] Sat, 15 March 2008 18:17 Go to next message
kodos is currently offline  kodos
Messages: 111
Registered: March 2008
Experienced Member
Hi,

I have written a SvgDraw class to write SVG files. The most common features of the Draw class are supported right now. Credits also have to go to mrjt for some help Smile .

If I get a test case for features that aren't implemented yet, I will try to implement them Smile .

Simple example:
SvgDraw draw(450, 450);
draw.DrawText(10, 10, "Hello World", Roman(30).Bold());
SaveFile(_fileName + ".svg", draw.Finish());


Changelog:
19 March 2008:
   - Fixed some TODOs around clipping and offset
   - Added SVGZ support. (Call Finish(true) )
   - Added some CSS in the header of the file to reduce the size of bigger images.
  • Attachment: SvgDraw.7z
    (Size: 3.11KB, Downloaded 330 times)

[Updated on: Thu, 20 March 2008 18:12]

Report message to a moderator

Re: SvgDraw [message #14885 is a reply to message #14814] Tue, 18 March 2008 22:31 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
300 lines to get SVG output, not bad Smile

What about these TODOs?

IsPainting is simple one, just make it return true, but others will need some sort of svg implementation...

Mirek
Re: SvgDraw [message #14887 is a reply to message #14814] Tue, 18 March 2008 23:06 Go to previous messageGo to next message
kodos is currently offline  kodos
Messages: 111
Registered: March 2008
Experienced Member
Most of these TODOs I don't know what they should do, so I need an explanation or a test case to implement these Smile
Re: SvgDraw [message #14898 is a reply to message #14887] Wed, 19 March 2008 09:40 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
I see Smile

bool SvgDraw::ExcludeClipOp(const Rect& r)

Removes the r from current painting clip - means anything you draw inside r will not be drawn.

bool SvgDraw::IntersectClipOp(const Rect& r)

Painting clip will be intersection of current and r.

Rect SvgDraw::GetClipOp() const

You should return minal bounding rect for current clip. Anyway, returning Rect(-INT_MAX, -INT_MAX, INT_MAX, INT_MAX) is OK as well.

The rest can wait. However, the real question: Does SVG embed fonts? IMO, it should, just like PDF. In PdfDraw, 95% of code is dealing with this Wink

Mirek
Re: SvgDraw [message #14931 is a reply to message #14898] Thu, 20 March 2008 18:31 Go to previous messageGo to next message
kodos is currently offline  kodos
Messages: 111
Registered: March 2008
Experienced Member
Thanks for the info Smile
I updated the first post.

luzr wrote on Wed, 19 March 2008 09:40

However, the real question: Does SVG embed fonts? IMO, it should, just like PDF.


It is possible to embed fonts in SVG but:
1) I have written this for generating images for the web, and with fonts in the file, the file size grows very fast.
2) I haven't found an example which actually works in any viewer I have (Firefox3 beta, Opera 9.5 beta, Incsape)
Re: SvgDraw [message #14945 is a reply to message #14931] Fri, 21 March 2008 11:24 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
kodos wrote on Thu, 20 March 2008 13:31

Thanks for the info Smile
I updated the first post.

luzr wrote on Wed, 19 March 2008 09:40

However, the real question: Does SVG embed fonts? IMO, it should, just like PDF.


It is possible to embed fonts in SVG but:
1) I have written this for generating images for the web, and with fonts in the file, the file size grows very fast.
2) I haven't found an example which actually works in any viewer I have (Firefox3 beta, Opera 9.5 beta, Incsape)


OK.

Hm, maybe the right policy is to convert glyphs to curves, but I guess that is far beyond what we can do now Wink

Mirek
Re: SvgDraw [message #14956 is a reply to message #14945] Sat, 22 March 2008 15:05 Go to previous message
kodos is currently offline  kodos
Messages: 111
Registered: March 2008
Experienced Member
luzr wrote on Fri, 21 March 2008 11:24

Hm, maybe the right policy is to convert glyphs to curves, but I guess that is far beyond what we can do now Wink


It's possible but then the file will be huge Smile
Previous Topic: Another CImgCtrl (Zoom, drag, m. wheel, print, print embedded, etc )
Next Topic: Job opportunity for Ultimate++ developer
Goto Forum:
  


Current Time: Fri Mar 29 06:52:01 CET 2024

Total time taken to generate the page: 0.01303 seconds