i am trying to include a custom font into my project but i just cannot appear to do that. I was able to do it in my pervious projects without a problem.
First of all, when i include a font in to xCode project it appears like this:
I have tried alots of things, and I know the guidelines when adding a new font,I have read a lot of articles like this (Common Mistakes With Adding Custom Fonts to Your iOS App) and done that several times with success, but now it just wont work.
Fonts are included in the project, they are in copy bundle resources and in the .plist file.
Also I have tried cleaning the project, deleting derivated data, I actually created the whole project from scratch, with no success...
xCode version is 6.4
Font in question is Roboto but i couldn't include any other.
Font type is .ttf but i have tried with .otf also.
Any help here?
Does your project name have any special characters in the name? That can cause problems. E.g. question marks...
Related
The given version is described here: How do I rename a project in Xcode 5?
But, as you can see from the following screenshot^, not everything gets renamed, and if one opens package contents, directory names etc. to try to manually change all the references, the project is broken afterwards, so you have to keep the old project name for sub directories etc., which granted is not a massive problem, but is intensely irritating, and I'm not enjoying being intensely irritated at work.
^ apologies for a screenshot, but there's too much information in it to transcribe to written text. Top two-thirds of screenshot is XCode project, bottom third a Finder window.
Renaming projects in xcode in one of the most annoying things in iOS development. I assume you want to rename your app. I faced this problem once and figured out a simple, clean way to do it.
Go back to the point where everything worked.
Open project in xcode and click on the project icon in the project structure( first file)
Go to the info tab
Search for Bundle Name. Most probably it will automatically be set to $(PRODUCT_NAME) which is a shell variable that will set your app name the same as the project name.
Set it to whatever you want your app name to be
Done
Notes :
If you use custom URL Schemes this might produce an error when redirecting.
ALWAYS git or some other SVN in your projects. This will come in handy in this kind of situations
I'm trying to add a downloaded font to Xcode and I've folowed every single step based on this link: http://codewithchris.com/common-mistakes-with-adding-custom-fonts-to-your-ios-app/
I added the font to my Xcode Project,
included it in Copy Bundle Resources (Build Phases),
and typed it in Fonts Provided by Application (in Info.plist).
Then I typed this in GameScene.swift inside didMoveToView
It has worked with other fonts but not with this one. This is really frustrating me and I've got no idea what the problem is, thanks.
The name of the font is not always the name of the file. Try looking for the file and then opening in. It should automatically pull it up in font book, and the name of the font is located on the top bar. Simply enter that instead of the file name and it should work.
I am attempting to make a TTF font file available to my main application and also in my photo editing extension. But the font isn't found when I attempt to access it by name in the extension, although it works in the main app.
I've selected the TTF file and in the File inspector I've checked AppName and AppNameExtension to add them both targets. I ensured the font shows up in Extension > Build Phase > Copy Bundle Resources. The font name and extension exists as the first index of an array for the “Fonts provided by application” in the extension's Info.plist. And I am calling it in code by its proper name. Again, it is working in the main app but not the extension.
Did I do something wrong in order for that resource to be available in the extension, is this not possible in the extension, or is this a bug I should report?
It seems you have everything correct and it is possible I had some issues trying to get it to work as well but it turned out I had thoughtlessly selected the font I wanted to use in Interface Builder before I created the "new" font for the extension and it seemed to be trying to reference the font in the container app, I removed that reference and set it programmatically.
You have to be a little more careful debugging with iOS extensions as Xcode doesn't seem to be as "helpful" as it is in the container app in regards to debugging messages, at least in my opinion currently.
I'm starting to get confused..I've wanted to finally add my translation file for all strings to my app according to ray wenderlich's tutorial. But somehow now everything got messed up. I removed now every localization again, which deleted my strings file, the storyboard etc. And now I have no localization language set in the project settings and I've copied all files back from the trash.
But my localized string (NSLocalizedString(..)) somehow don't load..or load something else. I've changed some of them to check if my strings file in the project explorer is actually used but it still uses the old strings and I have no idea from where..I've checked the project folder and there aren't any other files.
How can I set up everything again that it works? How can I set the strings file it should use? And how should I set up then the localization, with or without base language?
Edit: And in the simulator I cannot get my app running..it's showing only a black screen. Whereas on my iphone it still works (if I use my iphone from Xcode).
I guess I've deleted all my languages in project settings and now I cannot add any localization anymore :-(
Here's what I would try:
Check your project folder for any leftover .lproj folders / .strings file and delete
Clean / Build
Start localization from scratch following SmoothLocalize's Tutorial
This should delete all old files and create a new default localizable.strings, and then you can add more languages.
I'm starting to studying app localizations and I'm stuck at the very beginning.. I've created a new project called LocalizedStrings2:
I click the plus button to add Italian Language and it offers me to localize 2 InfoPlist.strings files:
Is this correct? BTW, I add the italian language:
Then I've wrote the following code in the English InfoPlist.strings file:
"ERR_MSG" = "Error Message!"
The following line has been entered in the Italian version of the file:
"ERR_MSG" = "Messaggio d'errore!"
When I compile I receive the following error (I have the same error even if the two files are empty:
Any hint or good reference for up-to-date How To Localize my IOS App documentation?
Thanks in advance for any help!
Gianni
I was facing the same problem for many days. Then I figured it out…
Just put a ; at the end of the line and it's fixed! :D
Recommendation
I don't think you should have two English references to your file in the UI. Change one to italian and verify that the files are in the proper location in your finder folder.
I would then consider removing the file references from the project and re-add them. I've noticed some peculiar behaviors when using localization for older versions of the SDK in Xcode 5+. BTW - If you are planning to support a deployment target of iOS5 you will need to remove the Base localization setting and just create the localization folders manually (inside the project folder in Finder). After you re-add the files I would check the Build Phases > Copy Bundle Resources > search for plist to verify that ProjectName/(localization).lproj is found.
NOTE
Please check out the updated documentation and let me know if that is a sufficient answer.
Internationalizing Your App
I guess the second InfoPlist.strings file derives trom your tests.
Check out the "Supporting Files-Folder" in your apps test target.