Google App Engine 中未显示字体真棒
Posted
技术标签:
【中文标题】Google App Engine 中未显示字体真棒【英文标题】:Font-awesome not show in Google App Engine 【发布时间】:2015-05-26 08:22:49 【问题描述】:我在使用 font-awesome 整个应用引擎时遇到问题。
通过 Google Chrome 开发者控制台我发现了以下错误:
资源解释为字体,但使用 MIME 类型文本/html 传输:“http://localhost:8080/wp-content/plugins/js_composer/assets/lib/font-awesome/fonts/fontawesome-webfont.woff/?v=4.2.0”。 资源解释为字体但使用 MIME 类型文本/html 传输:“http://localhost:8080/wp-content/plugins/js_composer/assets/lib/font-awesome/fonts/fontawesome-webfont.ttf/?v=4.2.0”。
我的 app.yaml wordpress 文件如下:
application: app-001
version: app-001
Runtime: php
api_version: 1
inbound_services:
- Warmup
handlers:
- Url: /(.*\.(htm$|html$|css$|js$))
static_files: wordpress / \ 1
upload: wordpress /.* \. ($ htm | html $ | $ css | js $)
application_readable: true
- Url: /wp-content/(.*\.(ico$|jpg$|png$|gif$))
static_files: wordpress / wp-content / \ 1
upload: wordpress / wp-content /.* \. (ico $ | $ jpg | png $ | gif $)
application_readable: true
- Url: /(.*\.(ico$|jpg$|png$|gif$))
static_files: wordpress / \ 1
upload: wordpress /.* \. (ico $ | $ jpg | png $ | gif $)
- Url: /wp-admin/(.+)
script: wordpress / wp-admin / \ 1
secure: always
- Url: / wp-admin /
script: wordpress / wp-admin / index.php
secure: always
- Url: /wp-login.php
script: wordpress / wp-login.php
secure: always
- Url: /wp-cron.php
script: wordpress / wp-cron.php
login: admin
- Url: /xmlrpc.php
script: wordpress / xmlrpc.php
- Url: /wp-(.+).php
script: wordpress / wp- \ 1.php
- Url: /(.+)?/?
script: wordpress / index.php
- Url: /(.*\.otf)
static_files: wordpress / wp-includes / fonts / \ 1
upload: wordpress / wp-includes / fonts / (. * \. otf)
mime_type: application / x-font-otf
- Url: /wp-content/(.*\.ttf)$
static_files: wordpress / wp-content / \ 1
upload: wordpress / wp-content /.* \. $ ttf
mime_type: application / x-font-ttf
- Url: /wp-content/(.*\.otf)$
static_files: wordpress / wp-content / \ 1
upload: wordpress / wp-content /.* \. otf $
mime_type: application / x-font-otf
- Url: /wp-content/(.*\.woff)$
static_files: wordpress / wp-content / \ 1
upload: wordpress / wp-content /.* \. $ WOFF
mime_type: application / x-font-WOFF
请帮我解决问题。 非常感谢
【问题讨论】:
【参考方案1】:我通过在文件 app.yaml 中插入这个来解决问题
handlers:
- url: /(.*\.woff)
static_files: wordpress/\1
upload: wordpress/(.*\.woff)
mime_type: application/font-woff
- url: /(.*\.svg)
static_files: wordpress/\1
upload: wordpress/(.*\.svg)
mime_type: image/svg+xml
- url: /(.*\.eot)
static_files: wordpress/\1
upload: wordpress/(.*\.eot)
mime_type: application/vnd.ms-fontobject
- url: /(.*\.ttf)
static_files: wordpress/\1
upload: wordpress/(.*\.ttf)
mime_type: application/x-font-ttf
- url: /(.*\.otf)
static_files: wordpress/\1
upload: wordpress/(.*\.otf)
mime_type: application/x-font-otf
【讨论】:
以上是关于Google App Engine 中未显示字体真棒的主要内容,如果未能解决你的问题,请参考以下文章
在 Laravel 刀片中生成的 PDF 中未显示字体真棒图标
Google App Engine 和 ttf 字体不起作用
如何删除 Google Application Engine 中未使用的索引?