Skip to content

Instantly share code, notes, and snippets.

@cballou
Created March 24, 2012 21:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save cballou/2188227 to your computer and use it in GitHub Desktop.
Save cballou/2188227 to your computer and use it in GitHub Desktop.
CSS3 @font-face With Bold and Italic Support
/* normal case */
@font-face {
font-family: "DejaVu Sans";
src: url(‘path-to-font-directory/DejaVuSans.eot’);
src: local(‘☺’), url("path-to-font-directory/DejaVuSans.ttf") format("truetype");
}
/* bold */
@font-face {
font-family: "DejaVu Sans";
src: url(‘path-to-font-directory/DejaVuSans-Bold.eot’);
src: local(‘☺’), url("path-to-font-directory/DejaVuSans-Bold.ttf") format("truetype");
font-weight: bold;
}
/* italic (oblique) */
@font-face {
font-family: "DejaVu Sans";
src: url(‘path-to-font-directory/DejaVuSans-Oblique.eot’);
src: local(‘☺’), url("path-to-font-directory/DejaVuSans-Oblique.ttf") format("truetype");
font-style: italic, oblique;
}
/* bold and italic (oblique) */
@font-face {
font-family: "DejaVu Sans";
src: url(‘path-to-font-directory/DejaVuSans-BoldOblique.eot’);
src: local(‘☺’), url("path-to-font-directory/DejaVuSans-BoldOblique.ttf") format("truetype");
font-weight: bold;
font-style: italic, oblique;
}
h3 { font: bold 18px/24px "DejaVu Sans"; }
@font-face {
font-family: "DejaVu Sans";
src: url(‘path-to-font-directory/DejaVuSans.eot’);
src: local(‘☺’), url("path-to-font-directory/DejaVuSans.ttf") format("truetype");
}
@font-face {
font-family: <a-remote-font-name>;
src: <source> [<format>][,<source> [<format>]]*;
[font-weight: <weight>];
[font-style: <style>];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment