-
Notifications
You must be signed in to change notification settings - Fork 6
/
Fonts.jsx
25 lines (21 loc) · 922 Bytes
/
Fonts.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/**
* Created with JetBrains WebStorm.
* User: sapphire.shand
* Date: 13-9-5
* Time: 下午1:50
* To change this template use File | Settings | File Templates.
*/
var WEBFONTS = ['Arial', 'Arial Narrow', 'ArialMT' , 'Verdana', 'Georgia', 'Times New Roman',
'Trebuchet MS', 'Courier New', 'Impact', 'Comic Sans MS', 'Tahoma', 'Courier', 'Lucida Sans Unicode',
'Lucida Console', 'Garamond', ' MS Sans Serif', 'MS Serif', 'Palatino Linotype', 'Symbol', '宋体','新宋体', '微软雅黑', '黑体', '楷体',
'幼圆', '仿宋', 'MicrosoftYaHei', 'SimSun','NSimSun', 'AdobeSongStd-Light', 'SimHei'];
WEBFONTS.webFont = {microsoftyahei:'Microsoft YaHei'};
WEBFONTS.getWebFont = function(font){
return WEBFONTS.webFont[font.toLowerCase()] || font;
}
WEBFONTS.indexOf = function(s){
for(var i = 0, l = WEBFONTS.length; i < l; i++){
if(WEBFONTS[i].toLowerCase() === s.toLowerCase()) return i;
}
return -1;
}