Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4467] Platform inconsistencies around custom fonts

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionDone
Resolution Date2019-11-20T23:08:53.000+0000
Affected Version/sRelease 1.7.0
Fix Version/sn/a
ComponentsTooling
Labelsparity, stage
ReporterKevin Whinnery
AssigneeUnknown
Created2011-06-21T07:48:32.000+0000
Updated2019-11-20T23:08:53.000+0000

Description

The handling of custom fonts is inconsistent across platforms. For iOS it requires a custom Info.plist setting - also, to my knowledge, fonts have to be placed at the top level Resource directory to be usable. For Android, fonts must be placed in Resources/fonts. There's not clear guidance on either platform on how to use these fonts in JavaScript. Consistent handling and documentation on proper use is needed for custom fonts.

Comments

  1. Bill Dawson 2011-08-29

    Just follow-up, because it concerns something I'm working on. iOS requires custom fonts to be declared upfront, so I believe Android should too for parity's sake. Stephen says that currently it's a plist (as Kevin points out) but that they need to move it to tiapp.xml. The two teams should do this in concert, i.e., we should try to make it so that we need only one (or whatever) section in tiapp.xml. Also, Stephen has just confirmed to me that indeed the custom font files need to be in Resources/ (not Resources/fonts like the Android team did it.) So Android should also have them in Resources/. For backwards compatibility, Android should continue to support Resources/fonts for a few versions (for the two or three people using it :) ).
  2. Arthur Evans 2011-11-21

    Other custom font discrepancies, from my observation: - I believe iOS supports both .otf and .ttf, but Android only supports .ttf. I could be wrong about this, but I couldn't seem to get .otf fonts to work on Android. - iOS loads based on the font name (embedded in the file), but Android loads based on the file name. So to use the same Chantelli Antiqua font referenced here on iOS, I'd need to specify the fontFamily as 'chantelli antiqua' instead of 'chantelli_antiqua'. Unrelated to parity, I also noted that the Mac stores its fonts in font "suitcases" which as far as I can tell neither platform can use. So users with Mac format fonts will need to extract the TrueType font data using a third-party tool.
  3. Tim Poulsen 2012-01-12

    I have tested fonts using 1.8.0.1 on iOS and Android: * Both platforms can use OTF and TTF files * You can put the font files into the Resources/fonts directory as long as you include a path in the value string in Info.plist A sample app with fonts is included with https://wiki.appcelerator.org/display/guides/Custom+Fonts
  4. Alan Hutton 2019-11-20

    Closing. This has been addressed in previous releases of the SDK. http://docs.appcelerator.com/platform/latest/#!/api/Font

JSON Source