Html2canvas: Font-size can't be rendered correctly in Chrome

Created on 21 Sep 2018  ·  12Comments  ·  Source: niklasvh/html2canvas

Bug reports:

The font-size can't be rendered correctly in Chrome. The render effects differ between chrome and firefox as shown below. I'm not quite sure weather it's a question of html2canvas or browser issues.

rendered in Chrome

image

rendered in Firefox ( same as origin DOM nodes ):
image

Specifications:

  • html2canvas version tested with: 1.0.0-alpha.12
  • Browser & version: Chrome 69 & firefox 62
  • Operating system: Windows 10 Professional

Most helpful comment

@nazhenhuiyi Thank you very much. It deed works for me. I set font-variant: normal and get the correct result.

All 12 comments

https://github.com/niklasvh/html2canvas/issues/1664

maybe it's a same problem, you can delete font-variant css property.

@Coodool

@nazhenhuiyi Thank you very much. It deed works for me. I set font-variant: normal and get the correct result.

the same to me!

I found that setting the element container font style will do that trick.

.container {
  font-variant: normal;
}

I also encountered this problem, handled in the above way, and did not solve. #/omwteam/html2canvas/issues/8

where you set the css { font-variant: normal }, why it didn't work for me @Coodool

Maybe you can try font-variant: small-caps; @zww930620

Latest html2canvas versions (1.0.0-rc.2+) have fixed this issue for me.

font-variant: small-caps; or font-variant: normal , it didn't work for for me

Maybe you can try set font-family

@nazhenhuiyi Thank you very much. It deed works for me. I set font-variant: normal and get the correct result.

THANKSSS

Was this page helpful?
0 / 5 - 0 ratings