安装的 Moodle 字体在其他浏览器中不起作用
Installed Moodle Font doesn't work in other browsers
我在我的 Moodle 课程和主题中安装了 moodle 字体 (Coptic),它在 Google Chrome 中正确显示。但是,当我尝试在 Firefox 中查看它时,I.E.或者在我的平板电脑上(Chrome,通过 Nexus 9),它没有显示正确的字符。
我在 https://docs.moodle.org/28/en/How_to_add_custom_fonts_in_a_theme 之前遵循了这些说明。唯一的问题是,之前我只有 Coptic.tff 而没有其他字体类型。 IE。 eot 或 svg。然后我上网获取其他字体。 IE。我上传了 Coptic.tff 并获得了其他文件的压缩包。通过在目录中包含这些其他字体。你认为它可以解决问题吗?谢谢你的帮助。 :-)
请像您一样包括所有字体类型。在您的主题中创建一个新目录并将其命名为 fonts。然后将所有自定义字体添加到此目录中。
例如:moodle/theme/yourtheme/fonts/
有时“ src: url([[font:theme|fontname.eot]]); ”,这可能不起作用。
请像这样添加路径
@font-face { /* where FontName and fontname represents the name of the font you want to add */
font-family: 'fontname';
src: url('../theme/your-theme-name/fonts/fontname.woff');
src: url('../theme/your-theme-name/fonts/fontname.eot') format('embedded-opentype'),
url('../theme/your-theme-name/fonts/fontname.woff') format('woff'),
url('../theme/your-theme-name/fonts/fontname.ttf') format('truetype'),
url('../theme/your-theme-name/fonts/fontname.svg') format('svg');
font-weight: normal;
font-style: normal;
}
接下来在样式表中要使用该字体的任何位置添加该字体的名称。
例如:
#page-header h1 { font-family: FontName;}
试试吧!它会为你工作:)
我在我的 Moodle 课程和主题中安装了 moodle 字体 (Coptic),它在 Google Chrome 中正确显示。但是,当我尝试在 Firefox 中查看它时,I.E.或者在我的平板电脑上(Chrome,通过 Nexus 9),它没有显示正确的字符。
我在 https://docs.moodle.org/28/en/How_to_add_custom_fonts_in_a_theme 之前遵循了这些说明。唯一的问题是,之前我只有 Coptic.tff 而没有其他字体类型。 IE。 eot 或 svg。然后我上网获取其他字体。 IE。我上传了 Coptic.tff 并获得了其他文件的压缩包。通过在目录中包含这些其他字体。你认为它可以解决问题吗?谢谢你的帮助。 :-)
请像您一样包括所有字体类型。在您的主题中创建一个新目录并将其命名为 fonts。然后将所有自定义字体添加到此目录中。 例如:moodle/theme/yourtheme/fonts/
有时“ src: url([[font:theme|fontname.eot]]); ”,这可能不起作用。
请像这样添加路径
@font-face { /* where FontName and fontname represents the name of the font you want to add */
font-family: 'fontname';
src: url('../theme/your-theme-name/fonts/fontname.woff');
src: url('../theme/your-theme-name/fonts/fontname.eot') format('embedded-opentype'),
url('../theme/your-theme-name/fonts/fontname.woff') format('woff'),
url('../theme/your-theme-name/fonts/fontname.ttf') format('truetype'),
url('../theme/your-theme-name/fonts/fontname.svg') format('svg');
font-weight: normal;
font-style: normal;
}
接下来在样式表中要使用该字体的任何位置添加该字体的名称。 例如: #page-header h1 { font-family: FontName;}
试试吧!它会为你工作:)