GVKun编程网logo

css – Firefox不尊重SVG文本中的font-size

11

对于css–Firefox不尊重SVG文本中的font-size感兴趣的读者,本文将提供您所需要的所有信息,并且为您提供关于css–@font-face无法在Firefox中运行?、css–@font

对于css – Firefox不尊重SVG文本中的font-size感兴趣的读者,本文将提供您所需要的所有信息,并且为您提供关于css – @ font-face无法在Firefox中运行?、css – @ font-face正在删除Firefox中的字母、css – Firefox 4没有渲染:visited :: before(颜色除外)、css – Firefox webfonts不加载的宝贵知识。

本文目录一览:

css – Firefox不尊重SVG文本中的font-size

css – Firefox不尊重SVG文本中的font-size

我遇到的问题是Firefox似乎没有将字体大小属性(在CSS中设置)应用于SVG文本元素.

以下示例足以在Firefox上重现该问题:

<svg width="40em" height="25em" viewBox="0 0 40 25">
        <style type="text/css"><![CDATA[
            text { font-size: 1px; }
            text.foo { font-size: 2px; }
        ]]></style>
        <text x="0" y="10">Hello,world! foo</text>
        <text x="0" y="20">Hello,world! bar</text>
    </svg>

这是预期的结果(Chromium):

以下是Firefox呈现的内容:

我找不到我做错了什么.有任何想法吗?谢谢.

解决方法

您可能设置了最小字体大小.这是一个已知的错误,希望有一天我们会修复它.

像这样取消它.

css – @ font-face无法在Firefox中运行?

css – @ font-face无法在Firefox中运行?

这是从FontSquirrel生成的代码,并且在其他所有浏览器(包括IE)中运行良好,但不是强大的Firefox!我究竟做错了什么?

(ps-我使用的是FF3.5)

如果您无法查看我的示例,请参阅以下内容:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<Meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<Meta name="robots" content="noindex,nofollow" />
<title>Fonts Firefox test</title>

<style type="text/css">
/*********** CHEVIN @font-faces **********/
@font-face {
font-family: ChevinLight;
src: url(uploads/fonts/chevilig-webfont.ttf);
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: ChevinBold;
src: url(uploads/fonts/chevibol-webfont.ttf);
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: ChevinExbold;
src: url(uploads/fonts/cheviextbol-webfont.ttf);
font-weight: normal;
font-style: normal;
}

/*********** @font-faces FOR IE **********/
@font-face {
font-family: ChevinLight;
src: url(uploads/fonts/chevilig-webfont.eot);
}
@font-face {
font-family: ChevinBold;
src: url(uploads/fonts/chevibol-webfont.eot);
}
@font-face {
font-family: ChevinExbold;
src: url(uploads/fonts/cheviextbol-webfont.eot);
}

/* Styles */
h1 {
font-family: ChevinLight,Arial,Helvetica,sans-serif;
}
h2 {
font-family: ChevinBold,sans-serif;
}
p {
font-family: ChevinExbold,sans-serif;
}

</style>

</head>
<body>

<h1>Lorem ipsum dolor sit amet,consectetur adipiscing elit. Vivamus elementum enim ante,nec convallis massa. Cras ac arcu mollis diam laoreet laoreet. Suspendisse leo metus,aliquam nec dapibus a,porttitor id nulla.</h1>
<h2>Lorem ipsum dolor sit amet,porttitor id nulla.</h2>
<p>Lorem ipsum dolor sit amet,porttitor id nulla.</p>

</body>
</html>

谢谢!

解决方法

Firebug表明好老的Foxy试图加载* .eot版本,看起来很愚蠢,但它只是加载了最后一个定义.

你应该用conditional comment包装IE部分:

<!--[if IE]>
@font-face {
font-family: ChevinLight;
src: url(uploads/fonts/chevilig-webfont.eot);
}
@font-face {
font-family: ChevinBold;
src: url(uploads/fonts/chevibol-webfont.eot);
}
@font-face {
font-family: ChevinExbold;
src: url(uploads/fonts/cheviextbol-webfont.eot);
}
<![endif]-->

其他方法是将IE定义放在顶部.

一些错误:
https://bugzilla.mozilla.org/show_bug.cgi?id=472647 – 忽略.eot或支持它
https://bugzilla.mozilla.org/show_bug.cgi?id=520357 – “我们不(也不会)支持EOT.”[sic]

是的,通常的Mozilla unpropress.

css – @ font-face正在删除Firefox中的字母

css – @ font-face正在删除Firefox中的字母

我有MuSEO-300主要使用@ font-face,但某些字母组合如“ff”和“fi”在Firefox中消失(在v3.6和v7.0.1中确认).所以“小额信贷”变成“微量”.

