2014-12-21, 00:26:12
(2014-12-20, 22:15:58)Timbow Wrote: I just went to the link and copied what I found there but it turns out that link returns different declarations for different browsers so no wonder it only works in chrome.
CKEditor v3.x seems to only accept .ttf fonts. It works if the font file is provided by:
- include Raleway-Regular.ttf in the (e.g.) css folder;
- add this near the top of editor.css
Code:
@font-face {
font-family: 'Raleway';
src: url('css/Raleway-Regular.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
Limitations: editor doesn't show different font weights (e.g., bold, etc.). Don't know how to work around that as the @font-face rule includes the weight.
(2014-12-20, 22:15:58)Timbow Wrote: A plugin to allow google fonts in the editor?
There seems to be a nascent CKE v4 plugin to add Google fonts. (IMO, the editor is where the plugin belongs, not in GS.)
For many reasons, I prefer to host the fonts on the website, rather than pulling them from a third-party, so I'm happy to carry on with my method for the time being. It isn't worth doing too much for CKE v3, as v4 in GS is just around the corner ... ;-)
Incidentally, the Raleway font has an open licence (SIL), so it could be redistributed with a theme. The .ttf file is 90k in size (from the Font Squirrel generator), but could probably be reduced by sub-setting.
--
Nick.
Nick.