Use M Fonts on multiple platforms

Source: Internet
Author: User

1: Use in the operating system:

Win: C: \ Windows \ Fonts

Max: Macintosh/Library/Fonts folder

There is also a good Fontbook for Mac, which is located in the Finder/Application/Fontbook. After it is opened, add a new font and drag the new Fontbook to preview the selected Fontbook.

After adding a new font, You need to restart Illustrator or PS.

 

2: Use in Illustrator/PS:

Illustrator/PS uses fonts in the system, so you must first confirm that the system has been installed

Note: The BoldCond in HelveticalNeue. Note that the parent HeveticaNeue contains multiple sub-font.

 

 

3: Titanium: (Titanium uses TTF and OTF fonts)

Mac environment: http://docs.appcelerator.com/titanium/2.1/index.html! /Guide/Custom_Fonts

Steps:

Download your fonts or copy font from system folder

Copy the TTF/OTF file to the/Resources/fonts/directory.

If you want to use different fonts on iOS than Android, you can copy those files to Resources/iphone/fonts and Resources/android/fonts instead.

Refer to the following code:

 1 /* 2 * Let's say you downloaded the "Spicy Rice" font from Google WebFonts. 3 * You'd have a file named SpicyRice-Regular.ttf in your fonts directory 4 */ 5  6 var customFont = 'Spicy Rice'; // use the friendly-name on iOS 7 if(Ti.Platform.osname=='android') { 8    // on Android, use the "base name" of the file (name without extension) 9    customFont = 'SpicyRice-Regular';10 } 11 12 var label1 = Titanium.UI.createLabel({13    color:'#000',14    text:'I am Window 1',15    font:{16       fontSize:40,17       fontFamily: customFont18    },19    textAlign:'center',20    width:'auto'21 });

For Android: build your project and the custom font shocould show up.

Additional iOS steps

On iOS, you must list custom fonts in your app's Info. plist file.

 

  1. Build the project at least once (the font won't work yet ).

  2. Copy build/iphone/Info. plist to the project root folder (where Resources is located ).

  3. Double-click Info. plist to open it in Xcode.

  4. Right-click a blank area in the list of keys and chooseAdd Row. From the resulting list, chooseFonts provided by application.

  5. ExpandFonts provided by applicationAnd click inValueField. Enter the full name of the font file. If you 've put the file in the fonts directory as we suggest, make sure to include that path, e.g./fonts/SpicyRice-Regular.ttf

  6. Save the file and close Xcode.

  7. In Studio,Clean the projectThenBuild it again. This time your custom font shocould show up.

  8. As noted in the code sample above, you also need to use the "friendly name" for the font, rather than its file name. to determine this name, double-click the TTF/OTF file to open it in Font Book. the font's friendly name is shown in the window's title bar.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.