Skip to content

Commit c9e4329

Browse files
authored
Change font references to relative paths (#30)
## Summary: This PR adjusts the Symbola font references in Mathquill Less files to be relative paths. It also updates the build pipeline so that the generated CSS contains correct relative paths to these font files relative to the build output folder. I also noticed that there was a reference to an `.otf` font file that no longer exists in the repo. It seems like this is just "code rot" as the code changed. Issue: LEMS-3019 ## Test plan: I ran the build and inspected the CSS and made sure that the relative font paths for Symbola resolved to the actual files in the build folder. Author: jeremywiebe Reviewers: jeremywiebe, jeresig, nedredmond, benchristel Required Reviewers: Approved By: jeresig, nedredmond Checks: ✅ 3 checks were successful Pull Request URL: #30
1 parent 17d84d6 commit c9e4329

File tree

8 files changed

+23
-22
lines changed

8 files changed

+23
-22
lines changed

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,10 @@ UGLY_BASIC_JS = $(BUILD_DIR)/mathquill-basic.min.js
8989
UGLIFY ?= ./node_modules/.bin/uglifyjs
9090
UGLIFY_OPTS ?= --mangle --compress hoist_vars=true --comments
9191

92+
# We set --relative-urls and --rootpath so relative font paths are correctly
93+
# translated in the resulting CSS
9294
LESSC ?= ./node_modules/.bin/lessc
93-
LESS_OPTS ?=
95+
LESS_OPTS ?= --strict-imports --relative-urls --rootpath=build/
9496
ifdef OMIT_FONT_FACE
9597
LESS_OPTS += --modify-var="omit-font-face=true"
9698
endif

build/mathquill.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* MathQuill v1.0.2, by Han, Jeanine, and Mary
3+
* MathQuill v1.0.3, by Han, Jeanine, and Mary
44
* http://mathquill.com | [email protected]
55
*
66
* This Source Code Form is subject to the terms of the
@@ -29,8 +29,8 @@
2929
}
3030
@font-face {
3131
font-family: Symbola;
32-
src: url(/fonts/Symbola.eot);
33-
src: local('Symbola Regular'), local('Symbola'), url(/fonts/Symbola.woff2) format('woff2'), url(/fonts/Symbola.woff) format('woff'), url(/fonts/Symbola.ttf) format('truetype'), url(/fonts/Symbola.otf) format('opentype'), url(/fonts/Symbola.svg#Symbola) format('svg');
32+
src: url(fonts/Symbola.eot);
33+
src: local('Symbola Regular'), local('Symbola'), url(fonts/Symbola.woff2) format('woff2'), url(fonts/Symbola.woff) format('woff'), url(fonts/Symbola.ttf) format('truetype'), url(fonts/Symbola.svg#Symbola) format('svg');
3434
}
3535
.mq-editable-field {
3636
display: -moz-inline-box;

build/mathquill.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* MathQuill v1.0.1, by Han, Jeanine, and Mary
3+
* MathQuill v1.0.3, by Han, Jeanine, and Mary
44
* http://mathquill.com | [email protected]
55
*
66
* This Source Code Form is subject to the terms of the

build/mathquill.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* MathQuill v1.0.1, by Han, Jeanine, and Mary
3+
* MathQuill v1.0.3, by Han, Jeanine, and Mary
44
* http://mathquill.com | [email protected]
55
*
66
* This Source Code Form is subject to the terms of the
@@ -2211,7 +2211,7 @@ function MathQuill(el) {
22112211
return MQ1(el);
22122212
}
22132213
MathQuill.prototype = Progenote.prototype;
2214-
MathQuill.VERSION = 'v1.0.1';
2214+
MathQuill.VERSION = 'v1.0.3';
22152215
MathQuill.interfaceVersion = function (v) {
22162216
// shim for #459-era interface versioning (ended with #495)
22172217
if (v !== 1)

build/mathquill.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "mathquill",
33
"description": "Easily type math in your webapp",
4-
"version": "1.0.2",
4+
"version": "1.0.3",
55
"license": "MPL-2.0",
66
"main": "build/mathquill.min.js",
77
"types": "build/mathquill.d.ts",

src/css/font.less

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,17 @@
99

1010
@basic:~ "";
1111
.font-srcs() when not (@basic) {
12-
src: url(/fonts/Symbola.eot);
12+
src: url(../fonts/Symbola.eot);
1313
src: local('Symbola Regular'), local('Symbola'),
14-
url(/fonts/Symbola.woff2) format('woff2'),
15-
url(/fonts/Symbola.woff) format('woff'),
16-
url(/fonts/Symbola.ttf) format('truetype'),
17-
url(/fonts/Symbola.otf) format('opentype'),
18-
url(/fonts/Symbola.svg#Symbola) format('svg');
14+
url(../fonts/Symbola.woff2) format('woff2'),
15+
url(../fonts/Symbola.woff) format('woff'),
16+
url(../fonts/Symbola.ttf) format('truetype'),
17+
url(../fonts/Symbola.svg#Symbola) format('svg');
1918
}
2019
.font-srcs() when (@basic) {
21-
src: url(/fonts/Symbola-basic.eot);
20+
src: url(../fonts/Symbola-basic.eot);
2221
src: local('Symbola Regular'), local('Symbola'),
23-
url(/fonts/Symbola-basic.woff2) format('woff2'),
24-
url(/fonts/Symbola-basic.woff) format('woff'),
25-
url(/fonts/Symbola-basic.ttf) format('truetype');
22+
url(../fonts/Symbola-basic.woff2) format('woff2'),
23+
url(../fonts/Symbola-basic.woff) format('woff'),
24+
url(../fonts/Symbola-basic.ttf) format('truetype');
2625
}

0 commit comments

Comments
 (0)