gennyble / textual

Text Rendering as a Service
Other
9 stars 1 forks source link

Too big fontsize or padding panics #11

Open gennyble opened 2 years ago

gennyble commented 2 years ago

If you try to make an image with an excessively large fontsize or padding, it will panic because there is not enough memory for the image buffer. Do we cap those values or see how big the resulting layout is and go from there?

gennyble commented 1 year ago

Cap these at sensible defaults. Total image size maybe 4096 × 2160? Wikipedia says it's a digital cinema standard. And we don't care about font size here maybe? When rasterizing that font, though, we don't want multiple gigabytes of glyphs in memory, though, so.