Titanium JIRA Archive
Appcelerator Community (AC)

[AC-5011] Android: Label with minimumFontSize set, fontSize increases when text too long.

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionNeeds more info
Resolution Date2017-06-21T19:58:59.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsandroid
ReporterDonald Anderson
AssigneeShak Hossain
Created2017-06-06T09:47:41.000+0000
Updated2017-06-22T10:46:29.000+0000

Description

Using Titanium SDK 6.1.0.GA, when a label with a fixed height and width has a minimumFontSize set and text long enough to exceed with width of the label, the font size seems to increase.

Comments

  1. Ewan Harris 2017-06-06

    [~donald.anderson] I tried to create a minimum reproducible test case for this but I'm unable to see the behaviour your describing. Here's my code, the minimumFontSize appears to be respected to me. Could you confirm whether I am attempting to reproduce the issue correctly?
       var win = Ti.UI.createWindow({
           title: 'Window',
           backgroundColor: '#fff'
       });
       var label = Ti.UI.createLabel({
           text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque dignissim metus et porttitor auctor.',
           color: "#333",
           minimumFontSize: 6,
           width: 10,
           height: 250
       });
       win.add(label);
       win.open();
       
  2. Sharif AbuDarda 2017-06-21

    Hello, can you share a full reproducible code?
  3. Donald Anderson 2017-06-22

    var win = Ti.UI.createWindow({ title: 'Window', backgroundColor: '#fff' }); var view = Ti.UI.createView({}); var label = Ti.UI.createLabel({ text:"Revision: Seventeen", font: { fontSize: 13, fontFamily: "OpenSans" }, color: "#262626", height: 22, top: 50, left: 50, width: 90, height: 22, wordWrap: false, ellipsize: Ti.UI.TEXT_ELLIPSIZE_TRUNCATE_END, backgroundColor:"#bbb" }); var label2 = Ti.UI.createLabel({ text:"Revision: Seventeen", font: { fontSize: 13, fontFamily: "OpenSans" }, minimumFontSize: 13, color: "#262626", height: 22, top: 100, left: 50, width: 90, height: 22, wordWrap: false, ellipsize: Ti.UI.TEXT_ELLIPSIZE_TRUNCATE_END, backgroundColor:"#bbb" }); view.add(label); view.add(label2); win.add(view) win.open(); I'm adding two labels here, one with a minimum font size set and one without. If you run this on an iOS device you should see the first label ellipsizes before the end of the label, adding a minimum font size works around this. If you build this on android however you should see the font size of the second label has increased.

JSON Source