Hi all,

I'm writing a small app that will effectively "scroll" a large image generated procedurally. The image will have O(1000) words on it, some rectangles, etc.. I don't need to interact with the words or edit them in any way, just show them. My code is too slow right now.

Currently, the only way to draw text appears to be directly in a stack, using one of the text methods (para, inscription, etc.). This means every text block is a full-fledged object that must be managed. I'm guessing that is really hurting performance when I want to draw this many words (from reading the "rules" page).

For example, I can do:

Shoes.app do
  para "foo", :top => 10, :left => 10
end

but can't do:

Shoes.app do
  image 300, 300 do
    para "foo", :top => 10, :left => 10
  end
end

Any thoughts on adding text-drawing methods (preferably mimicking the NodeBox API)? I looked through canvas.c to get some idea of how the current text functions work, but I'd probably need some pointers on where to start.

For a mock-up of the app (with lots of rectangles and words), check out:

http://gist.github.com/14909

There's a flag at the top that allows you to set either an "image" as the container (no text), or just draw straight into a "stack".

Thanks!
BG

Reply via email to