Thread: [Canvasdraw-users] two problems
Brought to you by:
scuri
From: Boyko B. <bo...@gm...> - 2010-10-13 08:50:52
|
Hello, I have two problems to report or ask help for. One is about plotting on PostScript and SVG canvases. Sometimes the generated (text) output is syntactically incorrect: it turns out that all fractional numbers have commas in place of decimal dots. This must be, I guess, due to the curent environment's language (locale) settings getting involved somehow, but that should actually not happen. The other problem is with the newly introduced contextplus feature. I do “cd.InitContextPlus()” before creating a CD canvas (within an IUP canvas), with the intent to get a smoother graphics rendering using Cairo (which I do have installed). However, no change of context takes place. Am I missing something? Is there anything else to be done in order to activate Cairo rendering? I am using Ubuntu and IUPLua, CDLua. Thank you in advance. Regards, Boyko |
From: Antonio S. <sc...@te...> - 2010-10-13 17:17:17
|
> One is about plotting on PostScript and SVG canvases. > Sometimes the generated (text) output is syntactically > incorrect: it turns out that all fractional numbers have > commas in place of decimal dots. This must be, I guess, > due to the curent environment's language (locale) settings > getting involved somehow, but that should actually not happen. It is a bug. The SVG specification states that it must be a dot in decimal numbers. Thanks for reporting. This is simple to fix. Did you compiled from source or downloaded pre-compiled binaries? > The other problem is with the newly introduced contextplus > feature. I do “cd.InitContextPlus()” before creating a CD > canvas (within an IUP canvas), with the intent to get a > smoother graphics rendering using Cairo (which I do have > installed). However, no change of context takes place. > Am I missing something? Is there anything else to be done > in order to activate Cairo rendering? Assuming that you are using IUP 3, and loading CD dynamically with require, the call require"cdluacontexplus" will already call cd.InitContextPlus() for you, so there is no need for that. What you need is to call, for example: cd.UseContextPlus(true) canvas = cd.CreateCanvas(xxx) cd.UseContextPlus(false) Best, Scuri |
From: Boyko B. <bo...@gm...> - 2010-10-13 22:17:58
|
Thanks for helping. > ... or downloaded pre-compiled binaries? Yes. I did require"cdluacairo" and called cd.UseContextPlus() as you suggested, but, unfortunately, still have no success – now what I get is just a blank canvas. (If I remove the calls to cd.UseContextPlus(), the drawing is there, but is jagged, as can be expected.) Could you please give a minimal example with an IUPLua window and a Cairo CD canvas within it, which I could use as a starting point? Thanks again, Boyko |
From: Antonio S. <sc...@te...> - 2010-10-15 02:42:35
Attachments:
iuplua_cdlua.wlua
|
Hi, I found a bug that caused the blank canvas. You can download pre-compiled binaries with all the fixes so far from this link: http://www.tecgraf.puc-rio.br/~scuri/tmp/cd_Linux26g4_fixes.tar.gz The SVG fix is also included. Attached is a sample to test the Cairo fix. I'm working in IUP and as soon as I complete two small tasks, there will be new versions of CD and IUP. Best, scuri > -----Original Message----- > From: Boyko Bantchev [mailto:bo...@gm...] > Sent: quarta-feira, 13 de outubro de 2010 19:18 > To: CD discussion list. > Subject: Re: [Canvasdraw-users] two problems > > Thanks for helping. > > > ... or downloaded pre-compiled binaries? > > Yes. > > I did require"cdluacairo" and called cd.UseContextPlus() > as you suggested, but, unfortunately, still have no success > – now what I get is just a blank canvas. > (If I remove the calls to cd.UseContextPlus(), the drawing > is there, but is jagged, as can be expected.) > > Could you please give a minimal example with an IUPLua > window and a Cairo CD canvas within it, which I could use > as a starting point? > > Thanks again, > Boyko > > ----------------------------------------------------------------------- > ------- > Beautiful is writing same markup. Internet Explorer 9 supports > standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. > Spend less time writing and rewriting code and more time creating > great > experiences on the web. Be a part of the beta today. > http://p.sf.net/sfu/beautyoftheweb > _______________________________________________ > Canvasdraw-users mailing list > Can...@li... > https://lists.sourceforge.net/lists/listinfo/canvasdraw-users |
From: Boyko B. <bo...@gm...> - 2010-10-15 18:47:47
|
Hi Antonio, Thank you a lot for being so responsive. The on-screen drawing indeed works properly now with contextplus, but, alas, the PostScript and SVG drivers still output commas in place of decimal dots. Regards, Boyko |
From: Antonio S. <sc...@te...> - 2010-10-15 19:17:04
|
> The on-screen drawing indeed works properly now with contextplus, > but, alas, the PostScript and SVG drivers still output commas > in place of decimal dots. I did change only the SVG driver. I will do some tests here in a non English environment that I have here and let you know what happen. Best, Scuri |
From: Antonio S. <sc...@te...> - 2010-10-13 17:54:53
|
Correction, instead of: require"cdluacontexplus" Use: require"cdluacairo" Best, Scuri |
From: Antonio S. <sc...@te...> - 2010-10-13 19:23:22
|
BTW, this should be fixed in the next CD version, so you will do: require"cdluacontexplus" As expected. So in Windows will use GDI+, in Linux will use Cairo, and in other UNICES will use XRender. Best, scuri > -----Original Message----- > From: Antonio Scuri [mailto:sc...@te...] > Sent: quarta-feira, 13 de outubro de 2010 14:55 > To: 'CD discussion list.' > Subject: RE: [Canvasdraw-users] two problems > > Correction, instead of: > > require"cdluacontexplus" > > Use: > > require"cdluacairo" > > Best, > Scuri |
From: Antonio S. <sc...@te...> - 2010-10-13 22:35:04
|
Hi, I'm going to fix the SVG problem and make available a pre-compiled binary so you can test this and the Cairo drawing with the latest version. With package you downloaded? Best, scuri > -----Original Message----- > From: Boyko Bantchev [mailto:bo...@gm...] > Sent: quarta-feira, 13 de outubro de 2010 19:18 > To: CD discussion list. > Subject: Re: [Canvasdraw-users] two problems > > Thanks for helping. > > > ... or downloaded pre-compiled binaries? > > Yes. > > I did require"cdluacairo" and called cd.UseContextPlus() > as you suggested, but, unfortunately, still have no success > – now what I get is just a blank canvas. > (If I remove the calls to cd.UseContextPlus(), the drawing > is there, but is jagged, as can be expected.) > > Could you please give a minimal example with an IUPLua > window and a Cairo CD canvas within it, which I could use > as a starting point? > > Thanks again, > Boyko > > ----------------------------------------------------------------------- > ------- > Beautiful is writing same markup. Internet Explorer 9 supports > standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. > Spend less time writing and rewriting code and more time creating > great > experiences on the web. Be a part of the beta today. > http://p.sf.net/sfu/beautyoftheweb > _______________________________________________ > Canvasdraw-users mailing list > Can...@li... > https://lists.sourceforge.net/lists/listinfo/canvasdraw-users |
From: Boyko B. <bo...@gm...> - 2010-10-14 05:39:27
|
> With package you downloaded? I am using these: CD: cd-5.4_Linux26g4_lib.tar.gz IUP: iup-3.2_Linux26g4_bin.tar.gz iup-3.2_Linux26g4_lib.tar.gz (with Lua 5.1 as packaged within Ubuntu). Regards, Boyko |
From: Antonio S. <sc...@te...> - 2010-10-19 15:45:35
|
Hi, The SVG fix was broken. Try this one: http://www.tecgraf.puc-rio.br/~scuri/tmp/cdsvgfix_Linux26g4.tar.gz Let me know if it works for you. > The on-screen drawing indeed works properly now with contextplus, > but, alas, the PostScript and SVG drivers still output commas > in place of decimal dots. Still did not fix the PS driver. But the idea will be the same. What I did is to call: setlocale(LC_NUMERIC, "C"); in CreateCanvas. And restore the previous locale in KillCanvas. Best, Scuri |
From: Boyko B. <bo...@gm...> - 2010-10-19 19:23:38
|
On 19 October 2010 18:45, Antonio Scuri <sc...@te...> wrote: > ... > http://www.tecgraf.puc-rio.br/~scuri/tmp/cdsvgfix_Linux26g4.tar.gz > > Let me know if it works for you. > ... Yes it does! Great job, thank you! Best regards, Boyko |