Problem description
When using a TTC (TrueType Collection) file on Android, only the regular font seems to be taken in account. Applying a 'bold' effect on the font does not use the 'bold' variant inside the file. The same works fine on iOS.
Steps to reproduce
1. Need a TTC font that contains both regular and bold
2. create an Alloy app and configure it to support the custom font added
3. Create the following index.xml
<Alloy>
<Window class="container">
<Label id="label" top='10dp' left='20dp' onClick="doClick">Custom bold font</Label>
<Label id="regularLabel" top='30dp' left='20dp' onClick="doClick">Custom regular font</Label>
</Window>
</Alloy>
4. Use the following index.tss:
".container": {
backgroundColor: "white"
},
"#label[platform=ios]": {
width: Ti.UI.SIZE,
height: Ti.UI.SIZE,
color: "#000",
font:{
fontFamily: "Gill Sans",
fontSize: "30dp",
fontWeight: "bold"
}
},
"#label[platform=android]": {
width: Ti.UI.SIZE,
height: Ti.UI.SIZE,
color: "#000",
font:{
fontFamily: "GillSans_1",
fontSize: '30dp'
}
},
"#regularLabel[platform=ios]": {
width: Ti.UI.SIZE,
height: Ti.UI.SIZE,
color: "#000",
font:{
fontFamily: "Gill Sans",
fontSize: "30dp"
}
},
"#regularLabel[platform=android]": {
width: Ti.UI.SIZE,
height: Ti.UI.SIZE,
color: "#000",
font:{
fontFamily: "GillSans_0",
fontSize: '30dp'
}
}
5. Run the app on both platforms
No comments