【问题标题】:How do I specify custom fonts to use when printing a page with weasyprint?使用 weasyprint 打印页面时如何指定要使用的自定义字体?
【发布时间】:2013-08-15 07:44:47
【问题描述】:

似乎 weasyprint 不支持 @font-face css 指令。在使用 weasyprint 生成 pdf 时,是否有不同的方法来指定要使用的字体?

【问题讨论】:

    标签: fonts weasyprint


    【解决方案1】:

    该指令不受支持。

    weasyprint 仅使用当前安装的字体,可以通过 Pango/fontconfig 找到。

    这个short C program 将列出所有可以访问的字体。

    此命令将测试特定字体名称 (reference):

    pango-view -t 'Some test text' --font 'AwesomeFont'
    

    【讨论】:

      【解决方案2】:

      确保在你的 linux 机器上运行所有 MS 字体。这是我的问题的解决方案!

      sudo apt-get install ttf-mscorefonts-installer

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2022-01-27
        • 1970-01-01
        • 2021-10-25
        • 1970-01-01
        • 2019-11-14
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多