Skip to content

Instantly share code, notes, and snippets.

@elundmark
Created October 27, 2013 14:44
Show Gist options
  • Save elundmark/7183054 to your computer and use it in GitHub Desktop.
Save elundmark/7183054 to your computer and use it in GitHub Desktop.
/*
* Fix font-family:Times showing as Nimbus No9 on Linux
*
* Example (debugging): http://jsfiddle.net/2GzvY/3/embedded/result/
*
* Problem: Specifying "Times" and not "Times New Roman" in your css will render with the Nimbus No9 font.
* Solution: Force the browser to select "Times New Roman" with @font-face rules.
* Dependencies: msttcorefonts installed
* Author: mail@elundmark.se
* Date 2013-10-04
* Discussion (old): http://ubuntuforums.org/showthread.php?t=804242
* File: Add the following code to your profile -> chrome -> userContent.css file for Firefox or profile -> User StyleSheets -> Custom.css for Chrome
*
* For the best results and installing the current Helvetica fonts, google for "Helvetica.dfont" and extract it using fondu, then save all those files in ~/.fonts/Helvetica
*
*/
@font-face {
font-family: Times;
src: local(Times_New_Roman.ttf);
src: local(Times New Roman);
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: Times;
src: local(Times_New_Roman_Italic.ttf);
src: local(Times New Roman Italic);
font-weight: normal;
font-style: italic;
}
@font-face {
font-family: Times;
src: local(Times_New_Roman_Bold.ttf);
src: local(Times New Roman Bold);
font-weight: bold;
font-style: normal;
}
@font-face {
font-family: Times;
src: local(Times_New_Roman_Bold_Italic.ttf);
src: local(Times New Roman Bold Italic);
font-weight: bold;
font-style: italic;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment