Added RobotoMono as a more modern and pretty monospaced font, addressing #3201

I added RobotoMono-Regular and RobotoMono-Bold as TrueTypeFont files and included them into the list. I tred to stay in alphabetical order where possible.

The author of #3201 was asking for a more modern monospaced font.
This commit is contained in:
Jan Holub 2017-06-21 23:44:23 +02:00
parent 9f51432175
commit 7029248a76
7 changed files with 41 additions and 25 deletions

View file

@ -47,6 +47,7 @@
"pad.settings.fontType.lucida": "Lucida", "pad.settings.fontType.lucida": "Lucida",
"pad.settings.fontType.lucidasans": "Lucida Sans", "pad.settings.fontType.lucidasans": "Lucida Sans",
"pad.settings.fontType.palatino": "Palatino", "pad.settings.fontType.palatino": "Palatino",
"pad.settings.fontType.robotomono": "RobotoMono",
"pad.settings.fontType.tahoma": "Tahoma", "pad.settings.fontType.tahoma": "Tahoma",
"pad.settings.fontType.timesnewroman": "Times New Roman", "pad.settings.fontType.timesnewroman": "Times New Roman",
"pad.settings.fontType.trebuchet": "Trebuchet", "pad.settings.fontType.trebuchet": "Trebuchet",

View file

