• <bdo id='K7N9J'></bdo><ul id='K7N9J'></ul>
    1. <i id='K7N9J'><tr id='K7N9J'><dt id='K7N9J'><q id='K7N9J'><span id='K7N9J'><b id='K7N9J'><form id='K7N9J'><ins id='K7N9J'></ins><ul id='K7N9J'></ul><sub id='K7N9J'></sub></form><legend id='K7N9J'></legend><bdo id='K7N9J'><pre id='K7N9J'><center id='K7N9J'></center></pre></bdo></b><th id='K7N9J'></th></span></q></dt></tr></i><div id='K7N9J'><tfoot id='K7N9J'></tfoot><dl id='K7N9J'><fieldset id='K7N9J'></fieldset></dl></div>
    2. <tfoot id='K7N9J'></tfoot>

        <legend id='K7N9J'><style id='K7N9J'><dir id='K7N9J'><q id='K7N9J'></q></dir></style></legend>
      1. <small id='K7N9J'></small><noframes id='K7N9J'>

        我在哪里可以在 Laravel 5 中放置自定义字体?

        Where do I place custom fonts in Laravel 5?(我在哪里可以在 Laravel 5 中放置自定义字体?)
      2. <legend id='PukiV'><style id='PukiV'><dir id='PukiV'><q id='PukiV'></q></dir></style></legend>

        <small id='PukiV'></small><noframes id='PukiV'>

            <tbody id='PukiV'></tbody>
          <i id='PukiV'><tr id='PukiV'><dt id='PukiV'><q id='PukiV'><span id='PukiV'><b id='PukiV'><form id='PukiV'><ins id='PukiV'></ins><ul id='PukiV'></ul><sub id='PukiV'></sub></form><legend id='PukiV'></legend><bdo id='PukiV'><pre id='PukiV'><center id='PukiV'></center></pre></bdo></b><th id='PukiV'></th></span></q></dt></tr></i><div id='PukiV'><tfoot id='PukiV'></tfoot><dl id='PukiV'><fieldset id='PukiV'></fieldset></dl></div>
            <bdo id='PukiV'></bdo><ul id='PukiV'></ul>

                  <tfoot id='PukiV'></tfoot>

                  本文介绍了我在哪里可以在 Laravel 5 中放置自定义字体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  完全初学者到 Laravel 5 并尝试在我的标题中使用此代码导入自定义字体:

                  Complete beginner to Laravel 5 and trying to import custom fonts using this code in my header:

                  <style>
                  @font-face {
                      font-family: 'Conv_OptimusPrinceps';
                      src: url('fonts/OptimusPrinceps.eot');
                      src: local(''), url('fonts/OptimusPrinceps.woff') format('woff'), url('fonts/OptimusPrinceps.ttf') format('truetype'), url('fonts/OptimusPrinceps.svg') format('svg');
                      font-weight: normal;
                      font-style: normal;
                  }
                  

                  并在我的 variables.scss 中调用它.目前我的字体存储在我的公共目录中:

                  and calling it in my variables.scss. Currently my fonts are stored in my public directory:

                  public/fonts/OptimusPrinceps.woff
                  public/fonts/OptimusPrinceps.tff 
                  etc.
                  

                  出于某种原因,这个警告出现在我的开发工具中

                  For some reason this warning appears in my dev tools

                  Failed to decode downloaded font: http://localhost:3000/fonts/OptimusPrinceps.tff
                  OTS parsing error: invalid version tag
                  

                  我的字体加载不正确.

                  推荐答案

                  将客户端浏览器应该访问的任何内容放入 /public/.您可以使用 Laravel 辅助函数 public_path 为其构建完整的 URL.
                  https://laravel.com/docs/5.2/helpers#method-public-path

                  Place anything that the client browser should access into /public/. You can use the Laravel helper function public_path to build full URLs for it.
                  https://laravel.com/docs/5.2/helpers#method-public-path

                  例如,如果您将字体放在 /public/fonts/OptimusPrinceps.tff(您已经完成)中,您可以通过以下两种方式之一访问它.

                  For instance, if you put your font in /public/fonts/OptimusPrinceps.tff (which you've done), you can access it one of two ways.

                  在刀片中:

                  <style type="text/css">
                  @font-face {
                      font-family: OptimusPrinceps;
                      src: url('{{ public_path('fonts/OptimusPrinceps.tff') }}');
                  }
                  </style>
                  

                  在 CSS 中包括:

                  @font-face {
                      font-family: OptimusPrinceps;
                      src: url('/fonts/OptimusPrinceps.tff');
                  }
                  

                  在第二个例子中,你真的不需要任何 Laravel 魔法.只需绝对引用路径,以便它指向正确的目录.

                  In the second example, you don't need any Laravel magic, really. Just reference the path absolutely so that it points to the correct directory.

                  值得注意的是,这适用于 Bootstrap 和 SCSS.我通常把字体放在/public/static/fonts/.

                  Worth noting that this works with Bootstrap and SCSS. I usually put fonts in /public/static/fonts/.

                  这篇关于我在哪里可以在 Laravel 5 中放置自定义字体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                  <tfoot id='c9tog'></tfoot>

                  • <bdo id='c9tog'></bdo><ul id='c9tog'></ul>

                      • <i id='c9tog'><tr id='c9tog'><dt id='c9tog'><q id='c9tog'><span id='c9tog'><b id='c9tog'><form id='c9tog'><ins id='c9tog'></ins><ul id='c9tog'></ul><sub id='c9tog'></sub></form><legend id='c9tog'></legend><bdo id='c9tog'><pre id='c9tog'><center id='c9tog'></center></pre></bdo></b><th id='c9tog'></th></span></q></dt></tr></i><div id='c9tog'><tfoot id='c9tog'></tfoot><dl id='c9tog'><fieldset id='c9tog'></fieldset></dl></div>
                      • <legend id='c9tog'><style id='c9tog'><dir id='c9tog'><q id='c9tog'></q></dir></style></legend>
                          <tbody id='c9tog'></tbody>

                        <small id='c9tog'></small><noframes id='c9tog'>