{ "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
\nSupport for Custom Fonts on Android Devices.
Needs to go on 1.6.2 as well.
(from [d06a815b13625e60d5f43f717420af9ab2308db6])\nSupport custom fonts loaded in assets/fonts. [#3418]\n\nhttps://github.com/appcelerator/titanium_mobile/commit/d06a815b1362...
(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...
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).
EXAMPLE (to be used for QE testing as\nwell):
\nCreate a new project.
\nCreate the Resources/fonts
folder in that\nproject.
Download and unzip the attached Chantelli-Antiqua.zip file, and\ncopy Chantelli-Antiqua.ttf into your Resources/fonts
\nfolder.
Use this as your app.js:
\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
\nNotice in several places we're setting font: {fontFamily:\n'Chantelli_antiqua' ... }
. (Case doesn't matter.)
When you run it, you will (or should) notice that the font is\nnot a standard font. See attached screenshot.png.
(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...
(from [9a03aba397daa01ca562a7f82192bf82791cd0c1])\nSupport custom fonts loaded in assets/fonts. [#3418]\n\nhttps://github.com/appcelerator/titanium_mobile/commit/9a03aba397da...
QE: please test both in master and 1_6_X, as it was specifically\nrequested that this feature be added to 1_6_X