Why my custom fonts are being overwritten on iOS?

292 views Asked by At

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?

1

There are 1 answers

1
Marcos Crispino On BEST ANSWER

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:

  1. 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"
  2. Edit the template file located at "genexus_install_directory\iOS\Templates\iOS_Genexus\MainName-Info.plist", add the custom fonts key
  3. 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.