summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJan Holub <Jan-Holub@gmx.net>2017-07-12 17:21:48 +0200
committerLuiza Pagliari <lpagliari@gmail.com>2017-07-12 12:21:48 -0300
commit8bd8be97b98a69dce9768e5717c4f5ee0368ad1a (patch)
treed76057b5e004956fe88d14aa8f0e3f1cf38e4ec0 /src
parent8c57c8d0d67ccba8500980d89f95cc011468116d (diff)
downloadetherpad-lite-8bd8be97b98a69dce9768e5717c4f5ee0368ad1a.zip
Added support for the Montserrat Font as discussed in #3201 (#3205)
* Added support for the Montserrat Font as discussed in #3201 I chose a thin version of the Font (namely Montserrat Light) as the regular font and Montserrat Regular as the bold version. The thin fonts just look better in my opinion.
Diffstat (limited to 'src')
-rw-r--r--src/locales/en.json1
-rw-r--r--src/static/css/pad.css15
-rwxr-xr-xsrc/static/font/Montserrat-Light.otfbin0 -> 91496 bytes
-rwxr-xr-xsrc/static/font/Montserrat-Regular.otfbin0 -> 93516 bytes
-rw-r--r--src/static/js/pad.js10
-rw-r--r--src/static/js/pad_editor.js11
-rw-r--r--src/templates/pad.html1
7 files changed, 30 insertions, 8 deletions
diff --git a/src/locales/en.json b/src/locales/en.json
index b9c8cb74..116f2169 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -40,6 +40,7 @@
"pad.settings.fontType.normal": "Normal",
"pad.settings.fontType.opendyslexic": "Open Dyslexic",
"pad.settings.fontType.monospaced": "Monospace",
+ "pad.settings.fontType.montserrat": "Montserrat",
"pad.settings.fontType.comicsans": "Comic Sans",
"pad.settings.fontType.couriernew": "Courier New",
"pad.settings.fontType.georgia": "Georgia",
diff --git a/src/static/css/pad.css b/src/static/css/pad.css
index 397e61ee..cabde7ef 100644
--- a/src/static/css/pad.css
+++ b/src/static/css/pad.css
@@ -1272,6 +1272,21 @@ input[type=checkbox] {
}
/* End of gritter stuff */
+/* Montserrat Font */
+@font-face {
+ font-family: "Montserrat";
+ src: url("../../static/font/Montserrat-Light.otf") format("opentype");
+ font-weight: normal;
+ font-style: normal;
+}
+@font-face {
+ font-family: "Montserrat";
+ src: url("../../static/font/Montserrat-Regular.otf") format("opentype");
+ font-weight: bold;
+ font-style: normal;
+}
+/* End of Monterrat Font */
+
@font-face {
font-family: opendyslexic;
src: url("../../static/font/opendyslexic.otf") format("opentype");
diff --git a/src/static/font/Montserrat-Light.otf b/src/static/font/Montserrat-Light.otf
new file mode 100755
index 00000000..f2f0e2df
--- /dev/null
+++ b/src/static/font/Montserrat-Light.otf
Binary files differ
diff --git a/src/static/font/Montserrat-Regular.otf b/src/static/font/Montserrat-Regular.otf
new file mode 100755
index 00000000..f61d57ec
--- /dev/null
+++ b/src/static/font/Montserrat-Regular.otf
Binary files differ
diff --git a/src/static/js/pad.js b/src/static/js/pad.js
index 392a657e..32be03d6 100644
--- a/src/static/js/pad.js
+++ b/src/static/js/pad.js
@@ -554,10 +554,12 @@ var pad = {
pad.changeViewOption('rtlIsTrue', true);
}
- var fonts = ['useMonospaceFont', 'useOpenDyslexicFont', 'useComicSansFont', 'useCourierNewFont', 'useGeorgiaFont', 'useImpactFont',
- 'useLucidaFont', 'useLucidaSansFont', 'usePalatinoFont', 'useRobotoMonoFont', 'useTahomaFont', 'useTimesNewRomanFont',
- 'useTrebuchetFont', 'useVerdanaFont', 'useSymbolFont', 'useWebdingsFont', 'useWingDingsFont', 'useSansSerifFont',
- 'useSerifFont'];
+
+ var fonts = ['useMonospaceFont', 'useMontserratFont', 'useOpenDyslexicFont', 'useComicSansFont', 'useCourierNewFont',
+ 'useGeorgiaFont', 'useImpactFont', 'useLucidaFont', 'useLucidaSansFont', 'usePalatinoFont', 'useRobotoMonoFont',
+ 'useTahomaFont', 'useTimesNewRomanFont', 'useTrebuchetFont', 'useVerdanaFont', 'useSymbolFont', 'useWebdingsFont',
+ 'useWingDingsFont', 'useSansSerifFont', 'useSerifFont'];
+
$.each(fonts, function(i, font){
if(padcookie.getPref(font) == true){
diff --git a/src/static/js/pad_editor.js b/src/static/js/pad_editor.js
index a1a901cb..0b282659 100644
--- a/src/static/js/pad_editor.js
+++ b/src/static/js/pad_editor.js
@@ -30,10 +30,12 @@ var padeditor = (function()
var settings = undefined;
// Array of available fonts
- var fonts = ['useMonospaceFont', 'useOpenDyslexicFont', 'useComicSansFont', 'useCourierNewFont', 'useGeorgiaFont', 'useImpactFont',
- 'useLucidaFont', 'useLucidaSansFont', 'usePalatinoFont', 'useRobotoMonoFont', 'useTahomaFont', 'useTimesNewRomanFont',
- 'useTrebuchetFont', 'useVerdanaFont', 'useSymbolFont', 'useWebdingsFont', 'useWingDingsFont', 'useSansSerifFont',
- 'useSerifFont'];
+
+ var fonts = ['useMonospaceFont', 'useMontserratFont', 'useOpenDyslexicFont', 'useComicSansFont', 'useCourierNewFont',
+ 'useGeorgiaFont', 'useImpactFont', 'useLucidaFont', 'useLucidaSansFont', 'usePalatinoFont', 'useRobotoMonoFont',
+ 'useTahomaFont', 'useTimesNewRomanFont', 'useTrebuchetFont', 'useVerdanaFont', 'useSymbolFont', 'useWebdingsFont',
+ 'useWingDingsFont', 'useSansSerifFont', 'useSerifFont'];
+
var self = {
ace: null,
@@ -161,6 +163,7 @@ var padeditor = (function()
font = font.replace("Font","");
font = font.toLowerCase();
if(font === "monospace") self.ace.setProperty("textface", "monospace");
+ if(font === "montserrat") self.ace.setProperty("textface", "Montserrat");
if(font === "opendyslexic") self.ace.setProperty("textface", "OpenDyslexic");
if(font === "comicsans") self.ace.setProperty("textface", "'Comic Sans MS','Comic Sans',cursive");
if(font === "georgia") self.ace.setProperty("textface", "Georgia,'Bitstream Charter',serif");
diff --git a/src/templates/pad.html b/src/templates/pad.html
index ae5adc05..9a9c6f07 100644
--- a/src/templates/pad.html
+++ b/src/templates/pad.html
@@ -161,6 +161,7 @@
<select id="viewfontmenu">
<option value="normal" data-l10n-id="pad.settings.fontType.normal"></option>
<option value="monospace" data-l10n-id="pad.settings.fontType.monospaced"></option>
+ <option value="montserrat" data-l10n-id="pad.settings.fontType.montserrat"></option>
<option value="opendyslexic" data-l10n-id="pad.settings.fontType.opendyslexic"></option>
<option value="comicsans" data-l10n-id="pad.settings.fontType.comicsans"></option>
<option value="georgia" data-l10n-id="pad.settings.fontType.georgia"></option>