请注意,我将这些输出为单个字母,而不是连字.当我在服务器和浏览器上查看源时,例如“coffee”拼写为所有六个字母 – 而不是“ff”的unicode连字符.

输出看起来在Opera,Chrome,Safari和IE(甚至是IE6)中都是正确的.

我从MyFonts下载了MuSEO-300及其网络字体示例模板.

@font-face {
 font-family: 'MuSEO-300';
 src: url('webfonts/151B6C_0.eot');
 src: url('webfonts/151B6C_0.eot?#iefix') format('embedded-opentype'),url('webfonts/151B6C_0.woff') format('woff'),url('webfonts/151B6C_0.ttf') format('truetype'),url('webfonts/151B6C_0.svg#wf') format('svg');
}

并且所有引用的文件都已到位.我像这样调用它:

font-family: 'MuSEO-300',sans-serif;

我尝试了一种不同的字体作为测试(Code Pro Light Demo,也来自MyFonts)和Firefox下载“fi”而不是“ff”.

一个想法出了什么问题?

解决方法

您可以告诉Firefox跳过查找连字并通过添加将它们视为常规字符 -moz-font-feature-settings:font-face声明中的“liga = 0”.

css – Firefox 4没有渲染:visited :: before(颜色除外)

css – Firefox 4没有渲染:visited :: before(颜色除外)

我正在为Firefox 4中的特定网站制作一个自定义样式表.在其中,我试图将红色’x’添加到我访问过的链接前面.现在,当我说制作时,我的意思是它曾经工作过一段时间,并且在某些时候,这些’x’停止出现(虽然样式表的其余部分工作得很好).

现在,a:before(和a ::之前,每个CSS3)工作正常. a:访问过的工作正常.既不是:访问过:之前也没有:访问过::在工作之前(好吧,差不多).

在我的游戏测试期间,我离开了::之前,仍然有我的a:visited ::在声明之前使用红色’x’.对于非访问链接,a :: before内容是相同的文本颜色,但对于访问过的链接,:: before内容是“正确”颜色(红色).

这是一个CSS的pastebin:
http://pastebin.com/6Tzy1Q87

这是一个CSS导致的屏幕截图:
http://i.stack.imgur.com/rtw9L.png

请注意,a :: before只是将内容指定为复选标记. a:visited ::之前应该改变重量,颜色和内容,但只改变颜色.

我听说过最近关于Firefox和页面历史的安全“功能”,但据我了解,这也会影响常规的a:visited选择器.

解决方法

包括:visit的选择器只允许在Firefox 4中更改颜色,是的.这适用于是否涉及::之前.见 http://dbaron.org/mozilla/visited-privacy

我很想知道你有什么CSS允许你使用以下方式更改颜色以外的东西:访问过.

css – Firefox webfonts不加载

css – Firefox webfonts不加载

我只在Firefox中遇到webfonts的问题,所有其他浏览器(包括IE)都可以正常工作。

我的问题是webfonts根本不会加载。

我看过这个可能的解决方案,编辑htaccess文件(http://www.fontsquirrel.com/blog/2010/11/troubleshooting-font-face-problems),但我没有运气。

我唯一可以说的是在Firefox的错误控制台我得到以下警告:

Error in parsing value for “src”. Skipped to the next declaration.

以下是我的字体代码示例:

@font-face {
    font-family:AngelinaRegular;
    src:url(../fonts/angelina-webfont.eot);
    src:url(../fonts/angelina-webfont.eot?iefix) format(eot),url(../fonts/angelina-webfont.woff) format(woff),url(../fonts/angelina-webfont.ttf) format(truetype),url(../fonts/angelina-webfont.svg#webfontOvuhCGpN) format(svg);
    font-weight:normal;
    font-style:normal;
}

有任何想法吗?

解决方法

根据我的经验,Firefox在@ font-face规则中期待引用报价:
@font-face {
    font-family: AngelinaRegular;
    src: url('../fonts/angelina-webfont.eot');
    src: url('../fonts/angelina-webfont.eot?#iefix') format('embedded-opentype'),url('../fonts/angelina-webfont.woff') format('woff'),url('../fonts/angelina-webfont.ttf') format('truetype'),url('../fonts/angelina-webfont.svg#webfontOvuhCGpN') format('svg');
    font-weight: normal;
    font-style: normal;
}

今天关于css – Firefox不尊重SVG文本中的font-size的分享就到这里,希望大家有所收获,若想了解更多关于css – @ font-face无法在Firefox中运行?、css – @ font-face正在删除Firefox中的字母、css – Firefox 4没有渲染:visited :: before(颜色除外)、css – Firefox webfonts不加载等相关知识,可以在本站进行查询。

本文标签: