-- SVG text: the glyph outlines of all texts count against the render's points before they are made, 16 points a command (20 texts of 1,000 characters of a complex font ran the process out of memory), so very long texts need a larger output; many `<tspan>`s in one `<text>` take linear time (10,000 took 20 s); a `<textPath>` on a long path renders at a normal size; bitmap emoji (CBDT, sbix) are decoded once a render instead of once a draw (copies through `<use>` took minutes), at most 2048x2048 pixels each (larger ones aren't drawn, also in `renderText()`: one that said 16383x16383 ran the process out of memory), and counted before they are decoded, also damaged ones. `renderText()` counts the work of decoding and scaling its bitmap glyphs against 2^28 pixels plus 64 per pixel of the image (more throw a `LimitError`), keeps at most 2^22 pixels of scaled glyphs in a render and none after it (they were kept with the font: 1 GB a size), keeps rasters of outline and color glyphs with the font only up to 256 KB each, 16 MB a font and 8 text colors a glyph (62 letters at size 6000 kept 774 MB, a new color each render grew without end), counts the glyphs it rasterizes against the same work budget as bitmap glyphs (2000 huge glyphs without advance took 260 s), frees a size's rasters when its sizes are evicted, and keeps at most 16 instances of a variable font (a new weight each render ran out of memory after 8000), and doesn't draw a glyph scaled to more than 4 times the image (a strike at ppem 1 made a 32768x32768 copy for a 10x10 image).
0 commit comments