I've implemented a simple rectangle packing algorithm, which I want to use for the font texture.
The algorithm is only 40 lines long. It keeps track how far each row is already filled and greedily inserts rectangle at the place where they are "most to the left", starting with the tallest rectangles.