Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24882] iOS: Label font is downscaled lower than minimumFontSize for AttributedString

GitHub Issuen/a
TypeBug
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 6.1.0, Release 8.0.0
Fix Version/sn/a
ComponentsiOS
LabelsengSchedule, ios, label
ReporterJoshua Quick
AssigneeUnknown
Created2017-06-23T01:12:08.000+0000
Updated2019-05-14T15:38:01.000+0000

Description

*Summary:* If a label is set up to use a "minimumFontSize" and an "attributedString", but the "font" property was not assigned, then the text can be downscaled lower than the configured "minimumFontSize". *Code to reproduce:*
var window = Ti.UI.createWindow({ backgroundColor: "gray" });
window.add(Ti.UI.createLabel(
{
	attributedString: Ti.UI.createAttributedString(
	{
		text: "Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal.",
	}),
	color: "white",
	backgroundColor: "black",
//	font: { fontSize: 20 },
	minimumFontSize: 10,
}));
window.open();
*Result:* Text font size is downscaled to fit the entire text. It is exceeding the configured "minimumFontSize". *Notes:* * This is not an issue with the "text" property. Only with "attributedString". * This downscaling issue goes away with "attributedString" if the Label's "font" property is assigned. *Work-Around:* Assign the Label's "font" property. For example, you can set it up to use the default font size by assigning it an empty table like this...
myLabel.font = {};

Attachments

FileDateSize
ActualResult.png2017-06-23T01:12:01.000+000038358
ExpectedResult.png2017-06-23T01:12:01.000+000040413

Comments

No comments

JSON Source