We're calling on all EU-based Mozillians with iOS or iPadOS devices to help us monitor Apple’s new browser choice screens. Join the effort to hold Big Tech to account!

为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

Firefox does not use locally installed font for rendering SVG content.

  • 1 个回答
  • 1 人有此问题
  • 12 次查看
  • 最后回复者为 Thomas S

more options

Firefox 91.7.0esr (64-bit) Windows 10 The local system has the font OCRB (also named OcrbATA) installed in the normal windows location: c:\windows\fonts\ocrbata.ttf

The SVG graphic is loaded from the local file system directly (FILE: not via HTTP: or HTTPS:) by using the Windows File Explorer.

The text in the graphic is specified to use the font family OCRB and I also tried OcrbATA (because Windows font naming is odd and has two different names displayed: the font name: Ocrb and the Full Name: OcrbATA.

The text in the graphic is only displayed in a fallback font (such as the browser specified default font), which produces the wrong rendering.

Looking for the font in the Firefox 'settings' for the "Fonts and Colors" dialog drop down, I see that this font is NOT shown in the list. OCR A is show, which is also installed on the system, but OCRB is not shown. I suspect this may be a symptom of why Firefox isn't making use of the installed OCRB font.

Having looked at a similar thread, I confirmed that "privacy.resistFingerprinting" is at its default of false. And "layout.css.font-visibility.level" is at the default of "3".

Any idea why Firefox, will not make use of the system installed font, when the file to display wants to use that font?

I would attach the SVG to this but the 'Upload Images' dialog only accepts raster images, not vector types like SVG. The attached images show the Windows 10 font dialog for the OCRB font with a sample string rendered, the Character Map for that font, so you can see the glyphs it uses, and the Firefox rendering of the SVG file which is just using the default firefox font to render, despite the text specifying OcrbATA as the font family in the SVG. For example:

 <tspan  font-family="OcrbATA" fill="rgb(120,120,120)"  font-size="332"  >Special Symbol Testing:</tspan>
Firefox 91.7.0esr (64-bit) Windows 10 The local system has the font OCRB (also named OcrbATA) installed in the normal windows location: c:\windows\fonts\ocrbata.ttf The SVG graphic is loaded from the local file system directly (FILE: not via HTTP: or HTTPS:) by using the Windows File Explorer. The text in the graphic is specified to use the font family OCRB and I also tried OcrbATA (because Windows font naming is odd and has two different names displayed: the font name: Ocrb and the Full Name: OcrbATA. The text in the graphic is only displayed in a fallback font (such as the browser specified default font), which produces the wrong rendering. Looking for the font in the Firefox 'settings' for the "Fonts and Colors" dialog drop down, I see that this font is NOT shown in the list. OCR A is show, which is also installed on the system, but OCRB is not shown. I suspect this may be a symptom of why Firefox isn't making use of the installed OCRB font. Having looked at a similar thread, I confirmed that "privacy.resistFingerprinting" is at its default of false. And "layout.css.font-visibility.level" is at the default of "3". Any idea why Firefox, will not make use of the system installed font, when the file to display wants to use that font? I would attach the SVG to this but the 'Upload Images' dialog only accepts raster images, not vector types like SVG. The attached images show the Windows 10 font dialog for the OCRB font with a sample string rendered, the Character Map for that font, so you can see the glyphs it uses, and the Firefox rendering of the SVG file which is just using the default firefox font to render, despite the text specifying OcrbATA as the font family in the SVG. For example: <tspan font-family="OcrbATA" fill="rgb(120,120,120)" font-size="332" >Special Symbol Testing:</tspan>
已附加屏幕截图

所有回复 (1)

more options

For what it is worth, an HTML file making use of the OCRB font also doesn't work: (with OCRB, Ocrb, or OcrbATA specified as the font-family.

style = "font-family:OcrbATA;font-size:36px;" Special Symbol Testing:
Other symbols °±öÄÙ­©ª§ì

And for what it is worth, MS Internet Explorer 11, does use the local font when rendering the HTML file, but not the SVG file.

由Thomas S于修改