[TIMOB-6053] Android: fontStyle not supported on Android
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-02-12T19:32:26.000+0000 |
Affected Version/s | Release 1.8.0 |
Fix Version/s | Release 3.1.0, 2013 Sprint 04 API, 2013 Sprint 04 |
Components | Android |
Labels | module_label, parity, qe-testadded, tbs-2.1.0 |
Reporter | Arthur Evans |
Assignee | Sunila |
Created | 2011-11-07T13:36:29.000+0000 |
Updated | 2013-08-09T17:13:48.000+0000 |
Description
On iOS, the user can select an italic font by specifying a font object like:
{ fontSize: '16', fontStyle: 'italic' }
In Android, there appears to be no way to select an italic font, even when using a family like DroidSerif which includes an italic face. Both:
{ fontFamily: 'DroidSerif', fontStyle: 'italic' }
And:
{ fontFamily: 'DroidSerif-Italic' }
Fail to produce the desired results.
The following code snippet demonstrates the issue. The italic fonts show up as expected on iOS, but not on Android.
var win1 = Ti.UI.createWindow({
backgroundColor:'white',
layout:'vertical'
});
function makeLabel(labelText, labelFont)
{
return Titanium.UI.createLabel({
top: 20,
text:labelText,
font:labelFont,
width:'auto',
height:'auto'
});
}
var theTestFont = 'serif';
win1.add(makeLabel('Font normal normal', { fontFamily:theTestFont, fontWeight:'normal', fontStyle:'normal'}));
win1.add(makeLabel('Font bold normal', { fontFamily:theTestFont, fontWeight:'bold', fontStyle:'normal'}));
win1.add(makeLabel('Font normal italic', { fontFamily:theTestFont, fontWeight:'normal', fontStyle:'italic'}));
win1.add(makeLabel('Font bold italic', { fontFamily:theTestFont, fontWeight:'bold', fontStyle:'italic'}));
win1.open();
https://github.com/appcelerator/titanium_mobile/pull/3581
Environment used for verification - Titanium SDK: 3.1.0.v20130226024607 Titanium Studio:3.0.2.201302141201 Device: Samsung GALAXY Note (2.3.6)