On 9 Jun 2010, at 21:19, Leandro Fanzone wrote:
>
> Excellent, that was way more than I expected! Thank you very, very  
> much, the code I needed it's already adapted and working in my  
> project:

OK - glad it was useful.

A couple of comments:

1) I think it is good practice to call

        fl_delete_offscreen(offscreen_cxt);

at the end of your function, where you delete all the other resources  
used.

I am not sure if repeatedly calling "fl_create_offscreen()" without  
deleting in between does leak resources or not, but I suspect that it  
might, so best delete them to be sure.

You will note that I only create the one offscreen context at program  
start and simply re-use it on each iteration.
That might be more efficient for you - so long as the context you  
create is large enough for your biggest text string, of course!

2) Your code has even fewer comments in it than my example!

Otherwise, it looks alright to me.


In your other reply, you said...

> what I'm doing right now is a POS printer emulator, and most  
> printers have the feature of printing text in double width.

Now, POS is one of those unfortunate acronyms... I'm guessing you are  
using it to denote "Point Of Sale" but POS is also widely used to  
denote "Pile Of S**t" which is a whole different thing altogether!  ;-)

Cheers,
-- 
Ian


_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to