[TIMOB-24882] iOS: Label font is downscaled lower than minimumFontSize for AttributedString
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Low |
| Status | Open |
| Resolution | Unresolved |
| Affected Version/s | Release 6.1.0, Release 8.0.0 |
| Fix Version/s | n/a |
| Components | iOS |
| Labels | engSchedule, ios, label |
| Reporter | Joshua Quick |
| Assignee | Unknown |
| Created | 2017-06-23T01:12:08.000+0000 |
| Updated | 2019-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
| File | Date | Size |
|---|---|---|
| ActualResult.png | 2017-06-23T01:12:01.000+0000 | 38358 |
| ExpectedResult.png | 2017-06-23T01:12:01.000+0000 | 40413 |
No comments