How do I load external fonts into an HTML document?

后端 未结 8 1022
我在风中等你
我在风中等你 2020-12-04 15:41

How do I load external font files into an HTML document.

Example: Make the text \"blah blah blah blah blah blah blah\" a custom font from a TTF file in the same dir

8条回答
  •  悲&欢浪女
    2020-12-04 15:46

    Microsoft have a proprietary CSS method of including embedded fonts (http://msdn.microsoft.com/en-us/library/ms533034(VS.85).aspx), but this probably shouldn't be recommended.

    I've used sIFR before as this works great - it uses Javascript and Flash to dynamically replace normal text with some Flash containing the same text in the font you want (the font is embedded in a Flash file). This does not affect the markup around the text (it works by using a CSS class), you can still select the text, and if the user doesn't have Flash or has it disabled, it will degrade gracefully to the text in whatever font you specify in CSS (e.g. Arial).

提交回复
热议问题