Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6055] iOS: Serif generic font selector not supported on iOS

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2017-06-07T20:41:32.000+0000
Affected Version/sRelease 1.7.5
Fix Version/sn/a
ComponentsiOS
Labelsparity
ReporterArthur Evans
AssigneeIngo Muschenetz
Created2011-11-07T14:09:17.000+0000
Updated2017-06-07T20:41:32.000+0000

Description

On Android, the fontFamily can use the generic specifiers 'serif', 'sans-serif', or 'monospace' to select the default system serif, sans-serif, or monospaced font. These also work in CSS, so web developers are used to using them. The 'monospace' selector is implemented on iOS, and the 'sans-serif' selector works by accident (since the default font is sans-serif). However, 'serif' is not recognized. Compare the results of the following code snippet on iOS and Android:
function makeLabel(labelText, labelFont) 
{
	return Titanium.UI.createLabel({
	top: 20,
	text:labelText,
	font:labelFont,
	width:'auto',
	height:'auto'
	});
}

win2.add(makeLabel('Sans-Serif', { fontFamily:'sans-serif', fontSize: 30} ));
win2.add(makeLabel('Serif',      { fontFamily:'serif', fontSize: 30} ));
win2.add(makeLabel('Monospace',  { fontFamily:'monospace', fontSize:30}  ));

Comments

  1. Lee Morris 2017-06-07

    Closing ticket due to time passed and lack of progress in the past 5 years.

JSON Source