Custom Fixed Font in Gmail

Custom fixed-font in Gmail messages

اعتبارا من 25-02-2017. شاهد أحدث إصدار.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name           Custom Fixed Font in Gmail
// @namespace      https://mail.google.com
// @include        https://mail.google.com/*
// @icon           https://mail.google.com/favicon.ico
// @run-at         document-start
// @description    Custom fixed-font in Gmail messages
// @version        1.1
// @homepageURL    https://github.com/lidel/userscripts
// @grant          none
// ==/UserScript==

var fontName = 'Droid Sans Mono';
var fontSubset = 'latin';

// dragons below this line
var fontCss = 'font-family: \'' + fontName + '\', monospace !important;';
// plain-text messages
var css = '.ii, .Ak {' + fontCss + '}';
// editor
css += '.editable {' + fontCss + '}';
// load
var heads = document.getElementsByTagName('head');
if (heads.length > 0) {
  var link = document.createElement('link');
  link.rel = 'stylesheet';
  link.href = '//fonts.googleapis.com/css?family=' + fontName.replace(/\ /g, '+') + '&subset=' + fontSubset;
  heads[0].appendChild(link);
  var node = document.createElement('style');
  node.type = 'text/css';
  node.appendChild(document.createTextNode(css));
  heads[0].appendChild(node);
}