在TVML中设置字体系列 [英] Set font family in TVML
本文介绍了在TVML中设置字体系列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的TVML应用程序中,我可以使用tv-text-style:none来设置font-size和font-weight等字体属性,但是我无法设置font-family属性,这似乎是忽略:
var Template = function(){return`<?xml version =1.0encoding =UTF-8 ?>
<文件>
< head>
< style>
.customText {
tv-text-style:none;
tv-position:center;
颜色:白色;
font-size:40px;
font-weight:bold;
font-family:Courier;
}
< / style>
< / head>
< paradeTemplate>
...
< listItemLockup>
< title>标题< / title>
< relatedContent>
< divTemplate>
< title class =customText> abcABC< / title>
< / divTemplate>
< / relatedContent>
< / listItemLockup>
...
可以设置与系统字体系列不同的字体系列吗?
感谢您的帮助,
Luca
解决方案
TVInterfaceFactory
自定义字体支持了
示例:
tv-text-style:'none'
font-family:'Times New Roman'
In my TVML app I am able to set font style properties such as font-size and font-weight using tv-text-style:none, however I am not able to set the font-family property, which seems to be ignored:
var Template = function() { return `<?xml version="1.0" encoding="UTF-8" ?>
<document>
<head>
<style>
.customText {
tv-text-style: none;
tv-position: center;
color: white;
font-size: 40px;
font-weight: bold;
font-family: Courier;
}
</style>
</head>
<paradeTemplate>
...
<listItemLockup>
<title>Title</title>
<relatedContent>
<divTemplate>
<title class="customText">abcABC</title>
</divTemplate>
</relatedContent>
</listItemLockup>
...
Can I set a font-family different from the system font family?
Thanks for your help,
Luca
解决方案
font-family
is now available in TVML. No need to use TVInterfaceFactory
for custom font support anymore.
Example:
tv-text-style: 'none'
font-family: 'Times New Roman'
Apple TV Markup Language Reference: font-family
这篇关于在TVML中设置字体系列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文