vercel / satori

Enlightened library to convert HTML and CSS to SVG

Home Page:https://og-playground.vercel.app

Repository from Github https://github.comvercel/satoriRepository from Github https://github.comvercel/satori

Scale with text overflow hidden unless using background clip

vinnymac opened this issue · comments

Bug report

Description / Observed Behavior

When applying ellipsis styles I noticed that text was disappearing if I also used a scale transform.

Removing either the ellipsis styles or the transform fixes the issue. Applying a background clip also shows the text.

Narrowing the issue down further, it appears to happen when using both overflow: hidden and transform: scale() at the same time.

Expected Behavior

I would have expected the transform to apply without the text being hidden.

Reproduction

🐛 with overflow hidden & transform

✅ Only transform

✅ Only overflow hidden

Revealed by background clip

Additional Context

Could this be related to #639?

Satori v0.12.0 and v0.11.3

I haven't yet tested older versions (does the playground support changing the version?)

My current workaround uses @shuding/opentype.js to measure the font width of every character and rendering the ellipsis myself instead when utilizing a scale transform.