{ "id": "159066", "key": "TIMOB-23114", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "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": [], "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2017-08-13T19:19:31.000+0000", "created": "2016-03-26T05:09:25.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "breaking-change", "bug", "fontweight", "suggestion" ], "versions": [ { "id": "16997", "name": "Release 5.2.0", "archived": false, "released": true, "releaseDate": "2016-02-23" } ], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2018-08-06T17:41:12.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h3. I'm using the latest SDK but this issue has been there since the release of San Francisco font.\nFirst of all, the semibold weight doesn't work, it renders a normal (regular) font (I think it would be a good idea for Titanium to support more weights, this is very limited for people who care a lot about UI)\n\nSecond thing, the system font on iOS (San francisco) is a dynamic font, it uses custom tracking for different font sizes, this is also not working, the tracking is always 0.\nEven when I try to embed the font and use it as a custom font, all font weights work but none of the tracking is applied which causes a not so good font display. \n\nI don't know if this helps, but if you want to see the difference between properly rendered fonts and wrongly rendered ones, you can try using any constant of the textStyle, they render perfectly well.\n", "attachment": [ { "id": "58736", "filename": "Simulator Screen Shot Mar 26, 2016, 6.58.03 AM.png", "author": { "name": "khalilsarabey", "key": "khalilsarabey", "displayName": "Khalil Sarabey", "active": true, "timeZone": "Asia/Beirut" }, "created": "2016-03-26T05:09:28.000+0000", "size": 41383, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS: Fonts issues on iOS 9", "creator": { "name": "khalilsarabey", "key": "khalilsarabey", "displayName": "Khalil Sarabey", "active": true, "timeZone": "Asia/Beirut" }, "subtasks": [], "reporter": { "name": "khalilsarabey", "key": "khalilsarabey", "displayName": "Khalil Sarabey", "active": true, "timeZone": "Asia/Beirut" }, "environment": null, "comment": { "comments": [ { "id": "380732", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hey there! So did this work on 5.1.2.GA (earlier versions)? Just want to troubleshoot as much as possible before further investigations.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-03-26T09:40:25.000+0000", "updated": "2016-03-26T09:40:25.000+0000" }, { "id": "380734", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "The issue is valid. Our current font proxy does not support semibold, light, black etc fontWeights. iOS 8.2 introduced the following constants:\r\n{code:objc}\r\nUIKIT_EXTERN const CGFloat UIFontWeightUltraLight NS_AVAILABLE_IOS(8_2);\r\nUIKIT_EXTERN const CGFloat UIFontWeightThin NS_AVAILABLE_IOS(8_2);\r\nUIKIT_EXTERN const CGFloat UIFontWeightLight NS_AVAILABLE_IOS(8_2);\r\nUIKIT_EXTERN const CGFloat UIFontWeightRegular NS_AVAILABLE_IOS(8_2);\r\nUIKIT_EXTERN const CGFloat UIFontWeightMedium NS_AVAILABLE_IOS(8_2);\r\nUIKIT_EXTERN const CGFloat UIFontWeightSemibold NS_AVAILABLE_IOS(8_2);\r\nUIKIT_EXTERN const CGFloat UIFontWeightBold NS_AVAILABLE_IOS(8_2);\r\nUIKIT_EXTERN const CGFloat UIFontWeightHeavy NS_AVAILABLE_IOS(8_2);\r\nUIKIT_EXTERN const CGFloat UIFontWeightBlack NS_AVAILABLE_IOS(8_2);\r\n{code}\r\n\r\nWe should replace the current WebFont implementation (which is responsible for setting all font-specifications) with a newer, generic solution that used the above constants to determine the font-weight. But since that is a major task and the above API's are only available in iOS 8.2 and later and we still support iOS 7, this task needs to be shifted to at least the next major release, when we decide to increase the minimum iOS version to iOS 8.x.\r\n\r\nDemo code:\r\n{code:javascript}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor : \"#fff\",\r\n layout: \"vertical\"\r\n});\r\nvar label1 = Ti.UI.createLabel({\r\n text : \"This is a normal font\",\r\n top: 50,\r\n left: 50,\r\n font: {\r\n fontSize: 15\r\n }\r\n});\r\nvar label2 = Ti.UI.createLabel({\r\n text : \"This is a semibold font\",\r\n left: 50,\r\n font: {\r\n fontWeight: \"semibold\",\r\n fontSize: 15\r\n },\r\n top: 10,\r\n});\r\nvar label3 = Ti.UI.createLabel({\r\n text : \"This is a bold font\",\r\n left: 50,\r\n font: {\r\n fontWeight: \"bold\",\r\n fontSize: 15\r\n },\r\n top: 10\r\n});\r\n\r\nwin.add([label1,label2,label3]);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-03-26T10:28:14.000+0000", "updated": "2016-03-26T10:28:14.000+0000" }, { "id": "380739", "author": { "name": "khalilsarabey", "key": "khalilsarabey", "displayName": "Khalil Sarabey", "active": true, "timeZone": "Asia/Beirut" }, "body": "Hey Hans ! \r\nThe issue is valid on 5.1.2.GA also, actually it's valid with all SDKs that supported iOS9.\r\nSo in that case the solution would be to use the default textStyle or maybe create a module to solve this issue? I'm thinking hyperloop to use the native UIFont and UILabel, but I still haven't tried hyperloop and I have no idea how it works! \r\nThanks for your reply and help!", "updateAuthor": { "name": "khalilsarabey", "key": "khalilsarabey", "displayName": "Khalil Sarabey", "active": true, "timeZone": "Asia/Beirut" }, "created": "2016-03-26T23:28:31.000+0000", "updated": "2016-03-26T23:32:30.000+0000" }, { "id": "380740", "author": { "name": "khalilsarabey", "key": "khalilsarabey", "displayName": "Khalil Sarabey", "active": true, "timeZone": "Asia/Beirut" }, "body": "By the way, apple stopped supporting iOS 7 in 2014, I don't think you guys should worry about or support it anymore... Just a thought :) ", "updateAuthor": { "name": "khalilsarabey", "key": "khalilsarabey", "displayName": "Khalil Sarabey", "active": true, "timeZone": "Asia/Beirut" }, "created": "2016-03-26T23:36:03.000+0000", "updated": "2016-03-26T23:36:03.000+0000" }, { "id": "380744", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hey [~khalilsarabey], thanks for your thoughts! I will take a closer look on this. And as you may know, changing a minimum SDK version is always a struggle, because people have their targets which they don't want to change. But I'm with you, changing the version would ease a lot of stuff.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-03-27T10:31:44.000+0000", "updated": "2016-03-27T10:31:44.000+0000" }, { "id": "419251", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hey [~khalilsarabey]! Coming back to this issue, I found a way to fix the {{semibold}} values, as well as using the correct weight for {{bold}} font-weights (see [this example|https://abload.de/img/simulatorscreenshot070tswd.png] on how it looks). Are you ok with that change? Than I would push the PR for it asap. Thank you!\r\n\r\nP.S.: Additionally, we could likely support the following as well (iOS-only, not sure about Android parity):\r\n* thin\r\n* light\r\n* ultralight\r\n* medium\r\n* heavy\r\n* black\r\n\r\nWould this help?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-05-07T14:52:39.000+0000", "updated": "2017-05-07T14:54:04.000+0000" }, { "id": "426354", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hey [~khalilsarabey], not sure if you are still following this issue, but I want to resolve this this week. I fixed the semi-bold font already (by using the {{UIFontWeightSemibold}} constants), and I am also looking into the other font-weights described above that should be very straight forward to add. \r\n\r\nOne thing I am unsure to scope right now is the font-tracking change. We currently create most of the fonts using the {{fontWithName}} constructor of the {{UIFont}}, which leads to the exact problems you brought up (it does not ave dynamic font-tracking or it possible to change the font based on the font-size). This is a known problem and Apple recommends to not use that constructor when dealing with system-fonts (see discussion [here|https://stackoverflow.com/questions/32426341/using-the-fontwithsize-api-with-san-francisco]). So we will try to migrate all system-fonts to a proper constructor-call to be more future save. \r\n\r\nWould you agree on those points? I would like to prevent starting effort on something that is meant to be implemented differently. Thank you!\r\n\r\n*EDIT*: Seems like when you are not passing any special/non-system font-family, the system-font tracking is applied correctly. A prior fix we did for 6.2.0 will also fix some font-size issues with bold fonts that made them deferring from the size of default fonts. If you can, please try the below PR and give feedback about your thoughts, appreciate it!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-08-09T18:05:10.000+0000", "updated": "2017-08-09T18:11:50.000+0000" }, { "id": "426356", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/9294\r\nPR (6_2_X): https://github.com/appcelerator/titanium_mobile/pull/9300\r\n\r\nTest-Case: \r\n{code:js}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor : \"#fff\",\r\n layout: \"vertical\"\r\n});\r\nvar label1 = Ti.UI.createLabel({\r\n text : \"This is a normal font\",\r\n top: 50,\r\n left: 50,\r\n font: {\r\n fontSize: 15\r\n }\r\n});\r\nvar label2 = Ti.UI.createLabel({\r\n text : \"This is a semibold font\",\r\n left: 50,\r\n font: {\r\n fontWeight: \"semibold\",\r\n fontSize: 15\r\n },\r\n top: 10,\r\n});\r\nvar label3 = Ti.UI.createLabel({\r\n text : \"This is a bold font\",\r\n left: 50,\r\n font: {\r\n fontWeight: \"bold\",\r\n fontSize: 15\r\n },\r\n top: 10\r\n});\r\n \r\nwin.add([label1,label2,label3]);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-08-09T18:09:33.000+0000", "updated": "2017-08-10T15:42:56.000+0000" }, { "id": "426391", "author": { "name": "khalilsarabey", "key": "khalilsarabey", "displayName": "Khalil Sarabey", "active": true, "timeZone": "Asia/Beirut" }, "body": "Hello Hans!\r\nThanks for the follow up, you're absolutely right, I noticed the tracking issue also when building native apps, I don't know why they do this it makes no sense, and at the same time they give you a tracking table to do it manually.\r\nBut in all cases, I think have the font weights available in Titanium would be great!\r\nThanks again! ", "updateAuthor": { "name": "khalilsarabey", "key": "khalilsarabey", "displayName": "Khalil Sarabey", "active": true, "timeZone": "Asia/Beirut" }, "created": "2017-08-09T22:49:09.000+0000", "updated": "2017-08-09T22:49:09.000+0000" }, { "id": "426529", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hey Khalil,\r\n\r\nthe PR's are up! But we noticed during code-review that the new constructors are requiring iOS 8.2, but we have a minimum SDK of 8.0, which makes it a (tiny but still) breaking change. Long story short, to not break any existing backwards compatibility, it has to go into Titanium SDK 7.0.0 (scheduled for this November). But in case you want to use it before, you can simply add the code-changes of the PR to your local source (patch it) and benefit from it today. I hope that helps, thank you!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-08-11T09:18:22.000+0000", "updated": "2017-08-11T09:18:22.000+0000" }, { "id": "426588", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Will do it in 6.2.0, together with thin, light and ultra-light! Will also rewrite the logic behind it in 7.0.0 to also allow heavy, medium and black.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-08-13T19:19:31.000+0000", "updated": "2017-08-13T19:19:31.000+0000" }, { "id": "440019", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing as a duplicate. If this is in error, please reopen.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-06T17:41:12.000+0000", "updated": "2018-08-06T17:41:12.000+0000" } ], "maxResults": 14, "total": 14, "startAt": 0 } } }