-
Notifications
You must be signed in to change notification settings - Fork 12.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot select font weight in XCode Storyboards #13557
Comments
Hi! Thanks for being part of the Font Awesome Community. I think this could be an issue on our side. Maybe it's the same as #13320 PS: make sure you are using the |
Hello @tagliala As you can see from the Info.plist screendump, I am using the .otf files :) I can fix it by manually editing the XML in Storyboards, but it's kind of tedious. |
I've been experiencing the same issue. I look forward to learning of any solutions. |
I'm thinking that perhaps the problem is the way the fonts are named.
Of all the fonts available to my app in iOS, these are the only fonts I see that do not follow the standard naming convention that includes a dash. For instance:
@tagliala, could this be the problem? Is there a reason why Font Awesome chose to depart from the standard naming convention? thanks, |
Hi @antonjazz thanks for the detailed feedback
it could be. If #13320 doesn't solve this issue, then we may take a look at the naming convention @robmadole is there a reason for the font name? |
@supercodepoet you've messed with XCode and this. Do you have any ideas? |
Any news here? This is very annoying when working with XCode. |
I was excited to see the release of 5.3 (and 5.3.1)! Incidentally, the issue exists with both .ttf and .otf versions. @tagliala, you mentioned to be sure to use .otf. Is there a reason not to use the smaller .ttf files instead? |
ttf is optimized for the web. It should be used only by ancient browsers that don't support For desktop usage, you are supposed to use the .otf file. |
This is not for desktop usage; it's for use in an iOS app. Apple gives the option of ttf or otf in iOS and since I don't need any otf features, I thought using ttf would reduce the app's footprint. |
@anton I think he means that web is optimised for speed where downloading the font on each visit plays a role. It doesn’t on iOS, as the number of bytes you have to download extra when downloading the app from App Store is irrelevant.
On 29 Aug 2018, at 23.04, Anton Schwartz <notifications@github.com<mailto:notifications@github.com>> wrote:
For desktop usage, you are supposed to use the .otf file.
This is not for desktop usage; it's for use in an iOS app. Apple gives the option of ttf or otf in iOS and since I don't need any otf features, I thought using ttf would reduce the app's footprint.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#13557 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AIBYsu3nNh4PcNZxueg4t4_gvlFscEfhks5uVwHGgaJpZM4VR99B>.
|
@nickdnk Yes, that's correct. Does Font Awesome 5.3 fix this issue for you?
@antonjazz but you need a proper font-name. Apparently, the I personally think that in the future we could provide better font files for iOS applications (maybe .otf without ligatures) but we should not encourage the use of @robmadole any thoughts? |
Thanks. I just like the ttf files because together they're less than a third the size of the otf fonts. I always like to make my app small - quick to download/update and respectful of the user's memory. Not a big deal either way; I just won't use .otf unless there's a reason for me to.
For me, in 5.3 both .ttf and .otf versions show up in iOS named the same way, unchanged from 5.2:
whereas standard iOS convention would have them named like other fonts:
It would seem that the reason Xcode continues to name all three fonts "Regular" is that it considers any font name without a hyphen to be the Regular face. This is borne out by all the other iOS fonts I see listed. If Xcode sees a hyphen in the name, it uses the text following the hyphen in place of "Regular". |
@tagliala What feedback are you waiting for here (noticing the label)? It seems the obvious solution is to rename the font files. It's not fixed in the newest version because the font names remain the same. I just tested 5.6. |
@nickdnk "waiting for feedback" is a generic label, I'm using it also when we are waiting for internal feedback. Anyway, this should be fixed in the upcoming 5.7.0 release. Could you please a look at #13900 (comment) ? |
Fantastic, @tagliala - looking forward! |
@tagliala Great :) |
@nickdnk do you think that change will solve this issue? |
@tagliala If only the .ttf files (which I don't use for desktop) are modified, then no. I can't really decipher from the other thread if that's the case. I'm not expert on this, so I can't really say for sure. |
@nickdnk let's wait for 5.7.0 release and see what happens |
@nickdnk Font Awesome 5.7.0 has been just released. Could you please take a look? |
It has been fixed with regards to selecting the correct font. It now gives the option between Light, Regular and Solid instead of 3x Regular. However, it's not a drop-in replacement. As we know, the fonts used to be called:
but are now instead called
So now your storyboards and .xib files reference the wrong font. This was somewhat expected, but causes more trouble than I had anticipated. Obviously every icon now has a question mark instead of the icon, and if you try to manually salvage the situation, your XML files will go from this:
to this:
Which does not look promising. XCode crashed several times for me when I tried to fix this, so what I ended up doing was a git revert so every file was unchanged, then I replaced the font files (the file names have not changed, so no trouble there with Info.plist or anything) and did a search/replace in the root of my project for
Which finds this string in a lot of places. After I opened XCode I still had question marks, but when running the app everything looked good. I did a clean/build and restarted XCode again, and now I have my icons back - and I can select the weight correctly now. So, procedure:
And obviously you'll also replace any reference to the fonts used in code with the above search/replace, as you should. |
@nickdnk thanks for the feedback and for the step-by-step guide to fix this |
Closing here, but feel free to comment if the original issue has not been fixed and I will reopen |
@tagliala Sure, but you should probably include this explanation in your 5.7.0 release notes and warn people that they cannot seamlessly upgrade if using the icons in XCode. I suppose Android Studio will suffer from similar problems. Your changelog states that it's been fixed for TTF files, but this change affects OTF files as well. |
Sure, we did that https://github.com/FortAwesome/Font-Awesome/blob/master/UPGRADING.md#otf-and-ttf-files |
@tagliala Okay great :) |
Hello
I cannot select font weight in iOS. I am using the latest version of FontAwesome. In XCode I get only the ability to choose the font type, but all three weights just state "Regular". If I toggle between the 3 regulars I can sometimes get it to select either light or solid, but it's very inconsistent.
I did add the fonts correctly - also to Info.plist - and they do work if I set the font directly in code, but it keeps bugging out in storyboards.
Please see attached screenshots. I can only select either Font Awesome 5 Brands or Font Awesome 5 Pro from the font selector. I am not sure if this is a bug with FA or with XCode, but something indicates that XCode gets confused about the available weights.
Fonts:
https://image.ibb.co/bVG5By/Screen_Shot_2018_07_17_at_01_54_19.png
Weights:
https://image.ibb.co/mc5tyd/Screen_Shot_2018_07_17_at_01_49_07.png
Info.plist
https://image.ibb.co/nNRiyd/Screen_Shot_2018_07_17_at_01_52_24.png
The text was updated successfully, but these errors were encountered: