Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-690] add support for adjustsFontSizeToFitWidth to text field

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:53:56.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.3.0
ComponentsiOS
Labelsn/a
ReporterNolan Wright
AssigneeBlain Hamon
Created2011-04-15T02:34:33.000+0000
Updated2011-04-17T01:53:56.000+0000

Description

i wonder if this is really just fontSize:'auto' for us on the JS API side

from premium support ticket
http://helpdesk.appcelerator.net/tickets/1743">http://helpdesk.appcelerator.net/tickets/1743

Comments

  1. Stephen Tramer 2011-04-15

    Will implement as 'fontSize:auto' but this could be misleading under some circumstances (for example, I have no idea if table row views would resize their fonts).

  2. Stephen Tramer 2011-04-15

    Actually, brief correction. Because fonts should always have a default size (in order to calculate the bounding box/truncation/etc.) this will be implemented on a font object as an 'allowsResizing' property.

    Another alternative is to use a 'defaultSize' parameter and have 'fontSize' be 'auto'.

  3. Jeff Haynie 2011-04-15

    (from [8038bc589a4158e7be132efccdc6e7d8f8155621]) Closes #690: TiUILabel and TiUITextField now support 'minimumFontSize'. See ticket for caveats. http://github.com/appcelerator/titanium_mobile/commit/8038bc589a4158e7be132efccdc6e7d8f8155621"> http://github.com/appcelerator/titanium_mobile/commit/8038bc589a415...

  4. Stephen Tramer 2011-04-15

    As always, caveats...

    • Setting minimumFontSize: on a label forces it to fill exactly one line. This is due to a bug in Apple's UILabel code; we can do nothing about it. So it's recommended that this be used judiciously.

    • Setting minimumFontSize: and then revoking it by setting minimumFontSize = 0 does NOT automagically resize text to its initial size. The font size may, however, be reset by the user. We don't do this for them since it should be assumed that if text was autoadjusted to fit in its bounds, they don't want to size it larger so it suddenly goes out of them again.

JSON Source