[TIMOB-3418] Custom Font support on Android
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-05-16T10:54:39.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.7.0, Sprint 2011-13, Release 1.6.2 |
Components | Android |
Labels | android, custom, enterprise, feature, font, fontfamily, klist, release-1.6.2, release-1.7.0, reported-1.6.1, rplist |
Reporter | Alan Leard |
Assignee | Don Thorp |
Created | 2011-04-15T03:44:50.000+0000 |
Updated | 2011-05-16T10:54:39.000+0000 |
Description
Feature Request
Support for Custom Fonts on Android Devices.
Attachments
File | Date | Size |
---|---|---|
chantelli-antiqua.zip | 2011-04-15T03:44:50.000+0000 | 12903 |
screenshot.png | 2011-04-15T03:44:50.000+0000 | 30788 |
Needs to go on 1.6.2 as well.
(from [d06a815b13625e60d5f43f717420af9ab2308db6]) Support custom fonts loaded in assets/fonts. [#3418] https://github.com/appcelerator/titanium_mobile/commit/d06a815b13625e60d5f43f717420af9ab2308db6"> https://github.com/appcelerator/titanium_mobile/commit/d06a815b1362...
(from [89670092e070d0c67f04300becd3b18285b3753a]) Move the default font file location to Resources/fonts so as to take advantage of our built-in builder.py file delta/deletion/addition checking. [#3418] https://github.com/appcelerator/titanium_mobile/commit/89670092e070d0c67f04300becd3b18285b3753a"> https://github.com/appcelerator/titanium_mobile/commit/89670092e070...
To use this, put your custom (third-party) font files in
Resources/fonts
(orResources/android/fonts
if you prefer ... both will be handled). Then when setting thefont
property of the view (Label, TextField, etc.), set thefontFamily
member to the base filename of the font file (i.e., the file name without the extension).EXAMPLE (to be used for QE testing as well):
Create a new project.
Create the
Resources/fonts
folder in that project.Download and unzip the attached Chantelli-Antiqua.zip file, and copy Chantelli-Antiqua.ttf into your
Resources/fonts
folder.Use this as your app.js:
Notice in several places we're setting
font: {fontFamily: 'Chantelli_antiqua' ... }
. (Case doesn't matter.)When you run it, you will (or should) notice that the font is not a standard font. See attached screenshot.png.
(from [0243d42c591e2ec96defa95302597f27fb21af19]) Move the default font file location to Resources/fonts so as to take advantage of our built-in builder.py file delta/deletion/addition checking. [#3418] https://github.com/appcelerator/titanium_mobile/commit/0243d42c591e2ec96defa95302597f27fb21af19"> https://github.com/appcelerator/titanium_mobile/commit/0243d42c591e...
(from [9a03aba397daa01ca562a7f82192bf82791cd0c1]) Support custom fonts loaded in assets/fonts. [#3418] https://github.com/appcelerator/titanium_mobile/commit/9a03aba397daa01ca562a7f82192bf82791cd0c1"> https://github.com/appcelerator/titanium_mobile/commit/9a03aba397da...
QE: please test both in master and 1_6_X, as it was specifically requested that this feature be added to 1_6_X
Tested with [INFO] Titanium SDK version: 1.6.2 (04/18/11 17:16 878906d) on Nexus S 2.3.2 Emulator 2.1