Conversation
|
The performance problem and rendering glitches are caused by radial gradients. I fixed a problem of SVG rendering, but there’s nothing wrong in the generated PDF as far as I can tell. Chrome is OK. Firefox misses some gradients depending on the PDF zoom level, that’s definitely a problem in Firefox. Gradients are broken in Epiphany. Poppler is a bit slow but gives the correct rendering. Ghostscript is probably the best tool to understand why renderings can be long. Generated Emojis include very large rectangles with gradients, but these rectangles are clipped by masks or by the image boundaries. Unfortunately, the clipping region isn’t used to reduce the rendering time. Here are examples: <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">
<defs>
<radialGradient id="gr0" gradientUnits="userSpaceOnUse"
cx="50" cy="50" r="50"
fx="50" fy="50" fr="25">
<stop offset="0" stop-color="red"/>
<stop offset="1" stop-color="black"/>
</radialGradient>
</defs>
<rect x="0" y="0" width="100" height="100" fill="url(#gr0)"/>
</svg>This is rasterized easily by Ghostscript. But setting a The problem is that emojis, at least in Noto, contain a lot of these clipped elements with gradients. Tweaking font size gives better cases sometimes, but we don’t want workarounds that would probably be different for different fonts, just because rendering tools are not optimized. As Chrome (probably the most widely used PDF reader) seems to be OK, I guess that we can accept this limitation. I’ll test Adobe Acrobat Reader too. |
A few notes:
We have to do better before merging.