alpdesk/contao-google-fonts

Contao的本地Google Web字体

安装量: 1,728

依赖: 0

建议者: 0

安全: 0

星标: 3

关注者: 2

分支: 0

开放问题: 0

类型:contao-bundle

1.4.0 2024-06-21 18:37 UTC

This package is auto-updated.

Last update: 2024-09-21 19:06:39 UTC


README

Contao Version

使用本扩展,可以通过几个简单的点击轻松下载并整合Google-Web字体到Contao CMS。

另见 https://docs.contao.org/manual/de/guides/webfont/

手册

  1. 在后台打开“Google字体”菜单项
  2. 选择字体并点击“下载”
  3. 字体随后会存储在文件管理器中,并附带相应的CSS
  4. 存在两个CSS文件。一个用于“最佳实践和旧浏览器”(font_legacy.css)和一个用于“现代浏览器”(font.css)
  5. 在布局中选择适当的CSS文件
  6. 最后将字体家族添加到CSS中
  7. 准备好了!现在你符合DSGVO要求了 :-)

1.2.0-BETA* 也支持unicode-ranges。但该功能目前处于BETA状态!:-)

Contao调试模式(版本1.0.*)(仅适用于Contao < 4.12)

如果Contao版本< 4.12启用了调试模式,CSS中会有无效的附加行,例如:

<!-- TEMPLATE START: vendor/alpdesk/contao-google-fonts/src/Resources/contao/templates/google_fonts_css.html5 -->
/* ubuntu-v19-300 - latin */
@font-face {
    font-family: 'Ubuntu';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: local(''),
    url('ubuntu-v19-latin-300.woff2') format('woff2'),
    url('ubuntu-v19-latin-300.woff') format('woff');
}

<!-- TEMPLATE END: vendor/alpdesk/contao-google-fonts/src/Resources/contao/templates/google_fonts_css.html5 -->

目前无法禁用。因此,为了下载字体,你必须处于生产模式!

其他

该功能仅适用于管理员。

技术

使用来自https://google-webfonts-helper.herokuapp.com/fonts (https://github.com/majodev/google-webfonts-helper)的API。感谢majodev (https://github.com/majodev)。

图片