wheresrhys
wheresrhys

Reputation: 23530

Aliases for fonts in CSS

I've just got into using @font-face. One of the unexpected perks is that instead of using the proper font name I can choose a more useful one, which is useful for reskinning

e.g instead of

@font-face {
   font-family: Museo Slab;
   src: ...
}

I can have

@font-face {
   font-family: Branding Font A;
   src: ...
}

So throughout my site I can then have e.g.

h1 {
  font-family: Branding Font A, Georgia, Serif;
}

... pretty useful as the site I'm working on will be syndicated, and I can easily just serve up different @font-face definitions for different publishers.

After that lengthy preamble, my question is "Is there a way to have an alias for one of the regular webfonts?" So that I can have eg "Body Text" as an alias for Arial, but such that I could change the "Body Text" @font-face declaration to use a different font if I wanted to.

Upvotes: 12

Views: 9183

Answers (2)

mVChr
mVChr

Reputation: 50195

You can do this the same way you do other web fonts by uploading the Arial font files to your server and declaring them the same way you would your other @font-face declarations, pointing the src to these files. Regardless of the fact that these are standard web fonts, I'm not sure if there are licensing issues with this technique however.

Upvotes: 0

Raph Levien
Raph Levien

Reputation: 5218

I'm pretty sure the answer is no. But if there is a way I'd really like to know about it!

One way that might sorta work is:

@font-face {
   font-family: Alias;
   src: local('Arial');
}

Upvotes: 21

Related Questions