Why my custom fonts are being overwritten on iOS? - genexus

I'm trying to use custom fonts in my application. I followed the instructions and everything worked as expected.
The problem is that if I run the application again in Genexus, the custom fonts settings in the xcode's project are overwritten (Android still works).
I tried copy the project from Mac to models folder ("\mobile\iOS\"), but the problem persists.
Any solution?

As stated in the instructions:
As this is donde on the XCode project generated with GeneXus steps 3-5 have to be repeated after each execution from GeneXus.
However, there are a few things you can do to automate the process:
Add the fonts to your knowledge base as files, edit the properties for each of the files, set "Extract" to "Always", and in the "Extract to path" property add the relative path to the generated project's folder. Something like "..\mobile\iOS\main_object_name\iOS\Genexus"
Edit the template file located at "genexus_install_directory\iOS\Templates\iOS_Genexus\MainName-Info.plist", add the custom fonts key
You may also need to edit the project's template file located at "genexus_install_directory\iOS\Templates\iOS_Genexus\MainName.xcodeproj\project.pbxproj" (not sure about that), to add a reference to the fonts files
The best way to know what to add to the files from steps 2. and 3. is to generate the project in GeneXus, make a copy on the Mac before adding the fonts, add the fonts via Xcode as documented, and compare the resulting files with the originals.
A warning, though: the steps 2. and 3. apply to ALL applications generated with that GeneXus install, so you may want to make a copy or at least backup the modified files first.

Related

fonts and xmls not found in Xcode's open framework built product

I want to move my open frameworks project to other machines for testing. but when I try to open a build product (exported via the organizer) the app starts up without the text I set (via ofTrueTypeFont). It also won't load any data from the xmls I use. This also happens if I open the exported product on the same machine.
fonts are loaded like:
in .h
ofTrueTypeFont fontLarge;
in .cpp
fontLarge.loadFont("font.ttf", 35);
fontLarge.drawString("Display that String", 30,30);
I have tried various build phases. copied the .ttfs and .xmls to various directories but the app won't find it.
tried a (/bin)data folder within /App/Contents, /Frameworks, /usr/... every folder that i could imagine in the final product. What am I missing here?
Xcode 4.6 / OS X 10.8.2 / OpenFrameworks 0073
Not sure if it's the best approach but this is how I solved it:
Add to your application setup:
ofSetDataPathRoot("../Resources/data/");
Then add a Copy Files Build Phase to your Target and set the Destination to "Resources" and Subpath to "data". From now on you may drag and drop the files you need into the Build Phase and they will be included.

Custom Font xCode 3.2 is not working

I have done everything you are supposed to do to make a custom font show up in an Xcode project. However, the font comes out Helvetica every time and not Oswald as I hoped. Here you can see the name of the font is in fact, Oswald. I also tried different names - Oswald-Light, Oswald-Regular, Oswald-Bold...
Here you can see that the .ttf files are in fact in my project. They are also in the projects folder in the finder - I checked that.
I put the names of the files in the .plist under Fonts Provided by Application.
And finally I told the label to use Oswald font. Again, I tried #"Oswald-Light",#"Oswald-Bold"...
Solution:
Make sure the ttf files are in the target's Copy Bundle Resources build phase. If they aren't, they won't get copied to the app bundle when you build the project.
Solved by Mark Szymczyk - third comment (just to make it explicit in SO-style that the problem was solved)

want to use Xcode 4 for everything, how to add folder in project navigator?

I'd like to move my web dev editing to Xcode 4 (currently using textmate). I have a couple of simple questions that are clearly a lack of experience on my end.
In Xcode's Project Navigator, how do I add a folder to the shown directory tree? Currently, I add via terminal and do File -> Add Files
Is there any way to tell Xcode to see the file system as the file system and not as references?
a less likely thing:
Is there any way to bring up a console within the context of a folder in project navigator (would like to be able to run grep again small portion or something)?
thx
I can answer the first question. Adding a folder of files to a project is the same as adding individual files. Choose File > Add Files in Xcode. When you add a folder of files to a project, you should see something like the following screenshot:
Create groups if you need to access the files in Xcode, such as adding a folder of source code files. Create folder references if you don't need to access the files in Xcode, such as adding a folder of audio files.
You can also add folders to the project navigator by selecting a file or folder in the project navigator, right-clicking, and choosing New Group.
As far as I know, Xcode won't mirror the filesystem as an Xcode tree (anyone correct me id I'm wrong). Wanting to have an identical structure is quite some work. I use to first place the files hierarchically in the file-system, then I mimic the same structure in Xcode.
This requires some attention since Xcode 4.1 not always writes new classes to the place you told him to - they may prefer to land in the highest level of the Xcode project.
I had similar thoughts and started a thread, might be helpful for further reading
Your second question: sorry, can't help you there.

Why can't I delete files from my XCode project?

This is probably a very easy question, but I'm having trouble deleting resources from my XCode project. I added them using "Create Folder References for any added folders" so that I could import a whole offline HTML site with its correct folder structure.
Unfortunately, now it has been added like this I don't seem to be able to delete individual files in the structure (it's not available from the Edit menu).
Can anyone help please? Thanks!
That isn't how folder references work. The idea is that its only a reference, you can open files within it and save it from those editors, you can delete or move the entire reference throughout the xcode project, but you can't actually edit it - its read only as far as xcode is concerned. Likewise, you cannot restructure it (move internal files around).
I'm not to sure why apple decided to make this the case, but apparently they have.
If you want to know how one might use the xcode folder system, here's how I tend to use them with my projects:
Whenever I subdivide code into folders, when I drag them into my project I click "recursively create groups for any added folders". If you do this, you any changes you make within xcode will not reflect the actual file itself. As far as I know, there is no way to do this. What does happen then is that when you add a new code file to it, the directory starts off in that file by default. ie, you don't need to navigate to it manually when you create a new file.
I use folder references whenever I'm working with content for an application I'm using. This way, I add all my images, folders, configuration files, whatever - and xcode immediately lists them. The reason I have it within xcode, I can I copy the files into the executables directory by dragging the folder reference into a "Copy Files" build phase.
Thats basically (to my knowledge) how one uses the folder types within xcode - sadly, I don't know how to achieve the functionality you want. You may have to manually delete the folders in finder, which if you do use folder references will update xcode to the change.
I ran into the same issue by using "Create Folder References for any added folders". I wanted to change some of the times but that's not possible. I had added a main folder that had other directories under it. I just had to select the main directory and deleted it and then just add the subdirectories that I needed. You can't make any location or removal changes to the directories that are added this way. -- Jeff
In the project browser, where you're looking at files, right click and choose "Delete". It'll prompt you to either remove the file from the project (leaving the underlying file on the filesystem) or to also move the underlying file to the trash.
I ran into the same issue. Delete the files from the folder directly as opposed to from within Xcode. You'll see the entries turn red under your project. Restarting Xcode should make these red entries vanish.

Where does Xcode's open quickly search?

I'm not sure how to get it to index my project files.
Open Quickly should be searching any open projects. There used to be a Preference for paths but I believe it was removed with 3.1?!?
Is it possible that said header file is not on your project's include path? If you added your source folders to your project using the "Create Folder References" option, or if you are using an external build system, then Xcode's indexer will not be aware of that file.
If you had added folders with the "Create Folder References" option, then there would be some folder icons in your project's file list that are yellow instead of the usual blue. If this is the case, you might try removing those folder references and re-adding the folders with the "Recursively create groups" option.
If you are using an external build system (which I suspect is not the case, since this is an iPhone question), then you have to explicitly tell Xcode about your project's include path by setting the HEADER_SEARCH_PATHS option in the Build panel of your project's Info window.
Another possibility is that the file you are trying to Open Quickly might be in a Framework that you have not added to your project. If that is the case, adding the framework will fix it.
Since I installed 10.6, I have been able to use the open quickly dialog to open anything in my user search path.
I am not sure if this is because of Snow Leopard, Xcode 3.2, the re-install, etc…
Check after you upgrade.

Resources