為了改善您的使用體驗,本網站正在進行維護,部分功能暫時無法使用。若本站的文件無法解決您的問題,想要向社群發問的話,請到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 發問,我們的社群成員將很快會回覆您的疑問。

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

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 於 修改