Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Custom font in iOS app


This question is answered.


Permlink Replies: 7 - Last Post: Oct 6, 2014 1:02 PM Last Post By: John Frazier
Karu Kaarigar

Posts: 141
Registered: 11/27/08
Custom font in iOS app  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 5, 2014 12:07 AM
How can I have a custom font in an iOS app? I want to use the roboto font of the Android on iOS app as well. I googled and I found this link but it is not helpful as such because I don't understand it completely:

http://codeverge.com/embarcadero.delphi.firemonkey/how-to-access-a-custom-font-fil/1988429

Can someone please explain how to use custom font in an iOS app?
Eli M

Posts: 1,346
Registered: 11/9/13
Re: Custom font in iOS app
Helpful
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 5, 2014 5:08 AM   in response to: Karu Kaarigar in response to: Karu Kaarigar
John Frazier


Posts: 726
Registered: 2/17/00
Re: Custom font in iOS app
Helpful
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 5, 2014 8:45 AM   in response to: Karu Kaarigar in response to: Karu Kaarigar
Karu Kaarigar wrote:
How can I have a custom font in an iOS app? I want to use the roboto font of the Android on iOS app as well. I googled and I found this link but it is not helpful as such because I don't understand it completely:

http://codeverge.com/embarcadero.delphi.firemonkey/how-to-access-a-custom-font-fil/1988429

Can someone please explain how to use custom font in an iOS app?

I haven't tried it yet though I know somebody on our Japanese team wrote it up a while back. No idea if it is still relevant for new iOS, new RS... worth a look. Yeah I know the text is Japanese but there are pics and sites out there that may translate for you.

http://blogs.embarcadero.com/teamj/2013/05/17/3898/

Their article make mention of this one http://develop.calmscape.net/dev/295/
--
John Frazier (Embarcadero Newsgroup Admin)
Karu Kaarigar

Posts: 141
Registered: 11/27/08
Re: Custom font in iOS app  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 5, 2014 5:14 PM   in response to: John Frazier in response to: John Frazier
John Frazier wrote:
I haven't tried it yet though I know somebody on our Japanese team wrote it up a while back. No idea if it is still relevant for new iOS, new RS... worth a look. Yeah I know the text is Japanese but there are pics and sites out there that may translate for you.

http://blogs.embarcadero.com/teamj/2013/05/17/3898/
Thanks John - that was very helpful. I am trying to follow these instructions - seems to be quite straight forward. However the Project.Info.plist file gets overwritten when I build the project and probably that is the reason I don't get to see the custom font (I am trying to use Roboto font on iOS).

The post you pointed to mentions the use of build step to handle this. How can I use build step to revert the changes to my version of the plist file. May be I should keep my version of the plist file and then copy it to overwrite the existing plist file. I guess it should be pre-build step then?
Karu Kaarigar

Posts: 141
Registered: 11/27/08
Re: Custom font in iOS app  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 5, 2014 5:32 PM   in response to: Karu Kaarigar in response to: Karu Kaarigar
Karu Kaarigar wrote:
The post you pointed to mentions the use of build step to handle this. How can I use build step to revert the changes to my version of the plist file. May be I should keep my version of the plist file and then copy it to overwrite the existing plist file. I guess it should be pre-build step then?
Never mind - I got it working with the step from Rudd's post. Thanks!
Douglas Rudd

Posts: 314
Registered: 5/16/97
Re: Custom font in iOS app
Correct
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 5, 2014 5:12 PM   in response to: Karu Kaarigar in response to: Karu Kaarigar
How to use custom TrueType fonts in IOS.

1. Set the component font Family to the font you want and it will be displayed in the designer.
(sometimes the "Family" name may be different from the ttf filename)

2. Deploy the TrueType file.
For instance I am using the font file IMS.ttf and the font Family is IMS.
Go to Deployment page.
Add IMS.ttf
Remote path = .\

3. Change the Info.plist file.
In the debug or release folder there is your plist file:
Appname.info.plist
Make a copy of it to CustomInfo.plist

Add this to the custom plist:
<key>UIAppFonts</key>
<array>
<string>IMS.ttf</string>
</array>

4. Deploy the changed Info.plist file.
In the Deployment page uncheck the default Info.plist deployment and add the deployment of your CustomInfo.plist to remote name Info.plist.

Karu Kaarigar

Posts: 141
Registered: 11/27/08
Re: Custom font in iOS app  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 5, 2014 5:33 PM   in response to: Douglas Rudd in response to: Douglas Rudd
Douglas Rudd wrote:
How to use custom TrueType fonts in IOS.

1. Set the component font Family to the font you want and it will be displayed in the designer.
(sometimes the "Family" name may be different from the ttf filename)

2. Deploy the TrueType file.
For instance I am using the font file IMS.ttf and the font Family is IMS.
Go to Deployment page.
Add IMS.ttf
Remote path = .\

3. Change the Info.plist file.
In the debug or release folder there is your plist file:
Appname.info.plist
Make a copy of it to CustomInfo.plist

Add this to the custom plist:
<key>UIAppFonts</key>
<array>
<string>IMS.ttf</string>
</array>

4. Deploy the changed Info.plist file.
In the Deployment page uncheck the default Info.plist deployment and add the deployment of your CustomInfo.plist to remote name Info.plist.

Thanks - this did it!
John Frazier


Posts: 726
Registered: 2/17/00
Re: Custom font in iOS app  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 6, 2014 12:26 PM   in response to: Douglas Rudd in response to: Douglas Rudd
Douglas Rudd wrote:
How to use custom TrueType fonts in IOS.

1. Set the component font Family to the font you want and it will be displayed in the designer.
(sometimes the "Family" name may be different from the ttf filename)

2. Deploy the TrueType file.
For instance I am using the font file IMS.ttf and the font Family is IMS.
Go to Deployment page.
Add IMS.ttf
Remote path = .\

3. Change the Info.plist file.
In the debug or release folder there is your plist file:
Appname.info.plist
Make a copy of it to CustomInfo.plist

Add this to the custom plist:
<key>UIAppFonts</key>
<array>
<string>IMS.ttf</string>
</array>

4. Deploy the changed Info.plist file.
In the Deployment page uncheck the default Info.plist deployment and add the deployment of your CustomInfo.plist to remote name Info.plist.


So when are you going to write up all the cool font stuff into a master article?[nudge] If you had web space or felt so inclined I might even get it linked from our docs. :)
--
John Frazier (Embarcadero Newsgroup Admin)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02