News for hackers. Stuff that matters.
Re:Treesaver.js - JavaScript library for creating magazine s... by giberson on Monday February 07, 2011 @10:28AM (#2189204)
Nice work so far, but from the demos it's missing an important layout feature commonly seen in magazines. Spanning an image or text insert half way between two columns and having the text of the columns flow around it.

A quick example I found in a google image search: http://irenevilar.com/images/uploads/elle_p1.jpg

If that could be incorporated then instant win.

Re:Treesaver.js - JavaScript library for creating magazine s... by fortes on Monday February 07, 2011 @10:51AM (#2189328)
I would love to support this, but we don't right now due to performance reasons.

Dirty laundry: Each paragraph is laid out and measured only once (at a specific column width), then the metrics are all cached. Layout is then performed by dumping paragraphs into each column and just clipping whatever overflows.

The advantage is that this process is very fast, even on a mobile device. Try resizing a window and notice how quick the re-layout is.

The downside is that certain layouts are not possible right now, such as the example you've shown.

As browsers get faster, we'd like to start doing our own line layout, which would let us do far more here (with a performance penalty, unfortunately).