Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't get HTML-CSS to use the new webfonts in 2.3-beta #641

Closed
christianp opened this issue Oct 25, 2013 · 5 comments
Closed

I can't get HTML-CSS to use the new webfonts in 2.3-beta #641

christianp opened this issue Oct 25, 2013 · 5 comments

Comments

@christianp
Copy link
Contributor

Minimal example: http://somethingorotherwhatever.com/mathjax-beta-webfonts.html

I've copied the example config to use a different webfont from the beta announcement page, but it doesn't work - the normal TeX fonts are used.

I've also put the config in for SVG, and when I switch to that renderer it uses the appropriate font.

I've tested on Chrome 31 beta, IE11 and Firefox 18.

@fred-wang
Copy link
Contributor

From the doc http://docs.mathjax.org/en/latest/options/HTML-CSS.html it's "webFont" with an uppercase F not "webfont". Also, if you have local fonts they will be used before the Web fonts. You must set availableFonts and preferredFont correctly to force the Neo Euler fonts.

@christianp
Copy link
Contributor Author

aha! I thought it would be something simple like that. Thanks.

@christianp
Copy link
Contributor Author

... and I suppose I should add that the example on the blog needs to be changed :)

@fred-wang
Copy link
Contributor

However the doc is not quite correct:

  var font = this.Font.findFont(this.config.availableFonts,this.config.preferredFont);
  findFont: function (fonts,pref) {
    if (pref && this.testCollection(pref)) {return pref}
    for (var i = 0, m = fonts.length; i < m; i++) {
      if (fonts[i] === pref) continue;
      if (this.testCollection(fonts[i])) {return fonts[i]}
    }
    return null;
  },

It seems that this will test preferredFont=TeX even if availableFonts is empty. So it seems that you must both set availableFonts=[] and preferredFont=null at the moment.

@fred-wang
Copy link
Contributor

I've updated the blog post. Thanks for the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants