0

I want to embed a font using @font-face, but only if this font is missing in user’s system. For example, if he has Verdana installed, then I want this rule to be applied in the browser:

font-family: Verdana;

But if Verdana is missing, I want it to be embedded through @font-face directive, like this:

@font-face {
  font-family: Verdana;
  src: url(/some_path/verdana.ttf);
}

How to write the code for this selection?

0

1 Answer 1

2

Use

@font-face {
  font-family: Verdana;
  src: local('Verdana'), url(/some_path/verdana.ttf);
}
Sign up to request clarification or add additional context in comments.

Comments