Fonts 在Debian上指定CasperJS/PhantomJS的默认字体
我们试图指定CasperJS/PhantomJS在找到通用的“sans serif”css字体时应该使用哪些字体。我们试图更改~/.fonts.conf文件,但它被完全忽略Fonts 在Debian上指定CasperJS/PhantomJS的默认字体,fonts,phantomjs,casperjs,Fonts,Phantomjs,Casperjs,我们试图指定CasperJS/PhantomJS在找到通用的“sans serif”css字体时应该使用哪些字体。我们试图更改~/.fonts.conf文件,但它被完全忽略 是否可以告诉CasperJS/PhantomJS使用哪种字体,同时为不同的字符集(如中文、日文、韩文等)指定备用字体?您可以通过在CSS文件中链接到任何字体来使用它。我将以下内容用于俄语: @font-face { font-family: 'open_sanslight'; src: url('cyrill
是否可以告诉CasperJS/PhantomJS使用哪种字体,同时为不同的字符集(如中文、日文、韩文等)指定备用字体?您可以通过在CSS文件中链接到任何字体来使用它。我将以下内容用于俄语:
@font-face {
font-family: 'open_sanslight';
src: url('cyrillic/opensans-light.svg#open_sanslight') format('svg');
font-weight: normal;
font-style: normal;
}
然后,您可以将该字体设置为HTML文档或特定区域的默认字体。定义字体后,将其设置为整个文档的默认字体,如下所示:
body {
font-family: open_sanslight;
}
完整示例:
<!DOCTYPE html>
<html>
<head>
<style>
@font-face {
font-family: 'open_sanslight';
src: url('cyrillic/opensans-light.svg#open_sanslight') format('svg');
font-weight: normal;
font-style: normal;
}
body {
font-family: open_sanslight;
}
</style>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
@字体{
字体系列:“open_sanslight”;
src:url('cyrillic/opensans light.svg#open_sanslight')格式('svg');
字体大小:正常;
字体风格:普通;
}
身体{
字体系列:open_sanslight;
}
这是一个标题
这是一段
这需要
cyrillic
-文件夹中的.svg文件。您可以从下载这些文件(或其他文件)。我不知道;当然,使用SlimerJS(创建一个自定义配置文件)可以做到这一点。这个想法可以解决这个问题,但您不会详细介绍如何将其注入页面。它甚至看起来不像是覆盖了默认字体。