Tag: font face

Bourbon的@ font-face mixin

我是Bourbon&SASS的新手,并尝试使用@ font-face mixin将我下载的字体(Museo Sans)添加到我的Rails 3应用程序中。 波旁威士忌提供以下示例: @include font-face(SourceSansPro, ‘/fonts/Source_Sans_Pro/SourceSansPro-Regular’); @include font-face(SourceSansPro, ‘/fonts/Source_Sans_Pro/SourceSansPro-Bold’, bold); @include font-face(SourceSansPro, ‘/fonts/Source_Sans_Pro/SourceSansPro-Italic’, normal, italic); // Rails asset-pipeline – place fonts in app/assets/fonts/ @include font-face(SourceSansPro, ‘Source_Sans_Pro/SourceSansPro-Regular’, normal, $asset-pipeline: true); 我做了什么: // application.css.scss @import “bourbon”; @import “fonts”; // fonts.css.scss @include font-face(MuseoSans, ‘/fonts/MuseoSans/MuseoSans_500-webfont’, normal, $asset-pipeline: true); * { font-family: MuseoSans; } 字体在assets / fonts […]

Typicons字体没有在heroku中显示

我在我的rails应用程序中使用typicons和heroku并且它在本地工作但不在生产中,我在heroku中没有得到任何路由错误,我不确定我缺少什么。 我在资源文件夹中有一个字体文件夹,我正在使用 config.assets.paths << Rails.root.join("app", "assets", "fonts") 在我的应用程序类下的config.application.rb文件中。 在typicons.css.scss里面(在stylesheets文件夹中)我有 @font-face { font-family: ‘typicons’; src: font-url(‘typicons.eot’); src: font-url(‘typicons.eot?#iefix’) format(’embedded-opentype’), font-url(‘typicons.woff’) format(‘woff’), font-url(‘typicons.ttf’) format(‘truetype’), font-url(‘typicons.svg#typicons’) format(‘svg’); font-weight: normal; font-style: normal; }

使用Heroku在Cloudfront上提供字体

我正按照以下说明尝试在Heroku上使用Cloudfront进行设置: https ://devcenter.heroku.com/articles/using-amazon-cloudfront-cdn-with-rails Cloudfront正在为css和js资产提供服务,但我无法获得要提供的字体图标。 我在资源/字体中有我的图标字体,我在样式表中加载字体,如下所示: @font-face { src: font-url(‘dripicons.eot’); … } Cloudfronturl没有为完整的Cloudfronturl添加前缀(它缺少子网域)。 它看起来像这样: https://.cloudfront.net/assets/dripicons-9b4649c1936652d1c1c1d18410b16ebd.eot 我尝试使用font_assets gem( https://github.com/rubymaverick/font_assets ),但它没有解决问题。 我正在使用Rails 3.2.13。 我真的很感激任何意见。 谢谢!

Rails 4 – 自定义字体

目前我尝试将自定义字体添加到我的Rails 4应用程序中。 我将所有字体添加到assets/fonts 我将config.assets.paths << Rails.root.join("app", "assets", "fonts")到config/application.rb 我在我的style.css添加了脚本 @font-face { font-family: ‘oxygenregular’; src: url(font-path(‘oxygen-regular-webfont.eot’) + “?#iefix”) format(’embedded-opentype’), url(font-path(‘oxygen-regular-webfont.woff’)) format(‘woff’), url(font-path(‘oxygen-regular-webfont.ttf’)) format(‘truetype’), url(font-path(‘oxygen-regular-webfont.svg’) + “#MyFont”) format(‘svg’); } body { font-family: ‘oxygenregular’, arial; background: #f4f5f9; background-image: url(../images/bg-pattern.png); background-position: 0 bottom; background-repeat: no-repeat; } 我没有得到像404 (Not Found)这样的错误,因为我在修改config/application.rb之前收到了错误 但是应用程序没有加载我已经放置的字体。 我尝试使用原生HTML并且字体运行良好,但是当我尝试将它们放入Rails应用程序时,它不会加载.a

Heroku和@ font-face – 嵌入式字体不会在Heroku上显示

我使用CSS @font-face标签将一些许可字体嵌入到我的Rails应用程序中。 这些字体位于我的Rails 3应用程序中的”../Public/Fonts/”路径中,并在我下拉回购并运行的任何本地计算机上完美呈现。 但是,当我将我的应用程序推送到Heroku时,它似乎无法找到字体。 你可以告诉它它正在查看字体目录,但永远不能访问它们。 我在哪里放置字体或者如何在@ font-face声明中键入字体路径似乎并不重要。 我的字体位于#{RAILS.root}/public/fonts/ChunkFive 这是我的@ font-face声明: @font-face { font-family: “ChunkFive”; src: url(“../fonts/ChunkFive/ChunkFive-webfont.eot”); src: local(“?”), url(“../fonts/ChunkFive/ChunkFive-webfont.woff”) format(“woff”), url(“../fonts/ChunkFive/ChunkFive-webfont.ttf”) format(“truetype”), url(“../fonts/ChunkFive/ChunkFive-webfont.svg”) format(“svg”); } 这是我为每种字体获得的404资源未找到消息: Request URL:http://thedanbarrett.heroku.com/fonts/ChunkFive/ChunkFive-webfont.woff Request Method:GET Status Code:404 Not Found Request Headers Referer:http://thedanbarrett.heroku.com/home User-Agent:Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML,like Gecko) Chrome/8.0.552.224 Safari/534.10 Response Headers Age:0 Connection:keep-alive Content-Length:727 […]

将@ font-face文件集成到rails资产管道中

我正在尝试将设计人员的html和css文件集成到rails应用程序中。 他有大约四个@ font-face文件,这些文件当前链接到application.css文件中。 我已将字体存储在assets / fonts文件夹中,并将该文件夹添加到资产管道中(在config / application.rb中) 我只使用了Google字体,我在application.html.erb文件中包含了google的链接。 我该如何包含这些字体文件? 他们应该(1)保留在application.css文件中,还是(2)在app.html.erb文件中链接到javascript和styesheets? 例如,像这样:

Rails 3,@ font-face使用firefox生成失败

我在rails 3应用程序中使用font-awesome ,在开发模式下一切正常,但是当我推送到Heroku时,Firefox无法呈现图标,相反,我看到了: Chrome在开发和制作中使图标很好 这只会影响FireFox(虽然我没试过IE) 该应用程序在这里 ,如果有人能够确认这不仅仅发生在我的机器上(以帮助我排除本地主机缓存问题),我将不胜感激。 所有资产(包括字体和样式表)都使用asset_sync gem托管在S3上。 这就是我所做的: 将以下内容添加到font-awesome.css.scss的顶部:** // font-awesome.css.scss @font-face { font-family: ‘FontAwesome’; src: font-url(“fontawesome-webfont.eot”); src: font-url(“fontawesome-webfont.eot?#iefix”) format(“eot”), font-url(“fontawesome-webfont.woff”) format(“woff”), font-url(“fontawesome-webfont.ttf”) format(“truetype”), font-url(“fontawesome-webfont.svg#FontAwesome”) format(“svg”); font-weight: normal; font-style: normal; } 然后我把它放在application.rb中: # application.rb config.assets.paths << Rails.root.join("app", "assets", "fonts") config.assets.precompile += %w( .svg .eot .woff .ttf ) 最后我将所有4个字体文件放在app/assets/fonts 。 我真的很想知道我在这里做错了什么。

在Rails 4.0中使用@ font-face,找不到自定义字体的Sass URL

在我的Rails项目中,我正在尝试使用自定义字体。 有很多与这个问题相关的答案,就像这个没有帮助的答案一样,我编辑了development.rb .rb: # Add the fonts path config.assets.paths << Rails.root.join('app', 'assets', 'fonts') # Precompile additional assets config.assets.precompile += %w( .svg .eot .woff .ttf ) 仍然显示No route matches [GET] “/assets/chalkduster-webfont.woff” 我给我的url是: @font-face { font-family: ‘chalkdusterregular’; src: url(‘chalkduster-webfont.eot’); src:url(‘chalkduster-webfont.svg#chalkdusterregular’) format(‘svg’), url(‘chalkduster-webfont.eot?#iefix’) format(’embedded-opentype’), url(‘chalkduster-webfont.woff’) format(‘woff’), url(‘chalkduster-webfont.ttf’) format(‘truetype’); font-weight: normal; font-style: normal; } 我在源代码中尝试了font_path(”) ,而且font-url()它从font_path(”) 。 🙁

Rails 4:为什么字体没有加载到生产中?

我无法在生产中的Rails 4应用程序中加载字体,它在开发中正常工作。 部署时,资产在服务器上进行预编译。 我有我的字体 app/assets/fonts 我的app.css: @font-face { font-family: ‘WalkwayBoldRegular’; src: url(‘Walkway_Bold-webfont.eot’); src: url(‘Walkway_Bold-webfont.eot?#iefix’) format(’embedded-opentype’), url(‘Walkway_Bold-webfont.woff’) format(‘woff’), url(‘Walkway_Bold-webfont.ttf’) format(‘truetype’), url(‘Walkway_Bold-webfont.svg#WalkwayBoldRegular’) format(‘svg’); font-weight: normal; font-style: normal; } 在我的production.rb中,我有: config.assets.precompile << Proc.new { |path| if path =~ /\.(eot|svg|ttf|woff)\z/ true end }