Wednesday, December 17, 2014

How to Use Custom Fonts in IOS - Delphi


IOS

XE7

You should be able to use any True Type Font in your IOS app.

Example using the font Script MT Bold. This font is in the Windows Font Folder. The font file name is SCRIPTBL.TTF.

1. Copy SCRIPTBL.TTF to the project folder.
2. Compile the app for IOS so that it makes an info.plist file in the debug folder.
3. Open the info.plist file in the Delphi editor. Save it as custom.info.plist in the project folder.
Add another key in it:
 <key>UIAppFonts</key>
 <array>
 <string>SCRIPTBL.TTF</string>
 </array>

This tells IOS to be able to use the additional font file. IOS will automatically look for it in the bundle.

4. In the Deployment page, add SCRIPTBL.TTF with Remote Path of .\



5. Add your custom plist file with Remote Name of info.plist



6. Uncheck the deployment of the old info.plist



This will substitute the info plist with your font info in it.

For each component, set the TextSettins Font Family property to Script MT Bold. Since this font is already installed in Windows, you can choose it off the dropdown list.

This is a form with label, textbox, memo, checkbox, radio button.


No comments:

Post a Comment