Chinese characters showing as question marks

前端 未结 1 1574
有刺的猬
有刺的猬 2021-01-17 07:03

This has been asked before, but I can\'t figure out what\'s wrong. I\'m printing pdfs using phantomjs .render().

The rendered page is basically a local

1条回答
  •  北恋
    北恋 (楼主)
    2021-01-17 07:36

    You need a chinese font. None of them is in a chinese font family.

    font: normal 17px helvetica,arial,verdana,sans-serif

    Here are some font has chinese char.

    宋体:SimSun; 黑体:SimHei; 新宋体:NSimSun; 微软雅黑:Microsoft YaHei; 新細明體:PMingLiU

    This is much more than a guide.Chinese Standard Web Fonts: A Guide to CSS Font Family Declarations for Web Design in Simplified Chinese

    This has Traditional Chinese fonts.Chinese web fonts

    Google's font. Sorry for not being a link, there is a limit for me.

    noto-sans-hans

    Adobe's typekit

    source-han-sans

    Test Html file:

    
    
    
    
        
        你好中文!
        
    
    
    
        

    你好中文!111

    宋体

    黑体

    楷体

    微软雅黑

    Result

    enter image description here

    Lastest to do, try to change your location to china. I don't expect this working, as I tried the phantomjs in win10 ENG preview, working very well. Control Panel > Region > Administrative > Language for non-Unicode programs

    enter image description here

    0 讨论(0)
提交回复
热议问题