alpdesk / contao-google-fonts
Contao的本地Google Web字体
1.4.0
2024-06-21 18:37 UTC
Requires
- php: ^8.1
- ext-json: *
- ext-zip: *
- contao/core-bundle: ^5.3
- sabberworm/php-css-parser: ^8.4.0
- symfony/http-client: ^6.4
Requires (Dev)
- contao/manager-bundle: ^5.3
- contao/manager-plugin: ^2.0
- phpstan/phpstan: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpstan/phpstan-symfony: ^1.0
- phpunit/phpunit: ^9.5
- roave/security-advisories: dev-latest
- slam/phpstan-extensions: ^6.0
- symfony/phpunit-bridge: ^6.4
Conflicts
- contao/manager-plugin: <2.0 || >=3.0
README
使用本扩展,可以通过几个简单的点击轻松下载并整合Google-Web字体到Contao CMS。
另见 https://docs.contao.org/manual/de/guides/webfont/
手册
- 在后台打开“Google字体”菜单项
- 选择字体并点击“下载”
- 字体随后会存储在文件管理器中,并附带相应的CSS
- 存在两个CSS文件。一个用于“最佳实践和旧浏览器”(font_legacy.css)和一个用于“现代浏览器”(font.css)
- 在布局中选择适当的CSS文件
- 最后将字体家族添加到CSS中
- 准备好了!现在你符合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)。