我正在构建一个小型Intranet应用程序,并尝试使用我最近购买的Adobe字体,但没有运气.据我所知,在我们的案例中,这不是违反许可证的行为.
我将.ttf/.otf版本的字体转换为.woff,.eot和.svg,以便定位所有主流浏览器.我使用的@ font-face语法基本上是Font Spring中的防弹语法:
@font-face {
font-family: 'MyFontFamily';
src: url('myfont-webfont.eot');
src: url('myfont-webfont.eot?#iehack') format('eot'),
url('myfont-webfont.woff') format('woff'),
url('myfont-webfont.ttf') format('truetype'),
url('myfont-webfont.svg#svgFontName') format('svg');
}
Run Code Online (Sandbox Code Playgroud)
我修改了HTTP标头(添加了Access-Control-Allow-Origin ="*")以允许跨域引用.在FF和Chrome中它完美运行,但在IE9中,我得到:
CSS3111: @font-face encountered unknown error.
myfont-webfont.woff
CSS3114: @font-face failed OpenType embedding permission check. Permission must be Installable.
myfont-webfont.ttf
Run Code Online (Sandbox Code Playgroud)
我注意到,当将字体从.ttf/.otf转换为.woff时,我也得到一个.afm文件,但我不知道它是否重要...
任何想法如何解决?
[编辑] - 我在IIS 7.5下托管我的网站(字体,但在单独的目录和静态内容的子域下)
我在IE 7,8,9中通过HTTPS使用@ font-face遇到了一个问题 - 它根本就没有加载.包含HTML页面是否托管在HTTPS上并不重要,当我尝试通过HTTP加载EOT字体时,它不起作用.有没有人见过这种行为?
托管该字体的服务器正在发送正确的content-type ="application/vnd.ms-fontobject"
我尝试了多种字体,因此它并不特定于字体.
字体是在Font Squirrel上生成的
@font-face {
font-family: 'GothamCondensedBold';
src:url('path/to/fontgothmbcd-webfont.eot');
src:url('path/to/fontgothmbcd-webfont.eot?#iefix') format('embedded-opentype'),
url('path/to/fontgothmbcd-webfont.woff') format('woff'),
url('path/to/fontgothmbcd-webfont.ttf') format('truetype'),
url('path/to/fontgothmbcd-webfont.svg#GothamCondensedBold') format('svg');
font-weight: normal;
font-style: normal;
}
Run Code Online (Sandbox Code Playgroud)
如上所述,虽然在IE8及以下的所有其他浏览器中显示良好,但我在IE9中没有显示@ font-face的问题.此外,在我的计算机上本地查看时,IE9会显示字体,而不是在完全显示时.
该网站是:
使用的代码是:
@font-face {
font-family: 'LeagueGothicRegular';
src: url('league_gothic_0-webfont.eot');
src: local('League Gothic Regular'), url('league_gothic_0-webfont.woff') format('woff'), url('league_gothic_0-webfont.ttf') format('truetype'), url('league_gothic_0-webfont.svg#webfonta36nFpyE') format('svg');font-weight: normal;font-style: normal;
}
Run Code Online (Sandbox Code Playgroud)
有人想知道为什么会这样吗?
干杯!
=============================================
我发现以下网站在IE9中显示相同的字体,任何想法他是如何做到的?
刚刚安装了新的IIS Express,看到Web Platform Installer也可以选择安装"IIS 7推荐配置".但我实际上无法弄清楚它在做什么?
有人用吗?
我一直在寻找几个小时,问朋友,但没有成功.所以我希望你们能帮助我.我的网站使用自定义字体,但IE(10)不支持我的方式.我不知道它支持其他方法.这是我的:
@font-face { font-family: shardee; src:url('fonts/Shardee.ttf'); }
Run Code Online (Sandbox Code Playgroud)
Internet Explorer中没有必要使用自定义字体,但这样会很好.
当Internet Explorer不知道字体时,它使用其默认字体.但问题是,自定义字体的字体大小是完美的,但是Internet Explorer的默认字体太大了.我尝试使用IE特定的css代码修复它,但它根本不起作用.我在Interner Explorer中使用以下css代码:
<!--[if IE]>
<style>
#menu ul li{ font-size:15px; }
</style>
<![endif]-->
Run Code Online (Sandbox Code Playgroud)
我也通过外部样式表尝试了它,看起来像这样:
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="<?php echo get_stylesheet_directory_uri() ?>/style/ie.css" />
<![endif]-->
Run Code Online (Sandbox Code Playgroud)
我在php中使用的函数是一个wordpress函数,它将您带到您的网站的路径.如果您不使用wordpress,则可以忘记该代码并将其留空.
问题不在于路径,路径是正确的.我查看了浏览器中的源代码,它向我展示了我在ie.css中的代码.ie.css中的代码与上面的代码完全相同,但没有标签ect.
我希望你们能帮我解决这个问题.据我所知,2种解决方案是可行的.让ie特定的css工作,或者给我一个在IE中创建自定义字体的方法.我使用的是Internet Explorer 10版.
你可以在这里看到这个网站,但是一旦修复它就会消失,因为一旦它被修复,我就不需要把它放在子域上了.
亲切的问候,巴特罗洛夫斯
<!doctype html>
<html>
<head>
<title>Test Ubuntu</title>
<link href="http://fonts.googleapis.com/css?family=Ubuntu:regular" rel="stylesheet" type="text/css" />
<style>
body { font-family: 'Ubuntu', sans-serif; }
</style>
</head>
<body>
Test Ubuntu
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
显示chrome和firefox中的字体...但在ie9中,如果我添加了doctype行,它会中断!?没有它,工作正常.
我希望它能在所有三种浏览器中运行(使用doctype?因为有时像css这样的其他东西依赖于在那里使用doctype?或者如果可能的话,它看起来不正确?)
谢谢!
internet-explorer google-font-api google-webfonts internet-explorer-9
我正在尝试制作Web字体并将其部署在AWS S3上.
在除IE9之外的所有浏览器中都可以正常工作,它在尝试加载woff文件时表示跨源请求失败.
我已经在很多论坛上阅读了很多关于有问题的人,但是我找不到修复方法.
我认为这与S3上的CORS设置没有向IE9发送正确的数据或东西有关?
(适用于Firefox,Chrome,IE7,8等)
我看到解决问题的唯一建议是,启动EC2实例并为字体创建一个Web主机(完全矫枉过正!),另一个是将css文件命名为.php并在php中设置标头(但是这是愚蠢的).
任何人都知道如何(如果可能的话)解决这个问题?
谢谢
编辑
我的CORS配置:
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>
Run Code Online (Sandbox Code Playgroud) 我尝试了几种不同的方法在CSS中包含正确的字体.我知道我需要eot版本的字体才能在IE上运行,但是我无法识别它.我使用字体squirrel来转换字体,我已将.eot文件和.otf文件放在一个名为"fonts"的文件夹中.这是我的CSS:
@font-face {
font-family: BebasNeue;
src: url('fonts/BebasNeue.eot');
src: url('fonts/BebasNeue.otf') format("opentype");
}
Run Code Online (Sandbox Code Playgroud)
更新 通过以下建议,我被引导到这个网站:http://www.fontspring.com/blog/further-hardening-of-the-bulletproof-syntax
我使用CSS:
@font-face {
font-family: 'BebasNeue';
src: url('fonts/bebasneue.eot'); /* IE9 Compat Modes */
src: url('fonts/bebasneue.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('fonts/bebasneue.woff') format('woff'), /* Modern Browsers */
url('fonts/bebasneue.ttf') format('truetype'), /* Safari, Android, iOS */
url('fonts/bebasneue.svg#svgBebasNeue') format('svg'); /* Legacy iOS */
}
Run Code Online (Sandbox Code Playgroud)
然后我回到Font Squirrel,再次下载了新的工具包,并正确地重命名了一切,并且工作正常.
我在jquery弹出窗口上应用了font face.它适用于Chrome和Firefox,但不适用于IE浏览器.
Font Face Code in css
----------------------
@font-face {
font-family: "pt-sans";
src: url("https://www.example.com/font/PTS55F.eot");
src: local("pt-sans"),
url("https://www.example.com/font/PTS55F.woff") format("woff"),
url("https://www.example.com/font/PTS55F.ttf") format("truetype"),
url("https://www.example.com/font/PTS55F.svg") format("svg");
}
Code added in .htaccess
----------------------
# BEGIN REQUIRED FOR WEBFONTS
AddType font/ttf .ttf
AddType font/eot .eot
AddType font/otf .otf
AddType font/woff .woff
<FilesMatch "\.(ttf|otf|eot|woff)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>
# END REQUIRED FOR WEBFONTS
Run Code Online (Sandbox Code Playgroud)
通过添加上面的代码Font-face正在页面上工作,但是当我在弹出字体表面上尝试相同时不起作用.
请帮帮我.