The downloaded fonts are generally in the TTC or TTF format.TrueTypeFont type. The TTF font can be used normally, but the TTC font only has some common Chinese characters, but many of the less commonly used Chinese characters do not exist (the font is still displayed in after the font is selected ).The difference between the two is that the TTC file contains more
Recently, I've done a reading application and used a custom font to learn a bit about it.1. First is the simplest and most common practice, packed with built-in Word repertoires files:Add a font library file to the project, such as Font1.ttf add to the project, and then add a fonts provided by application in the project plist, this is the array, and then add the key item1,value is just said Font1.
1. Introduction
Traditionally, the type information is usually obtained from the lattice font. However, a fatal disadvantage of lattice fonts is that the size of the font information is fixed, magnified fonts will produce serious sawtooth distortion. This paper introduces a method of obtaining the font information of characters directly from TTF
TTF Introduction
TTF (Truetypefont) is a font file format jointly launched by Apple and Microsoft, and TTF has become one of the most commonly used font file representations since Windows became popular for more than 20 of years. The biggest advantage of TrueType fonts is that you can easily convert the font contour t
In the writing of HTML, there are some times need to display some special fonts, but these special fonts are generally not self-brought by the system, then we need to load the font we want to use. Here's how:1. First add in style:@font-Face{font-family:mfont;src:url ('.. /font/crapaud_petit.ttf');}The Font-family property defines the font reference name for easy referenceSrc:url is the local font resource.
The project would like to use a third-party font, query the solution on the StackOverflow, also toss a while, add success, examples are as follows:1. Add the Xx.ttf font library to the project2. Add a new line Fonts provided by application in the project's Xx-info.plist file , plus the name of the font library3. Reference the name of the font library and set the font: [uifontfontwithname:@ "FontName" size: - ]; UILabel *label = [[UILabel alloc] I
Windows under the Ya-black font, put under Ubuntu, the effect is actually better, very smooth and elegant feelingMethod:Create a folder under/usr/share/fonts/truetype customizedfonts, copy the TTF file heresudo CP -R Customizedfonts/usr/share/fonts/truetypeThe font folder and font files are chmod to 777 (not 777 should also be possible, did not try)sudo chmod 777
The project would like to use a third-party font, query the solution on the StackOverflow, also toss a while, join the success, the ratio is as follows:1. Add the Xx.ttf font library to project2. Add a new row Fonts provided by application in Project's Xx-info.plist file , plus the name of the font library3. Reference the name of the font library and set the font: [uifontfontwithname:@ "FontName" size: - ]; UILabel *label = [[UILabel alloc] Initw
Objective: A design manual in Android designs. There are commonly used UI icons, icon size specifications, and so on in the design manual.Among them, there is a TTF font, previously felt useless. But when I was studying, I often saw a lot of developers using GoogleThe TTF font provided. I counted it. There are 19 fonts
Android does not support layout XML to directly use TTF and other custom fonts.
The Custom font must be placed in the asset directory and context must be called. the getassets () method is used to obtain the resources of custom fonts. Because Android widgets depend on other
you want to replace to droidsansfallback. TTF, replace the original one in/system/fonts/. Another method is to defineFor us, the first method is too violent and there is no choice. Therefore, the second method is more feasible.
The brute force replacement method will not be mentioned. Now let's talk about the vendor's font method:
2.2.vendor fonts method:
Suppos
Android System built-in fonts
The Android system itself has built-in fonts that you can use in your programs and support the style of modifying fonts when XML configuration TextView. Support Fields Android:textstyle, Android:typeface, android:fontfamily, System built in Nor
Support for TextView fonts is very limited under the Android operating system, and by default TextView typeface attributes support "Sans", "serif", "monospace" three fonts, and if no fonts are specified, the system lacks the provincial capital. Sans the font to display as text. But these three
In the use of cocos2d-x to release Android platform games, the game may need to display Chinese fonts, or want to display beautiful custom fonts, what should I do?The font label in the cocos2d-x provides the CCLabelAtlas, CCLabelBMFont CCLabelTTF
1. CCLabelAtlas is fast and supports a limited set of characters or numbers.
2. CCLabelBMFontWe can use CCLabelBMFont
: // obtain the TextView control object.TextView textView = (TextView) findViewById (R. id. custom );// Save the font file to the assets/fonts/directory and create a Typeface object at www.linuxidc.comTypeface typeFace = Typeface. createFromAsset (getAssets (), "fonts/DroidSansThai. ttf ");// Apply the fontTextView. setTypeface (typeFace );
To apply a Custom font
1. set the system default font in the Android XML fileYou can use Android:typeface to set fonts in an XML file , such as android:typeface= "monospace". In this example, we in the activity of android:text= "Hello, world! hello " respectively carried out four kinds of display methods, followed by "Sans","serif"," Monospace "and system default mode (using Sans by default ). English
;
// Obtain the TextView control object
TextView textView = (TextView) findViewById (R. id. custom );
// Save the font file to the assets/fonts/directory and create a Typeface object at www.linuxidc.com
Typeface typeFace = Typeface. createFromAsset (getAssets (), "fonts/DroidSansThai. ttf ");
// Apply the font
TextView. setTypeface (typeFace );
To apply a Custom
When doing Android development, some software will require some special fonts, we need to introduce the external TTF format font into the program, the specific steps are:Create a new fonts directory in the Android app directory assets, copy the
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.