Adding TTF font to PhoneGap app

2019-02-24 08:35发布

问题:

I have followed this tut: http://forrst.com/posts/Using_custom_fonts_on_iPad_and_iPhone_with_Phone-u2P

I cant get the font to display on my iPhone.

What Im unsure about is; is where do you add this : "Add an array key to your info.plist called 'UIAppFonts'. In item0 enter the name of the font including the extension." I have no info.plist file only a PhoneGap.plist and app_name-Info.plist

I added it to both but still nothing.

Is there any rules on the font you are using?

回答1:

In Xcode 4.3 select the main project file in the sidebar (at the top, blue icon) and for each item under "TARGETS" go to the "Info" tab.

  1. Under there you should find a "Fonts provided by application" key. If it's not there it needs to be added by control-clicking (or "right-clicking") any of the existing keys and selecting "Add row". In the drop down find "Fonts provided by application" and use that. It should have the "Array" type by default, if it does not, add it.

  2. Expand the key by clicking the arrow to the left of it.

  3. Under you should at least see an "Item 0" key. If it doesn't have a value, double-click its "value" field and enter the name of your first font.

  4. For every additional font you can click the "+" button next to any of the items (visible when the item is selected) to add a new row.

You also need to be sure that the font files are in your project's "Resources" folder. I believe support is limited to .otf and .ttf.



标签: fonts cordova