chaoticbob / Cinder-SdfText

libcinder.org
SIL Open Font License 1.1
40 stars 20 forks source link

Feature request: use bin packing instead of fixed spacing. #4

Open paulhoux opened 8 years ago

paulhoux commented 8 years ago

More glyphs would fit on a single texture if bin packing were used. For this kind of stuff, offline bin packing can be used when adding many characters at once (or when doing an optimization step) and online bin packing can be used when adding one character at a time.

I happen to have a bin packing implementation ready for use, let me know if you're interested. It's not perfect and starts to slow down when packing >1000 glyphs, but it's a start. This will complicate texture creation, but only marginally.

-Paul

paulhoux commented 8 years ago

See: https://github.com/paulhoux/Cinder/tree/bin_packing