Change font-size by @font-face

Asked

Viewed 71 times

3

It is possible to change the font-size from a source within the @font-face? I’m trying the following:

@font-face {
    font-family: kivetts;
    src: url(fonts/kivettsregular.otf);
}
@font-face {
    font-family: DicksHandwriting;
    src: url(fonts/DicksHandwriting.otf);
    font-size:1.5em;
}

.menu-image-title {
    font-family: 'kivetts', DicksHandwriting
}

The first source did not possess the character O, so I want to use the O of the second, however the second source is smaller than the first, so I need to increase it. If you know of any other way to resolve this problem, please indicate a path. Thank you!

  • You couldn’t do it like that: <h4>P<span class="font_o" >ó</span></h4> and so style .font_o { font-size: 1.5em; } ?

  • Unfortunately not, the texts will be dynamic, I have no way to insert <span></span> in all the "O". Grateful.

  • And how would you change your source in "Oh"?

  • Thus: font-family: 'kivetts', DicksHandwriting. See in operation: [http://108.179.252.83/~Magnolia/] notice in the menu, that "ó" is of the second source, because the first one does not have this character.

1 answer

0

Unfortunately @font-face only allows you to change the following font attributes: font-family, src, font-stretch (condensing), font-style and font-Weight.

If it’s something small, maybe the font-Weight can solve your problem.

Another solution is to add a standard font-size as below:

* {
  font-size: 1.5em; 
}
  • Good explanation, I just think that changing the * {} is not a good way, maybe it is better to indicate this .menu-image-title {font-size: 1.5em; }

  • True, William. If it’s only for this class, it’s best to use directly on it.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.