Display remote font on web page

Possible duplicate:
Custom fonts on the web?

I created a Unicode font and I would like to use it on my web page. I want people to see and read the font. Can they do this without installing a font? Something like running a font from a server?

If I remember correctly, I saw this a long time ago.

+4
source share
2 answers

You can do this using the CSS3 @ font-face function . But you must provide the necessary font formats.

FontSquirrel @ font-face Generator is a good web tool that does all the dirty work for you. It is very easy to use and creates all the necessary files, including CSS stylesheets and an HTML sample file.

What is really valuable is that it includes all the formats and hacks needed to display the font in all major browsers, which is not so easy to do right.

+8
source

You can use @ font-face

In your css, the font will be declared using the @ font-face rule. You can specify a font family, specify links to fonts in different formats.

@font-face { font-family: 'MyWebFont'; src: url('webfont.eot'); /* IE9 Compat Modes */ src: url('webfont.eot?#iefix') format('embedded-opentype'), url('webfont.woff') format('woff'), url('webfont.ttf') format('truetype'), url('webfont.svg#svgFontName') format('svg'); } 

In your html you call it with font-family

 body { font-family: 'MyWebFont', Fallback, sans-serif; } 
+2
source

Source: https://habr.com/ru/post/1440649/


All Articles