{ "id": "64050", "key": "TIMOB-3418", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": "11244", "name": "Release 1.7.0", "archived": true, "released": true, "releaseDate": "2011-06-13" }, { "id": "11248", "name": "Sprint 2011-13", "archived": true, "released": true, "releaseDate": "2011-04-04" }, { "id": "11260", "description": "", "name": "Release 1.6.2", "archived": true, "released": true, "releaseDate": "2011-04-20" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-05-16T10:54:39.000+0000", "created": "2011-04-15T03:44:50.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "custom", "enterprise", "feature", "font", "fontfamily", "klist", "release-1.6.2", "release-1.7.0", "reported-1.6.1", "rplist" ], "versions": [], "issuelinks": [], "assignee": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-05-16T10:54:39.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}

Feature Request

\n

Support for Custom Fonts on Android Devices.

{html}", "attachment": [ { "id": "18316", "filename": "chantelli-antiqua.zip", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:44:50.000+0000", "size": 12903, "mimeType": "application/zip" }, { "id": "18317", "filename": "screenshot.png", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:44:50.000+0000", "size": 30788, "mimeType": "image/png" } ], "flagged": false, "summary": "Custom Font support on Android", "creator": { "name": "aleard", "key": "aleard", "displayName": "Alan Leard", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "aleard", "key": "aleard", "displayName": "Alan Leard", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "130667", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Needs to go on 1.6.2 as well.

{html}", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:44:52.000+0000", "updated": "2011-04-15T03:44:52.000+0000" }, { "id": "130668", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

(from [d06a815b13625e60d5f43f717420af9ab2308db6])\nSupport custom fonts loaded in assets/fonts. [#3418]\n\nhttps://github.com/appcelerator/titanium_mobile/commit/d06a815b1362...

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:44:52.000+0000", "updated": "2011-04-15T03:44:52.000+0000" }, { "id": "130669", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

(from [89670092e070d0c67f04300becd3b18285b3753a])\nMove the default font file location to Resources/fonts so as to\ntake advantage of our built-in builder.py file\ndelta/deletion/addition checking. [#3418]\n\nhttps://github.com/appcelerator/titanium_mobile/commit/89670092e070...

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:44:52.000+0000", "updated": "2011-04-15T03:44:52.000+0000" }, { "id": "130670", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

To use this, put your custom (third-party) font files in\nResources/fonts (or\nResources/android/fonts if you prefer ... both will be\nhandled). Then when setting the font property of the\nview (Label, TextField, etc.), set the fontFamily\nmember to the base filename of the font file (i.e., the file name\nwithout the extension).

\n

EXAMPLE (to be used for QE testing as\nwell):

\n\n
\nTitanium.UI.setBackgroundColor('#000');\nvar win = Titanium.UI.createWindow({  \n    title:'Test',\n    backgroundColor:'#000',\n    exitOnClose: true,\n    layout: 'vertical'\n});\n\nvar lbl = Ti.UI.createLabel({\n    text: \"Now is the time for all good men to come to the aid of their country\",\n    font: {fontFamily: 'chantelli_antiqua', fontSize: '15dp'},\n    height: 'auto',\n    width: 'auto',\n    top:10,\n    backgroundColor: 'red',\n    color: 'white'\n});\nwin.add(lbl);\n\nvar tf = Ti.UI.createTextField({\n    hintText: \"Type here\",\n    font: {fontFamily: 'Chantelli_antiqua', fontSize: '15dp'},\n    height: 'auto', width: '100%',\n    top: 10\n});\nwin.add(tf);\n\nvar ta = Ti.UI.createTextArea({\n    hintText: \"Type here, mein Freund\",\n    font: {fontFamily: 'Chantelli_antiqua', fontSize: '15dp'},\n    height: '80dp', width: '100%', borderRadius: '5',\n    top: 10\n});\nwin.add(ta);\n\nvar btn = Ti.UI.createButton({\n    font: {fontFamily: 'Chantelli_antiqua', fontSize: '15dp'},\n    title: 'I am a button',\n    height: 'auto', width: 'auto',\n    top: 10\n});\nwin.add(btn);\n\nvar btn2 = Ti.UI.createButton({\n    font: {fontFamily: 'Chantelli_antiqua', fontSize: '15dp', fontWeight: 'bold'},\n    title: 'I am also a button',\n    height: 'auto', width: 'auto',\n    top: 10\n});\nwin.add(btn2);\n\nvar btn3 = Ti.UI.createButton({\n    font: {fontFamily: 'Chantelli_antiqua', fontSize: '25dp', fontWeight: 'bold'},\n    title: 'Ah, but so am I a button',\n    height: 'auto', width: 'auto',\n    top: 10\n});\nwin.add(btn3);\n\nwin.open();\n
\n

Notice in several places we're setting font: {fontFamily:\n'Chantelli_antiqua' ... }. (Case doesn't matter.)

\n

When you run it, you will (or should) notice that the font is\nnot a standard font. See attached screenshot.png.

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:44:53.000+0000", "updated": "2011-04-15T03:44:53.000+0000" }, { "id": "130671", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

(from [0243d42c591e2ec96defa95302597f27fb21af19])\nMove the default font file location to Resources/fonts so as to\ntake advantage of our built-in builder.py file\ndelta/deletion/addition checking. [#3418]\n\nhttps://github.com/appcelerator/titanium_mobile/commit/0243d42c591e...

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:44:53.000+0000", "updated": "2011-04-15T03:44:53.000+0000" }, { "id": "130672", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

(from [9a03aba397daa01ca562a7f82192bf82791cd0c1])\nSupport custom fonts loaded in assets/fonts. [#3418]\n\nhttps://github.com/appcelerator/titanium_mobile/commit/9a03aba397da...

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:44:53.000+0000", "updated": "2011-04-15T03:44:53.000+0000" }, { "id": "130673", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

QE: please test both in master and 1_6_X, as it was specifically\nrequested that this feature be added to 1_6_X

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:44:53.000+0000", "updated": "2011-04-15T03:44:53.000+0000" }, { "id": "130969", "author": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with [INFO] Titanium SDK version: 1.6.2 (04/18/11 17:16 878906d) on \nNexus S 2.3.2\nEmulator 2.1", "updateAuthor": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-18T17:07:23.000+0000", "updated": "2011-04-18T17:07:23.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }