www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 725524a214eb0abc88ead69f8c3e4339da0b6968
parent 4a9c2acbf7a50a6205cc3f42f374a4b3047c9bf1
Author: Charles Marsh <charlie@khanacademy.org>
Date:   Sun, 24 Jul 2016 23:08:16 -0700

Specify TrueType font format as 'truetype' rather than 'ttf'

Summary:
I've been experimenting with delivering a TrueType-only KaTeX build for our mobile apps. I couldn't
get anything to render properly until I flipped the `format` specifier from `ttf` to `truetype`.
Though I can't find a definitive source on this, all the examples I've seen online use `truetype`
over `ttf`, and flipping from `ttf` to `truetype` fixed my own issues.

It's unlikely that this has been much of a problem in practice, since so many browsers now support
WOFF (I'm considering a TrueType-only build since it's the least common denominator across Android
4.3+ and mobile Safari).

Test Plan:
- To force TrueType rendering, comment out the `.use-eot`, `.use-woff2`, and `.use-woff` lines in `fonts.less`.
- Run `make serve`.
- Open up the demo page.
    - Verify that the demo text is rendered as before (only the parens are noticeably different in the demo?).

Reviewers: kevinb, emily

Reviewed By: emily

Subscribers: benkomalo

Differential Revision: https://phabricator.khanacademy.org/D29274

Diffstat:
Mstatic/fonts.less | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/static/fonts.less b/static/fonts.less @@ -18,7 +18,7 @@ } .use-ttf(@family, @family-suffix) when (@use-ttf = true) { - src+: url('@{font-folder}/KaTeX_@{family}-@{family-suffix}.ttf') format('ttf') + src+: url('@{font-folder}/KaTeX_@{family}-@{family-suffix}.ttf') format('truetype') } .generate-suffix(@weight, @style) when (@weight = normal) and (@style = normal) {