{"action":"created","issue":{"url":"https://api.github.com/repos/mathjax/MathJax/issues/1438","repository_url":"https://api.github.com/repos/mathjax/MathJax","labels_url":"https://api.github.com/repos/mathjax/MathJax/issues/1438/labels{/name}","comments_url":"https://api.github.com/repos/mathjax/MathJax/issues/1438/comments","events_url":"https://api.github.com/repos/mathjax/MathJax/issues/1438/events","html_url":"https://github.com/mathjax/MathJax/issues/1438","id":147436518,"number":1438,"title":"Use font-size in ex to match surrounding fonts rather than measuring ex-heights directly.","user":{"login":"dpvc","id":432782,"avatar_url":"https://avatars.githubusercontent.com/u/432782?v=3","gravatar_id":"","url":"https://api.github.com/users/dpvc","html_url":"https://github.com/dpvc","followers_url":"https://api.github.com/users/dpvc/followers","following_url":"https://api.github.com/users/dpvc/following{/other_user}","gists_url":"https://api.github.com/users/dpvc/gists{/gist_id}","starred_url":"https://api.github.com/users/dpvc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpvc/subscriptions","organizations_url":"https://api.github.com/users/dpvc/orgs","repos_url":"https://api.github.com/users/dpvc/repos","events_url":"https://api.github.com/users/dpvc/events{/privacy}","received_events_url":"https://api.github.com/users/dpvc/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mathjax/MathJax/labels/Feature%20Request","name":"Feature Request","color":"0080FF"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/mathjax/MathJax/milestones/14","html_url":"https://github.com/mathjax/MathJax/milestones/MathJax%20v2.x.x","labels_url":"https://api.github.com/repos/mathjax/MathJax/milestones/14/labels","id":1590361,"number":14,"title":"MathJax v2.x.x","description":"","creator":{"login":"pkra","id":426686,"avatar_url":"https://avatars.githubusercontent.com/u/426686?v=3","gravatar_id":"","url":"https://api.github.com/users/pkra","html_url":"https://github.com/pkra","followers_url":"https://api.github.com/users/pkra/followers","following_url":"https://api.github.com/users/pkra/following{/other_user}","gists_url":"https://api.github.com/users/pkra/gists{/gist_id}","starred_url":"https://api.github.com/users/pkra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkra/subscriptions","organizations_url":"https://api.github.com/users/pkra/orgs","repos_url":"https://api.github.com/users/pkra/repos","events_url":"https://api.github.com/users/pkra/events{/privacy}","received_events_url":"https://api.github.com/users/pkra/received_events","type":"User","site_admin":false},"open_issues":28,"closed_issues":84,"state":"open","created_at":"2016-02-18T10:09:58Z","updated_at":"2016-07-08T13:14:33Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-04-11T13:51:44Z","updated_at":"2016-07-08T20:59:10Z","closed_at":null,"body":"Something like\r\n\r\n```\r\n<style>\r\n.mjx-chtml {font-size: 2.26ex ! important}\r\n.mjx-chtml .mjx-chtml {font-size: inherit ! important}\r\n</style>\r\n```\r\n\r\nworks for CommonHTML output, and something similar could be used for HTML-CSS and PreviewHTML as well.  This would avoid having to measure em and ex heights (though a corresponding adjustment would need to be made for text with `mtextInheritFont` set).  This should also resolve some problems with mobile devices that change the font size after the page is loaded (and after MathJax has already measured the size), causing the math to be scaled incorrectly for the new font size.\r\n\r\nNote that for HTML-CSS, each of the different web fonts would require a different scaling factor (since their em-to-ex ratios differ, and this `font-size` is the em-size divided by the ex-height)."},"comment":{"url":"https://api.github.com/repos/mathjax/MathJax/issues/comments/231471244","html_url":"https://github.com/mathjax/MathJax/issues/1438#issuecomment-231471244","issue_url":"https://api.github.com/repos/mathjax/MathJax/issues/1438","id":231471244,"user":{"login":"dpvc","id":432782,"avatar_url":"https://avatars.githubusercontent.com/u/432782?v=3","gravatar_id":"","url":"https://api.github.com/users/dpvc","html_url":"https://github.com/dpvc","followers_url":"https://api.github.com/users/dpvc/followers","following_url":"https://api.github.com/users/dpvc/following{/other_user}","gists_url":"https://api.github.com/users/dpvc/gists{/gist_id}","starred_url":"https://api.github.com/users/dpvc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpvc/subscriptions","organizations_url":"https://api.github.com/users/dpvc/orgs","repos_url":"https://api.github.com/users/dpvc/repos","events_url":"https://api.github.com/users/dpvc/events{/privacy}","received_events_url":"https://api.github.com/users/dpvc/received_events","type":"User","site_admin":false},"created_at":"2016-07-08T20:59:10Z","updated_at":"2016-07-08T20:59:10Z","body":"It turns out this isn't going to work after all.  It works when the page is not zoomed, but it looks like WebKit has a big that if the `font-size` is in relative units like `ex`, then when you zoom the page, the fonts get extra zoom (Firefox doesn't exhibit the behavior).  \r\n\r\n```\r\n<!DOCTYPE html>\r\n<html>\r\n<head>\r\n<title>Test of MathJax_Main in different sizes</title>\r\n<style>\r\n@font-face {\r\n  font-family: MJX;\r\n  src: url(\"http://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/woff/MathJax_Math-Regular.woff\") format(\"woff\");\r\n}\r\n.MJX {font-family: MJX}\r\n</style>\r\n</head>\r\n<body>\r\n\r\nx<span style=\"font-size:2.38ex\"><span class=\"MJX\">x</span></span>\r\n\r\n</body>\r\n</html>\r\n```\r\n\r\nproduces\r\n\r\n<img width=\"37\" alt=\"no-zooom\" src=\"https://cloud.githubusercontent.com/assets/432782/16701328/1277f71a-452d-11e6-9568-b4734d2ac64f.png\">\r\n\r\nin Safari and Chrome without zoom, but when zoomed in three levels, produces\r\n\r\n<img width=\"97\" alt=\"zoom-3\" src=\"https://cloud.githubusercontent.com/assets/432782/16701351/30a4a850-452d-11e6-9861-b8b1464c0aa6.png\">\r\n\r\nI don't see any way around that, so the idea, while good, won't be practical until WebKit fixes that problem."}}
{"actor":{"display_login":"dpvc"}}