Re: [Inkscape-devel] printf
mywidget(FOO, BAR, ftos(1.0/42.0));
It's nice, but now instead of the single
printf ("C %.8g %.8g %.8g %.8g %.8g %.8g", ....)
I will have to create 6 char[] buffers and call ftos 6 times, just as sodipodi 0.33 does... I'd like to avoid this if possible.
Also, I don't see any mention of some non-standard and potentially useful rounding modes in ftos. And something of what it offers (such as the *10^X notation) is useless for us because we need it for SVG, and SVG must remain parsable.
So for now, my vote is for including a standard locale-independent printf into the codebase. This will fix the win32 problems with minimum code disruption and will let us expand our printf version if necessary (e.g. with different rounding modes).
_________________________________________________________________ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=dept/features&pgmarket=en-ca&RU=http%3a%2f...
bulia byak wrote:
So for now, my vote is for including a standard locale-independent printf into the codebase. This will fix the win32 problems with minimum code disruption and will let us expand our printf version if necessary (e.g. with different rounding modes).
I seem to recall seeing something about locale being per-thread, so just be careful about that.
On Sat, 13 Dec 2003, bulia byak wrote:
mywidget(FOO, BAR, ftos(1.0/42.0));
It's nice, but now instead of the single
printf ("C %.8g %.8g %.8g %.8g %.8g %.8g", ....)
I will have to create 6 char[] buffers and call ftos 6 times, just as sodipodi 0.33 does... I'd like to avoid this if possible.
The ftos code is intended for situations where you want to bypass printf/sprintf and operate with a string class (such as Glib::ustring). I find it well suited for working with arbitrary numbers of data items, or where you want to retain the string forms separate from I/O, such as for sprintf. It isn't intended for being a drop-in replacement for printf, because if what you need is something just like printf, then use printf.
Anyway, the main feature for our purposes in my mind is that it allows trimming based on sigfigs as well as precision, rather than only on precision as the *printf routines do.
Also, I don't see any mention of some non-standard and potentially useful rounding modes in ftos. And something of what it offers (such as the *10^X notation) is useless for us because we need it for SVG, and SVG must remain parsable.
Here is the explanation of the round function:
// This routine rounds a double using the "rounding rule", as expressed // in _Advanced Engineering Mathematics_ by Erwin Kreyszig, 6th ed., // John Wiley & Sons, Inc., 1988, page 945. // // Discard the (k+1)th and all subsequent decimals. // (a) If the number thus discarded is less than half a unit in the // kth place, leave the kth decimal unchanged ("rounding down") // (b) If it is greater than half a unit in the kth place, add one // to the kth decimal ("rounding up") // (c) If it is exactly half a unit, round off to the nearest *even* // decimal. // Example: Rounding off 3.45 and 3.55 by one decimal gives 3.4 and // 3.6, respectively. // Rule (c) is to ensure that in discarding exactly half a decimal, // rounding up and rounding down happens about equally often, // on the average.
The x10 is just a rendering option; obviously it's just printing that instead of an 'E'.
So for now, my vote is for including a standard locale-independent printf into the codebase. This will fix the win32 problems with minimum code disruption and will let us expand our printf version if necessary (e.g. with different rounding modes).
Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=dept/features&pgmarket=en-ca&RU=http%3a%2f...
Hi Guys, What is happening on the Win32 exe package of 0.36? I notice that it is the last thing not done on the Milestone 2 Roadmap and it is not present in the Inkscape file list.
More seriously, I notice that the early version ( http://195.221.122.126/tmp/inkscape-0.36cvs-setup.exe) that Mael put up earlier on 28 November seems not to be available. Does this mean that there is no Win package available for people at present? Or is it somewhere obscure where I cannot see it?
I think it is important that there be a Win package available, even if it is not at the cutting edge. There are very few, (read any?) non--commercial SVG drawing packages available and none that I know are anywhere as good as Inkscape. There is no way that Win people are going to get interested if they cannot test the program.
There are a lot of Win people around, graphics users rather than developers, who are interested in SVG and who like myself have a lot of trouble with the SodiPodi implementation. Inkscape definately seems to be going in the right direction and it is so frustrating to read about changes but not to be able to participate.
Vellum
On Sun, 14 Dec 2003, vellum wrote:
Hi Guys, What is happening on the Win32 exe package of 0.36? I notice that it is the last thing not done on the Milestone 2 Roadmap and it is not present in the Inkscape file list.
It still needs to be done, and we'd greatly appreciate anyone who'd tackle it. We really need someone to commit to doing this through future releases, as most of the active developers currently are not doing development on Windows.
More seriously, I notice that the early version ( http://195.221.122.126/tmp/inkscape-0.36cvs-setup.exe) that Mael put up earlier on 28 November seems not to be available. Does this mean that there is no Win package available for people at present? Or is it somewhere obscure where I cannot see it?
I've reactivated it. We had deactivated the pre-releases when we finished the release. Maybe we should consider keeping them all up...
I think it is important that there be a Win package available, even if it is not at the cutting edge. There are very few, (read any?) non--commercial SVG drawing packages available and none that I know are anywhere as good as Inkscape. There is no way that Win people are going to get interested if they cannot test the program.
There are a lot of Win people around, graphics users rather than developers, who are interested in SVG and who like myself have a lot of trouble with the SodiPodi implementation. Inkscape definately seems to be going in the right direction and it is so frustrating to read about changes but not to be able to participate.
Thanks, this is useful feedback. Hopefully someone will contribute the windows port for 0.36 soon.
Bryce
Hello,
What is happening on the Win32 exe package of 0.36? I notice that it is
the
last thing not done on the Milestone 2 Roadmap and it is not present in
the
Inkscape file list.
http://195.221.122.126/tmp/inkscape-0.36-setup.exe [1.7 Mo] (I'm not completely sure this is 0.36 as the about.svg file says 0.36pre0 ..)
Things to remember : - If you use a locale with comma as decimal separator change it to dot - Non english users could have wrong display of fonts - Preferences are saved in the directory of install - Be carefull with the uninstaller because it will blindly remove all the install folder
I'll be away next few weeks ..and probably won't have much time next year to maintain a win32 port, especially with the important changes (c++) coming
M
Thanks Mael! Contributing these windows ports has been a major help to Inkscape, we much appreciate it.
Bryce
On Sun, 14 Dec 2003, Mael wrote:
Hello,
What is happening on the Win32 exe package of 0.36? I notice that it is
the
last thing not done on the Milestone 2 Roadmap and it is not present in
the
Inkscape file list.
http://195.221.122.126/tmp/inkscape-0.36-setup.exe [1.7 Mo] (I'm not completely sure this is 0.36 as the about.svg file says 0.36pre0 ..)
Things to remember :
- If you use a locale with comma as decimal separator change it to dot
- Non english users could have wrong display of fonts
- Preferences are saved in the directory of install
- Be carefull with the uninstaller because it will blindly remove all the
install folder
I'll be away next few weeks ..and probably won't have much time next year to maintain a win32 port, especially with the important changes (c++) coming
M
On Sun, 14 Dec 2003, vellum wrote:
Hi Guys, What is happening on the Win32 exe package of 0.36? I notice that it is the last thing not done on the Milestone 2 Roadmap and it is not present in the Inkscape file list.
Mael has created the package and I've uploaded it to the Inkscape file list.
http://sourceforge.net/project/showfiles.php?group_id=93438
This also marks the successful completion of Milestone 2, and our official start of M3. This was a very impressive release; when we laid out the tasks for M2 they seemed extremely ambitious, but everyone pitched in and we made swift progress.
Those who wish to work on a task for M3, please review the roadmap and if you see one that you want to do, put your name down for it. If you have questions let me know and I'll be happy to help get them answered. There's no rush and we don't have a due date in mind; the release will come when the tasks are done.
http://www.inkscape.org/cgi-bin/wiki.pl?Roadmap
Bryce
participants (5)
-
Bryce Harrington
-
bulia byak
-
Jon A. Cruz
-
Mael
-
vellum