{ "id": "62250", "key": "TIMOB-1618", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "17608", "name": "Release 6.1.0", "archived": false, "released": true, "releaseDate": "2017-05-26" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-01-27T23:46:09.000+0000", "created": "2011-04-15T02:57:29.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "parity", "tbs-1.8.2" ], "versions": [], "issuelinks": [ { "id": "55171", "type": { "id": "10122", "name": "Gantt: start-finish", "inward": "is triggered by", "outward": "is triggering" }, "outwardIssue": { "id": "168318", "key": "TIMOB-24801", "fields": { "summary": "Android: Ti.UI.Label.minimumFontSize property changes size randomly", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } }, { "id": "53916", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "165266", "key": "TIMOB-24298", "fields": { "summary": "Android: Expose Ti.UI.TextField.minimumFontSize (Parity)", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } }, { "id": "14296", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "84076", "key": "TIDOC-33", "fields": { "summary": "APIDOC: mark UI label property minimumFontSize is iOS-only", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Low", "id": "4" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2017-06-09T14:36:31.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "{html}
\nhttps://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI...\nlists in properties:
\n\nminimumFontSize int\n\nthe minimum size of the font when the font is sized\nbased on the contents. Enables font scaling to fit\nand forces the label content to be limited to a single line
\n
\nThis is extremely useful, however it appears to only be\nimplemented on iOS; the property is never even checked in the\nAndroid code.
Assigning tickets affecting StatusNet to our support contact per\nrequest.
\nWe have worked around this for the moment using a hack scaling\nbased on string length, but this obviously won't be very exact and\ncould fail due to variable font metrics, etc.
\nBug on StatusNet side: http://status.net/open-source/issues/2592
Agreed that it's not a super crucial issue, but I'm using\nminimumFontSize for at least 20 labels that can have variable text.\nI did the hack as well on the 2 or 3 most important ones, but it's\ndefinitely a huge time and effort (and bug) saver to have it.
Brian: does you hack take in a font size and label width and\ncalculate the scaled font size from that? if so, would you mind\nsharing the code? I've developed one of my own but yours is\nprobably much better.
My hack's been pretty manual, scaling the font size down based\non the character length of the label beyond a hand-estimated\n'maximum chars that should fit'. :) As with yours, I only did it on\none or two high-priority labels.
\nA proper implementation should be using font metrics by asking\nthe system how big that chunk of text would be rendered at a given\nfont size, then keep bumping the size down until it fits in the\navailable space. That could possibly be done by bumping around the\nsize of a transparent or hidden label, but that's probably slower\nand nastier than having the Java-side code do it.
Sounds good. Mine's about the same (I estimate the text width\nbased on a pixel length of an average character for that fontSize\nand fontWeight (bold or regular)...then scale from\nthat...definitely a kludge. :)