{ "id": "126752", "key": "AC-2515", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "6", "description": "", "name": "Hold" }, "resolutiondate": "2014-02-25T18:19:25.000+0000", "created": "2014-02-23T19:45:34.000+0000", "labels": [ "custom", "fonts", "ios", "navigationbar", "toolbar" ], "versions": [], "issuelinks": [], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:41:34.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "A navigation bars {{leftNavButton}}, {{titleControl}} and {{rightNavButton}} as well as {{Toolbar}} {{items}} don't support custom fonts, as demonstrated with the following code, attached custom font and screenshot. A label on the same positions works fine as well as a button used anywhere else.\r\n\r\n{code}\r\nfunction create(button, custom) {\r\n var fn = button ? 'createButton' : 'createLabel';\r\n var args = custom ? {\r\n font: {\r\n fontFamily: 'FontAwesome'\r\n }\r\n } : {};\r\n args[button ? 'title' : 'text'] = custom ? \"\\uf025\" : 'Hello';\r\n return Ti.UI[fn](args);\r\n}\r\n\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: 'white',\r\n leftNavButton: create(true, true),\r\n rightNavButton: create(false, true)\r\n});\r\n\r\nwin.add(create(true, true));\r\n\r\nwin.add(Ti.UI.iOS.createToolbar({\r\n items: [\r\n create(true, true),\r\n Ti.UI.createButton({\r\n systemButton: Titanium.UI.iPhone.SystemButton.FLEXIBLE_SPACE\r\n }),\r\n create(false, true)\r\n ],\r\n bottom: 0\r\n}));\r\n\r\nvar navwin = Ti.UI.iOS.createNavigationWindow({\r\n window: win\r\n});\r\n\r\nnavwin.open();\r\n{code}\r\n\r\nCustom icon fonts in particular would be awesome in navigation bars and toolbars an I see no reason why this couldn't be done.", "attachment": [ { "id": "46140", "filename": "FontAwesome.otf", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2014-02-23T19:45:34.000+0000", "size": 62856, "mimeType": "application/octet-stream" }, { "id": "46142", "filename": "iOS-simulatorschermafbeelding 24 feb. 2014 08.17.23.png", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2014-02-24T07:17:27.000+0000", "size": 23422, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS: Buttons in NavigationBar and Toolbar don't support custom fonts", "creator": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "SDK 3.2.1.GA", "comment": { "comments": [ { "id": "294613", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "@[~fokke]\r\nThe Ti.UI.Button class does support custom fonts. However when being used in a toolbar or navbar, it also has to support a bunch of other properties (Essentially the Ti.UI.Button end point is supporting 2 native UI elements, UIBarButtonItem and UIButton).\r\nThe code is a little dirty. The easiest way for you to get what you want when not creating system buttons is to wrap the button in a view. Sample Code below\r\n\r\n{code}\r\nfunction getBarButtonItem(){\r\n var button = Ti.UI.createButton({\r\n \tstyle:0,//Define of type custom so that no rounded rect is shown on iOS6\r\n \tcolor:'blue',selectedColor:'aqua', //Set up color and highlighted color since it is custom button\r\n \tfont:{fontFamily:'FontAwesome'},\r\n \ttitle:'\\uf025'\r\n });\r\n //Wrap the button in a view\r\n var wrap = Ti.UI.createView({width:Ti.UI.SIZE,height:Ti.UI.SIZE});\r\n wrap.add(button);\r\n \r\n //Create UIBarButtonItem from the customView\r\n return wrap;\r\n}\r\n\r\n{code}\r\n", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-02-25T18:17:44.000+0000", "updated": "2014-02-25T18:18:53.000+0000" }, { "id": "294615", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Workaround in comments above", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-02-25T18:19:25.000+0000", "updated": "2014-02-25T18:19:44.000+0000" }, { "id": "294783", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "[~vduggal] I know {{Ti.UI.Button}} supports custom fonts everywhere except in toolbars or navbar and I am aware of workarounds.\n\nYou're saying it is technically impossible to bring support of custom fonts to buttons in toolbars and navbars without using such a workaround?", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2014-02-26T14:46:44.000+0000", "updated": "2014-02-26T14:46:44.000+0000" }, { "id": "294863", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~fokke]\nNo not impossible. Just unlikely to get done in any timely fashion since there is a simple JS wokaround. \nIdeally what you would want to do it expose the UIBarButtonItem as a separate proxy and link that up to navigation bars and toolbars instead of trying trying to manage multiple UI elements through a single button proxy.\nI marked it as hold so that we can keep this in mind when we next have the bandwidth to do a little housecleaning.", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-02-26T23:07:02.000+0000", "updated": "2014-02-26T23:07:02.000+0000" }, { "id": "318155", "author": { "name": "kip", "key": "kip", "displayName": "Kip Holcomb", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I ran into this problem today when I wasn't able to match the font in a NavigationWindow's left navbar button. The workaround of wrapping the button in its own View works for me, but I wish this issue was open, since a workaround isn't a fix.", "updateAuthor": { "name": "kip", "key": "kip", "displayName": "Kip Holcomb", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-08-12T06:53:25.000+0000", "updated": "2014-08-12T06:53:25.000+0000" }, { "id": "318188", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Vishal, I agree with Kip that a workaround is not a solution. If it is possible in iOS nayive then it should be in Titanium. Icon fonts are becoming the default for apps just like web as new densities keep being added (@3x or 4x in October!).\r\n\r\nPlease reopen or at least close as \"Won't fix\" [~Ingo]", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2014-08-12T14:20:27.000+0000", "updated": "2014-08-12T14:20:27.000+0000" }, { "id": "318972", "author": { "name": "bcproductions", "key": "bcproductions", "displayName": "Ed", "active": true, "timeZone": "America/Havana" }, "body": "I too would like to have this feature request re-considered. I would like to use fontAwesome for some custom nav bar buttons, and while there's a workaround, a fix would be better. Thanks in advance for considering this.", "updateAuthor": { "name": "bcproductions", "key": "bcproductions", "displayName": "Ed", "active": true, "timeZone": "America/Havana" }, "created": "2014-08-16T01:25:39.000+0000", "updated": "2014-08-16T01:25:39.000+0000" }, { "id": "337265", "author": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "body": "+1 for reopening and fixing", "updateAuthor": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "created": "2014-12-21T21:06:51.000+0000", "updated": "2014-12-21T21:06:51.000+0000" }, { "id": "337728", "author": { "name": "yomybaby", "key": "yomybaby", "displayName": "Jong Eun Lee", "active": true, "timeZone": "Asia/Tokyo" }, "body": "It reproduced again on 3.4.1.GA.\r\nPlease fix it again :)", "updateAuthor": { "name": "yomybaby", "key": "yomybaby", "displayName": "Jong Eun Lee", "active": true, "timeZone": "Asia/Tokyo" }, "created": "2015-01-01T09:43:48.000+0000", "updated": "2015-01-01T09:43:48.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }