u1amo01 wrote:I use OpenSans as font. Is there a simple way to use the fonts located on my webspace instead from google?
Define “simple”.
First, you'll need to turn off the webfont usage in the theme options for 2k11 altogether. I'll assume you already use a user.css and have it set up in the theme options.
You'll need to add the Open Sans @font-face rules to your user.css. I recommend using the
FontSquirrel webfont kit or (because the Open Sans kit includes a lot of fonts you probably won't need) better: the
FontSquirrel webfont generator using
just Open Sans Regular, Italic, Bold and Bold Italic (those are the font styles most people actually use/need). Both will give you a zip file to download.
From that zip file, you'll need to
1. upload the fonts to your blog's web space; I recommend putting them in a folder "font" in your theme directory, it's safe in case of an update (unless you screw up your FTP upload, of course
)
2. put the required @font-face declarations included in the zip file at the
very beginning of your user.css (the zip file should include documentation as to which declarations you'll need to copy)
3. You'll need to adapt the path to the font files in those @font-face declarations. If you put them in the “font” folder in your theme directory, the path should be e.g.
Code: Select all
src: url(font/'OpenSans-SemiboldItalic-webfont.eot');
(same for the other font files, of course)
4.
Right after the @font-face declarations, add this to your user.css:
Code: Select all
body,
button,
input,
select,
textarea { font-family: 'Open Sans', sans-serif; }
That should do the trick.
However, please note that this is
kind of a performance hit since the web fonts will be loaded as well as “activated”
after the theme's style.css is being parsed because they're referenced in the user.css. Usually, it's recommended to load and apply web fonts as early in your CSS as possible.
I'm afraid the only way to avoid that is either use the Google webfonts or fork 2k11 (and include all the webfonts stuff in your fork's style.css).
YL