Libove Blog

Personal Blog about anything - mostly programming, cooking and random thoughts

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.

Debug rendering showing 1600 random rectangles packed into a canvas

#rust #gamedev





Interactions

Liked by Silk_Flame (she/her) 😷

Liked by Oto Šťáva

Liked by tia maimai :neoghost_glasses:

Reposted by Vini

Liked by Vini

Reposted by Niko