Android: Custom Fonts

Source: Internet
Author: User

Android development often need to use some of the more beautiful fonts, these font system itself is not self-contained, we need to go to the Internet to download a good unreal font style, generally. TTF suffix file. Now take a look at the simple way to use

First on the Internet casually the next font style file, is generally. TTF format.

Then create a new assets file in the project with a Java file peer

Copy the downloaded TTF file into this folder

Then it can be applied by the following two steps, and the TV is the ID of the control TextView

//         Get the downloaded font file        from the typeface object Typeface Typeface = Typeface.createfromasset (Getassets (),"mytext.ttf"); //         Sets the font style for text box content        tv.settypeface (typeface);

Android: Custom Fonts

Related Article

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.