开发者

Using a custom (ttf) font in CSS

开发者 https://www.devze.com 2023-04-06 11:34 出处:网络
I have a mac, and have installed a font called开发者_开发技巧 \"7 Segment\" (it shows up in Font Book). When I use font-family: \"7 Segment\"; I get Helvetica (or similar) rather than the browser\'s d

I have a mac, and have installed a font called开发者_开发技巧 "7 Segment" (it shows up in Font Book). When I use font-family: "7 Segment"; I get Helvetica (or similar) rather than the browser's default font, but it still isn't showing the correct font. The page only needs to be shown on this computer. How would I use the font on this page? Thanks.


You need to use the css-property font-face to declare your font. Have a look at this fancy site: http://www.font-face.com/

Example:

@font-face {
  font-family: MyHelvetica;
  src: local("Helvetica Neue Bold"),
       local("HelveticaNeue-Bold"),
       url(MgOpenModernaBold.ttf);
  font-weight: bold;
}

See also: MDN @font-face


This is not a system font. this font is not supported in other systems. you can use font-face, convert font from this Site or from this

Using a custom (ttf) font in CSS

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号