How to install a Font in server

前端 未结 6 1469
清歌不尽
清歌不尽 2021-01-04 06:42

I have downloaded and installed a font in my system, then i used this font in my project, its worked fine in local system, but when i upload this page to server its not work

6条回答
  •  醉酒成梦
    2021-01-04 07:26

    You can load a font from the server into a web page just like any other resource, using CSS3 for all modern browsers except for IE, which requires using WEFT.exe (download free from Microsoft) to create an EOT file from the TTF font file (store the TTF file in your local fonts directory before running WEFT).

    Once you have the TTF and EOT files in your website directory, the following code should work:

    /* Load font for IE only */
    @font-face {font-family: Font Name;font-style: normal; font-weight: normal; src: url(FontName.eot)}
    /* Load font for other browsers */
    @font-face {font-family: Font Name; src: url(FontName.ttf)}
    /* Specify default font and any other styles */
    #id {font-family:Font Name,sans-serif}
    ...
    

    Text to be displayed

提交回复
热议问题