提交 72ee065c 编写于 作者: A Alex Dima 提交者: VS Code

Use dom char width reader in Safari

上级 56dad588
......@@ -216,8 +216,9 @@ function readCharWidthsFromCanvas(bareFontInfo: BareFontInfo, requests: CharWidt
export function readCharWidths(bareFontInfo: BareFontInfo, requests: CharWidthRequest[]): void {
// In IE11 and Firefox, it appears that ctx.measureText() always returns integer results.
// In Edge, ctx.measureText() gives floating point results, but they don't make any sense.
if (browser.isIE || browser.isFirefox) {
// In Edge, ctx.measureText() gives floating point results, but they are not the same.
// In Safari, ctx.measureText() also gives floating point results, but they are not the same.
if (browser.isIE || browser.isFirefox || browser.isSafari) {
readCharWidthsFromDom(bareFontInfo, requests);
return;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册