Skip to content

Is my browser using otf or woff fonts?

Davide P. Cervone edited this page May 26, 2013 · 1 revision

From https://groups.google.com/d/msg/mathjax-users/fgqSbu9DWYM/oqWLt7CpQSUJ


I think MathJax is showing me it uses otf even though it's really using woff fonts.

  • My config file (for reference)
  • Example link to woff (to demonstrate accessibility)
  • Example page (to demonstrate minor bug)
  • Network request inspection of *.woff

.htaccess (In [MathJax]/fonts):

SetEnvIf Origin "^(.*\.?iolympiads\.com)$" ORIGIN_SUB_DOMAIN=$1
<FilesMatch "\.(ttf|otf|eot|woff)$">
  <IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "%{ORIGIN_SUB_DOMAIN}e" env=ORIGIN_SUB_DOMAIN
    AddType application/vnd.ms-fontobject .eot
    AddType application/x-font-ttf        .ttf
    AddType application/x-font-woff       .woff
    AddType application/x-font-opentype   .otf
  </IfModule>
</FilesMatch>

I have my server configured, and yet, if I go to About MathJax, it gives me this:

In the example page for the Firefox console on the example page, I get

[11:10:49.891] GET http://www.iolympiads.com/MathJax/fonts/HTML-CSS/TeX/woff/MathJax_Size4-Regular.woff [HTTP/1.1 200 OK 436ms]
[11:10:49.913] GET http://www.iolympiads.com/MathJax/fonts/HTML-CSS/TeX/woff/MathJax_Main-Regular.woff [HTTP/1.1 200 OK 938ms]
[11:10:49.916] GET http://www.iolympiads.com/MathJax/fonts/HTML-CSS/TeX/woff/MathJax_Math-Italic.woff [HTTP/1.1 200 OK 944ms]
[11:10:49.917] GET http://www.iolympiads.com/MathJax/fonts/HTML-CSS/TeX/woff/MathJax_Size1-Regular.woff [HTTP/1.1 200 OK 760ms]
[11:10:51.279] GET http://www.iolympiads.com/MathJax/fonts/HTML-CSS/TeX/woff/MathJax_Size2-Regular.woff [HTTP/1.1 200 OK 432ms]

And no other HTTP requests for any other other type of fonts. You can verify all of this yourself. Conclusion: MathJax is telling me it uses otf when it's really using woff.


When MathJax requests an OTF font, it asks for it in both OTF and WOFF format, and the browser determines which version to obtain. MathJax doesn't actually know which it receives. It now says "OTF or WOFF fonts" in its about box instead.

Davide

Clone this wiki locally