-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS15 failed to generate picture #2633
Comments
Find the cause of the problem, because the HTML contains Chinese. Replace the Chinese with numbers or words to render normally I hope to fix this bug as soon as possible |
@niklasvh Please look at this question |
My project is about to be published. This problem makes it impossible to publish |
I don't have an iOS 15 device to test with and github actions don't support macos 11 / ios 15 simulators yet., so without being able to repro this it's quite difficult to start fixing it. |
@H-Sven The iOS 15 simulator tests work fine with Chinese, see for example https://html2canvas.hertzen.com/tests/?browser=Safari_IOS_15&test=/tests/reftests/text/lang/chinese.html. Could you provide a repro of the bug on jsfiddle? |
@niklasvh I have found the reason for the bug!
|
https://github.com/niklasvh/html2canvas/issues/2547 Check "-apple-system" in "Font Family". In iOS 15, using "-apple-system" will cause canvas rendering to fail. |
thank |
是这个原因吗?我也不确定,是不是把 -apple-system 字体干掉就行了? |
是的,我是vue项目,引入了vant组件, vant组件的样式里面设置了-apple-system字体,我给根元素设置了font family覆盖vant组件的font family就好了 |
It's really working after |
where can I remove the -apple-system |
在mac上safari15的预览版上,html2canvas会导致页面挂掉,我的代码里面也没有-apple-system字体。 |
Could you tell me how you found out? |
I'm using an old version and I have this issue, I'm not using chinese fonts however, how do I fix this? |
This fix doesn't seem to work for me. Any other ideas? Debug trace on IOS15 |
How do u know it is caused by font-family.It is amazing |
太牛了 这个问题困扰了我好久好久 终于解决了 我使用的是angular框架,使用的的UI框架默认加了 -apple-system |
In my case, I define other font-family, I just remove 'san-serif' |
iOS15 failed to generate picture
In iOS15 system, it takes a long time to generate pictures, and the generated pictures lack content.
Lost all text and some pictures
The text was updated successfully, but these errors were encountered: