我需要获取所有可用字体的列表,以便在组合框下显示它们。 当用户选择字体时 - >所选文本应根据其选择而更改。 我的问题是我没有找到一个完整的列表,其中包含我使用chrome浏览器获得的所有字体作为示例。
我指的是我不需要下载的家庭字体,例如#34; David"," Times New Roman"等?
我应该在哪里获得这么详细的清单。
我的实施:
var getFontsFamily = function () {
var fonts = [];
var cursiveFont = new ComboBoxElement("cursive", "cursive");
fonts.push(cursiveFont);
var fantasyFont = new ComboBoxElement("fantasy", "fantasy");
fonts.push(fantasyFont);
var initialFont = new ComboBoxElement("initial", "initial");
fonts.push(initialFont);
var monospaceFont = new ComboBoxElement("monospace", "monospace");
fonts.push(monospaceFont);
var sanSerifFont = new ComboBoxElement("sans-serif", "sans-serif");
fonts.push(sanSerifFont);
var serifFont = new ComboBoxElement("serif", "serif");
fonts.push(serifFont);
return fonts;
};
在我的控制器中: $ scope.fonts = helperCtrl.getFontsFamily();
在我的HTML中:
<div class="customizedSelect">
<select id="groupSelection"
ng-model="selectedText.fontFamily" ng-options="font.type as font.value for font in fonts"></select>
</div>
<div ng-class="{bold : item.isBold == true}" style="color:{{item.textColor}}; font-size:{{item.size}}pt; font-family:{{item.fontFamily}}">{{item.text}}</div>
此外,我需要这些字体将在android中显示为连接web和android之间的平台。 safeweb字体是否是跨平台的?