@ -1260,6 +1260,21 @@ input[type=checkbox] {
src: url("../../static/font/opendyslexic.otf") format("opentype"); src: url("../../static/font/opendyslexic.otf") format("opentype");
} }
/* Roboto Mono */
@font-face {
font-family: "RobotoMono";
src: url("../../static/font/RobotoMono-Regular.ttf") format("truetype");
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: "RobotoMono";
src: url("../../static/font/RobotoMono-Bold.ttf") format("truetype");
font-weight: bold;
font-style: normal;
}
/* End of Roboto Mono */
@font-face { @font-face {
font-family: "fontawesome-etherpad"; font-family: "fontawesome-etherpad";
src:url("../../static/font/fontawesome-etherpad.eot"); src:url("../../static/font/fontawesome-etherpad.eot");
@ -1304,5 +1319,3 @@ input[type=checkbox] {
.hideControlsEditbar{ .hideControlsEditbar{
display:none !important; display:none !important;
} }

Binary file not shown.

Binary file not shown.

View file

@ -1,5 +1,5 @@
/** /**
* This code is mostly from the old Etherpad. Please help us to comment this code. * This code is mostly from the old Etherpad. Please help us to comment this code.
* This helps other people to understand this code better and helps them to improve it. * This helps other people to understand this code better and helps them to improve it.
* TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED * TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED
*/ */
@ -99,15 +99,15 @@ function getParams()
setting.callback(value); setting.callback(value);
} }
} }
// Then URL applied stuff // Then URL applied stuff
var params = getUrlVars() var params = getUrlVars()
for(var i = 0; i < getParameters.length; i++) for(var i = 0; i < getParameters.length; i++)
{ {
var setting = getParameters[i]; var setting = getParameters[i];
var value = params[setting.name]; var value = params[setting.name];
if(value && (value == setting.checkVal || setting.checkVal == null)) if(value && (value == setting.checkVal || setting.checkVal == null))
{ {
setting.callback(value); setting.callback(value);
@ -156,7 +156,7 @@ function sendClientReady(isReconnect, messageType)
token = "t." + randomString(); token = "t." + randomString();
createCookie("token", token, 60); createCookie("token", token, 60);
} }
var sessionID = decodeURIComponent(readCookie("sessionID")); var sessionID = decodeURIComponent(readCookie("sessionID"));
var password = readCookie("password"); var password = readCookie("password");
@ -169,14 +169,14 @@ function sendClientReady(isReconnect, messageType)
"token": token, "token": token,
"protocolVersion": 2 "protocolVersion": 2
}; };
//this is a reconnect, lets tell the server our revisionnumber //this is a reconnect, lets tell the server our revisionnumber
if(isReconnect == true) if(isReconnect == true)
{ {
msg.client_rev=pad.collabClient.getCurrentRevisionNumber(); msg.client_rev=pad.collabClient.getCurrentRevisionNumber();
msg.reconnect=true; msg.reconnect=true;
} }
socket.json.send(msg); socket.json.send(msg);
} }
@ -203,12 +203,12 @@ function handshake()
socket.once('connect', function () { socket.once('connect', function () {
sendClientReady(false); sendClientReady(false);
}); });
socket.on('reconnect', function () { socket.on('reconnect', function () {
pad.collabClient.setChannelState("CONNECTED"); pad.collabClient.setChannelState("CONNECTED");
pad.sendClientReady(true); pad.sendClientReady(true);
}); });
socket.on('reconnecting', function() { socket.on('reconnecting', function() {
pad.collabClient.setChannelState("RECONNECTING"); pad.collabClient.setChannelState("RECONNECTING");
}); });
@ -254,7 +254,7 @@ function handshake()
$("#passwordinput").focus(); $("#passwordinput").focus();
} }
} }
//if we haven't recieved the clientVars yet, then this message should it be //if we haven't recieved the clientVars yet, then this message should it be
else if (!receivedClientVars && obj.type == "CLIENT_VARS") else if (!receivedClientVars && obj.type == "CLIENT_VARS")
{ {
@ -267,7 +267,7 @@ function handshake()
clientVars = obj.data; clientVars = obj.data;
clientVars.userAgent = "Anonymous"; clientVars.userAgent = "Anonymous";
clientVars.collab_client_vars.clientAgent = "Anonymous"; clientVars.collab_client_vars.clientAgent = "Anonymous";
//initalize the pad //initalize the pad
pad._afterHandshake(); pad._afterHandshake();
initalized = true; initalized = true;
@ -298,7 +298,7 @@ function handshake()
{ {
pad.changeViewOption('noColors', true); pad.changeViewOption('noColors', true);
} }
if (settings.rtlIsTrue == true) if (settings.rtlIsTrue == true)
{ {
pad.changeViewOption('rtlIsTrue', true); pad.changeViewOption('rtlIsTrue', true);
@ -345,13 +345,13 @@ function handshake()
}); });
// Bind the colorpicker // Bind the colorpicker
var fb = $('#colorpicker').farbtastic({ callback: '#mycolorpickerpreview', width: 220}); var fb = $('#colorpicker').farbtastic({ callback: '#mycolorpickerpreview', width: 220});
// Bind the read only button // Bind the read only button
$('#readonlyinput').on('click',function(){ $('#readonlyinput').on('click',function(){
padeditbar.setEmbedLinks(); padeditbar.setEmbedLinks();
}); });
} }
$.extend($.gritter.options, { $.extend($.gritter.options, {
position: 'bottom-right', // defaults to 'top-right' but can be 'bottom-left', 'bottom-right', 'top-left', 'top-right' (added in 1.7.1) position: 'bottom-right', // defaults to 'top-right' but can be 'bottom-left', 'bottom-right', 'top-left', 'top-right' (added in 1.7.1)
fade: false, // dont fade, too jerky on mobile fade: false, // dont fade, too jerky on mobile
time: 6000 // hang on the screen for... time: 6000 // hang on the screen for...
@ -424,7 +424,7 @@ var pad = {
if(window.history && window.history.pushState) if(window.history && window.history.pushState)
{ {
$('#chattext p').remove(); //clear the chat messages $('#chattext p').remove(); //clear the chat messages
window.history.pushState("", "", newHref); window.history.pushState("", "", newHref);
receivedClientVars = false; receivedClientVars = false;
sendClientReady(false, 'SWITCH_TO_PAD'); sendClientReady(false, 'SWITCH_TO_PAD');
} }
@ -549,7 +549,7 @@ var pad = {
} }
var fonts = ['useMonospaceFont', 'useOpenDyslexicFont', 'useComicSansFont', 'useCourierNewFont', 'useGeorgiaFont', 'useImpactFont', var fonts = ['useMonospaceFont', 'useOpenDyslexicFont', 'useComicSansFont', 'useCourierNewFont', 'useGeorgiaFont', 'useImpactFont',
'useLucidaFont', 'useLucidaSansFont', 'usePalatinoFont', 'useTahomaFont', 'useTimesNewRomanFont', 'useLucidaFont', 'useLucidaSansFont', 'usePalatinoFont', 'useRobotoMonoFont', 'useTahomaFont', 'useTimesNewRomanFont',
'useTrebuchetFont', 'useVerdanaFont', 'useSymbolFont', 'useWebdingsFont', 'useWingDingsFont', 'useSansSerifFont', 'useTrebuchetFont', 'useVerdanaFont', 'useSymbolFont', 'useWebdingsFont', 'useWingDingsFont', 'useSansSerifFont',
'useSerifFont']; 'useSerifFont'];
@ -731,20 +731,20 @@ var pad = {
pad.diagnosticInfo.disconnectedMessage = message; pad.diagnosticInfo.disconnectedMessage = message;
pad.diagnosticInfo.padId = pad.getPadId(); pad.diagnosticInfo.padId = pad.getPadId();
pad.diagnosticInfo.socket = {}; pad.diagnosticInfo.socket = {};
//we filter non objects from the socket object and put them in the diagnosticInfo //we filter non objects from the socket object and put them in the diagnosticInfo
//this ensures we have no cyclic data - this allows us to stringify the data //this ensures we have no cyclic data - this allows us to stringify the data
for(var i in socket.socket) for(var i in socket.socket)
{ {
var value = socket.socket[i]; var value = socket.socket[i];
var type = typeof value; var type = typeof value;
if(type == "string" || type == "number") if(type == "string" || type == "number")
{ {
pad.diagnosticInfo.socket[i] = value; pad.diagnosticInfo.socket[i] = value;
} }
} }
pad.asyncSendDiagnosticInfo(); pad.asyncSendDiagnosticInfo();
if (typeof window.ajlog == "string") if (typeof window.ajlog == "string")
{ {

View file

@ -1,5 +1,5 @@
/** /**
* This code is mostly from the old Etherpad. Please help us to comment this code. * This code is mostly from the old Etherpad. Please help us to comment this code.
* This helps other people to understand this code better and helps them to improve it. * This helps other people to understand this code better and helps them to improve it.
* TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED * TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED
*/ */
@ -31,7 +31,7 @@ var padeditor = (function()
// Array of available fonts // Array of available fonts
var fonts = ['useMonospaceFont', 'useOpenDyslexicFont', 'useComicSansFont', 'useCourierNewFont', 'useGeorgiaFont', 'useImpactFont', var fonts = ['useMonospaceFont', 'useOpenDyslexicFont', 'useComicSansFont', 'useCourierNewFont', 'useGeorgiaFont', 'useImpactFont',
'useLucidaFont', 'useLucidaSansFont', 'usePalatinoFont', 'useTahomaFont', 'useTimesNewRomanFont', 'useLucidaFont', 'useLucidaSansFont', 'usePalatinoFont', 'useRobotoMonoFont', 'useTahomaFont', 'useTimesNewRomanFont',
'useTrebuchetFont', 'useVerdanaFont', 'useSymbolFont', 'useWebdingsFont', 'useWingDingsFont', 'useSansSerifFont', 'useTrebuchetFont', 'useVerdanaFont', 'useSymbolFont', 'useWebdingsFont', 'useWingDingsFont', 'useSansSerifFont',
'useSerifFont']; 'useSerifFont'];
@ -102,7 +102,7 @@ var padeditor = (function()
pad.changeViewOption(font, $("#viewfontmenu").val() == sfont); pad.changeViewOption(font, $("#viewfontmenu").val() == sfont);
}); });
}); });
// Language // Language
html10n.bind('localized', function() { html10n.bind('localized', function() {
$("#languagemenu").val(html10n.getLanguage()); $("#languagemenu").val(html10n.getLanguage());
@ -168,6 +168,7 @@ var padeditor = (function()
if(font === "lucida") self.ace.setProperty("textface", "Lucida,'Lucida Serif','Lucida Bright',serif"); if(font === "lucida") self.ace.setProperty("textface", "Lucida,'Lucida Serif','Lucida Bright',serif");
if(font === "lucidasans") self.ace.setProperty("textface", "'Lucida Sans','Lucida Grande','Lucida Sans Unicode','Luxi Sans',sans-serif"); if(font === "lucidasans") self.ace.setProperty("textface", "'Lucida Sans','Lucida Grande','Lucida Sans Unicode','Luxi Sans',sans-serif");
if(font === "palatino") self.ace.setProperty("textface", "Palatino,'Palatino Linotype','URW Palladio L',Georgia,serif"); if(font === "palatino") self.ace.setProperty("textface", "Palatino,'Palatino Linotype','URW Palladio L',Georgia,serif");
if(font === "robotomono") self.ace.setProperty("textface", "RobotoMono");
if(font === "tahoma") self.ace.setProperty("textface", "Tahoma,sans-serif"); if(font === "tahoma") self.ace.setProperty("textface", "Tahoma,sans-serif");
if(font === "timesnewroman") self.ace.setProperty("textface", "'Times New Roman',Times,serif"); if(font === "timesnewroman") self.ace.setProperty("textface", "'Times New Roman',Times,serif");
if(font === "trebuchet") self.ace.setProperty("textface", "'Trebuchet MS',sans-serif"); if(font === "trebuchet") self.ace.setProperty("textface", "'Trebuchet MS',sans-serif");

View file

@ -168,6 +168,7 @@
<option value="lucida" data-l10n-id="pad.settings.fontType.lucida"></option> <option value="lucida" data-l10n-id="pad.settings.fontType.lucida"></option>
<option value="lucidasans" data-l10n-id="pad.settings.fontType.lucidasans"></option> <option value="lucidasans" data-l10n-id="pad.settings.fontType.lucidasans"></option>
<option value="palatino" data-l10n-id="pad.settings.fontType.palatino"></option> <option value="palatino" data-l10n-id="pad.settings.fontType.palatino"></option>
<option value="robotomono" data-l10n-id="pad.settings.fontType.robotomono"></option>
<option value="tahoma" data-l10n-id="pad.settings.fontType.tahoma"></option> <option value="tahoma" data-l10n-id="pad.settings.fontType.tahoma"></option>
<option value="timesnewroman" data-l10n-id="pad.settings.fontType.timesnewroman"></option> <option value="timesnewroman" data-l10n-id="pad.settings.fontType.timesnewroman"></option>
<option value="trebuchet" data-l10n-id="pad.settings.fontType.trebuchet"></option> <option value="trebuchet" data-l10n-id="pad.settings.fontType.trebuchet"></option>