Skip to content

Allow text to flow through arbitrary frames (PR ready) #9

@tophatpanda

Description

@tophatpanda

I have added support for arbitrary placement of text:

frames-and-floats_thumbnail

The above image is from a new example that use these changes. The user defines a list of "frames", four-tuples with x-position, y-position, width, and height that they want the text to flow through. These can be given to skeleton.frame_layout() which uses them to create matching columns. The big change is that now the algorithms are flexible enough to deal with the columns suddenly changing size, which didn't really work previously.

My fork is at https://github.com/tophatpanda/python-typesetting, and I'd be happy to open a pull request if you like my changes.

Changes:

  • Made changes to knuth.py and texlib/wrap.py to make their algorithms handle a changing column-size halfway through a paragraph.
  • Added a new frame_layout() to skeleton.py.
  • composing.py has improved handling of single-line paragraphs.
  • I changed document.py and the py-londinium example a little bit by moving the conversion of inches into mm into the example's typeset.py. I wanted to use millimeters for my new example to easily set the page size to A4.
  • setup.py was missing the typesetting.texlib package.
  • The new example uses Lovecraft's short story "Dagon" (which is out of copyright) as a kind of expanded lorem-ipsum.

Thank you for such a well-thought out library (and a great presentation to match :). I'm not that used to GitHub, so I'm anticipating that you may want me to tweak things :P.

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions