-
Notifications
You must be signed in to change notification settings - Fork 50
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
新必应聊天导出后,大部分引用的链接由一行变成两行 #8
Comments
我似乎无法提交 bing chat 的加入等候列表,可以提供个最小的复现片段吗 😄 |
分析了下,不知道是不是字体的问题,链接的字在原网页上偏细,而在codepen复现的时候,字跟输出的图片一样粗。 原网页前端比较复杂,个人没找出为何字那么细的原因,抱歉。 |
或者等我申请个 Bing Chat 再试试 😄 |
disable cache后,仅有一个下载svg的请求
var(--cib-font-text): -apple-system, Roboto, SegoeUI, "Segoe UI", "Helvetica Neue", Helvetica, "Microsoft YaHei", "Meiryo UI", Meiryo, Arial Unicode MS, sans-serif @font-face {
font-family: 'Roboto Light';
src: url(/sa/simg/Roboto_Light.woff2) format('woff2');
unicode-range: U+0-FF,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2212,U+2215
}
@font-face {
font-family: 'Roboto';
src: url(/sa/simg/Roboto_Regular.woff2) format('woff2');
unicode-range: U+0-FF,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2212,U+2215
}
@font-face {
font-family: 'Roboto Semibold';
src: url(/sa/simg/Roboto_Semibold.woff2) format('woff2');
unicode-range: U+0-FF,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2212,U+2215
}
@font-face {
font-family: 'Roboto';
font-weight: 200;
src: url(/sa/simg/Roboto_Light.woff2) format('woff2');
unicode-range: U+0-FF,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2212,U+2215
}
@font-face {
font-family: 'Roboto';
font-weight: 300;
src: url(/sa/simg/Roboto_Light.woff2) format('woff2');
unicode-range: U+0-FF,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2212,U+2215
}
@font-face {
font-family: 'Roboto';
font-weight: 600;
src: url(/sa/simg/Roboto_Semibold.woff2) format('woff2');
unicode-range: U+0-FF,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2212,U+2215
}
@font-face {
font-family: 'Roboto';
font-weight: 700;
src: url(/sa/simg/Roboto_Semibold.woff2) format('woff2');
unicode-range: U+0-FF,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2212,U+2215
} |
感谢,这应该是我的一个 bug,当 可以尝试 p: Bing Chat 在申请了 😄 |
😂 那还是等晚些申请通过了,我自己试试确认下问题 |
I have similar problem too, it also appears in html-to-image package. Sometimes width of text element and width of container holding the text doesn't match and it causes text to line wrap. Added whitespace nowrap for temporary fix. |
初步判断应该是 svg+xml 的字体渲染和源 html 内的不一致 可能是 opentype 的 gsub 表部分逻辑浏览器渲染不一致导致的 https://learn.microsoft.com/en-us/typography/opentype/spec/gsub 此处发现一个相关的测试用例 https://github.com/qq15725/modern-screenshot/blob/v4.4.2/test/fixtures/dom.comment.html 在 4.4.1 版本(未移除注释)下能复现 |
Any other solutions to this? I tried |
If someone can provide a copy of the code, it can help me solve this problem |
必应这个网站一堆 shawdowdom,我个人不知道怎么下载。 如果你的 Bing 账号还没通过,那可以试试这个方法:
前两周是秒通过的,不知道现在怎样 |
I'm trying to replicate the issue, but I'm unable to get modern-screenshot to load the custom font: Not sure how to get the font "Montserrat" loaded in this playground example. I'm able to do it on my own code, it's just not working here (I'm not very familiar with Vue). The problem only occurs when I'm using a custom font. If I disable fonts (like it is here), there is no problem. |
It seems normal Codepen html playground |
Thanks. I can't reproduce the exact problem at the moment, but it might have something to do with Firefox. The bottom of the text is cut off in Firefox, but displays correctly on Chrome. If I disable the custom font, it renders correctly in Firefox. Both cases work on Chrome. Still not the exact problem I was having before, but that problem was also fixed by disabling Montserrat and going with browser default. I'll try and come up with a better example when I have some more time. Picture of result in Firefox (note the text is cutoff at the bottom. It's not cutoff in the original rendering). It also looks like the font is incorrectly rendered, or rendered at a different weight in Firefox: |
Hi @qq15725 and thanks for your amazing work ! I came across this problem which was coming with several font families, sizes, and weights. It occurs to me that it might be because of very small approximations which makes the text slightly bigger, overflow and being wrapped. I tried to make all font sizes smaller when rendering by only 0.01% and as far as I tested, all my problems are gone. To do this, I just added the following code in function copyCssStyles : const fs = style.get('font-size')
if(fs){
const value = splitValueAndUnit(fs[0])
style.set('font-size', [value.value * 0.9999 + value.unit, ''])
} I'll tell you if I see the problem appearing again. |
I was facing this issue and solved it inspired on @emmanuelpignat solution. I'm using the
I hope this can be of help for some of the folks dealing with this issue. As a side comment, the solution from @emmanuelpignat and multiplying the font size by 0.9999 didn't work for me, at least it didn't decrease the font-size enough to prevent the texts from wrapping up. My hypothesis is that when applying that operation to pixel units, the font is not reduced enough, maybe if using em or rem units it may work differently. |
fix #104 |
在必应聊天分享与保存项目引用了你这个库,效果很不错的。
只是目前还有一点疑问,怎么才能把变成文本两行的引用调整成一行?
效果图
原网页
引用部分的css
The text was updated successfully, but these errors were encountered: