Project: titanium
Issue TIMOB-18853: Android: Custom Fonts not working in Attributed Strings
h2. Problem The Ti.UI.ATTRIBUTE_FONT part of TIMOB-15998 doesn't appear to be working with custom fonts. TIMOB-15998 didn't demonstrate custom fonts working. The built-in font Roboto and its variants are working, as well as the built-in families monospace and serif. However, custom fonts placed in app/assets/android/fonts as well as app/assets/fonts are not working. Below, I'm expecting to see the first line of text, "Chantelli Antiqua," to be displayed in the custom font, which is more of a serif font than the sans-serif shown. Instead, however, we see the text displayed in the default font. h2. Test case {code:lang=javascript|title=app.js} var win = Titanium.UI.createWindow({	backgroundColor : "#ffffff" }); var scrollView = Ti.UI.createScrollView({	height : Ti.UI.FILL,	width : Ti.UI.FILL,	layout : "vertical" }); win.add(scrollView); win.open(); var fonts = ["Chantelli_Antiqua", "serif", "monospace", "sans-serif", "sans-serif-light", "sans-serif-condensed"]; _.each(fonts, function(font) {	var text = font;	var attr = Titanium.UI.createAttributedString({	text : text,	tributes : [	{	type : Ti.UI.ATTRIBUTE_FONT,	value : {	font : {	fontSize : 20,	fontFamily : font	}	},	range : [0, text.length]	},	{	type : Ti.UI.ATTRIBUTE_FOREGROUND_COLOR,	value : "#000000",	range : [0, text.length]	}]	});	var label = Titanium.UI.createLabel({	top : 10,	left : 10,	right : 10,	height : Titanium.UI.SIZE,	tributedString : attr	});	scrollView.add(label); }); {code}
Story points: 5