自定義web字體-通過@font-face在頁面中嵌入 .woff格式字體的引用

font = TTFont('xxx.woff')    # 打開文件
font.saveXML('xxx/6329.xml')
font['cmap'] 映射關係unicode跟Name
ffont['glyf'][name].coordinates 字形的輪廓信息
  • 在html5中嵌入字體  .woff格式的引用
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"></meta>
    <title>測試</title>
    <link rel="stylesheet" href="css/myWebFont.css"></link>
</head>
<body>
<div class="col-sm-12">
    <div class="row list-icon">
        <div class="col-md-3">
            <i class="ui-icon mf mf-folderadd"></i>mf-folderadd
        </div>
    </div>
</div>
</body>
<html>
  • .woff的引用​​​​​​​ 
@font-face {
	font-family: 'woff-文件名';
	font-style: normal;
	font-weight: 400;
	src: url(css/Monoton.woff2) format('woff2'),  //引入文件路徑
             url('mywebfont.eot?#iefix') format('embedded-opentype'),
             url('mywebfont.woff2') format('woff2'),
             url('mywebfont.woff') format('woff'),
             url('mywebfont.ttf') format('truetype'),
             url('mywebfont.svg#mywebfontregular') format('svg');

	}

  

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章