Interpretation of javax. microedition. lcdui. font conversion

Source: Internet
Author: User

1 public final class font {
2 Private font (INT face, int style, int size ){
3 This. Face = face;
4 This. Style = style;
5 This. size = size;
6
7 Init (face, style, size );
8}
9 Public native int charwidth (char ch );
10 public native int charswidth (char [] CH, int offset, int length );
11 Public native int stringwidth (Java. Lang. String Str );
12 public native int substringwidth (string STR, int offset, int Len );
13 private int face;
14 private int style;
15 private int size;
16 private int baseline;
17 private int height;
18 Private Static final font default_font = new font (face_system,
19 style_plain,
20 size_medium );
21
22 Private Static java. util. hashtable table = new java. util. hashtable (4 );
23 private native void Init (INT face, int style, int size );
24}
25
1. The key parameters of font are face, style, and size.
2. The font's readable attributes are the font height and baseline. The font height is usually certain, and the width is determined by different characters.
Because each word has a font glaph, and each font has its own width. Generally, the same series has the same width.
3. Font creation is implemented by the mobile phone system.
4. the font of each word needs to be implemented by the mobile phone system.
5. The font here is very simplified and limits some styles and sizes.
6. The default font is a flat font without a style.
7. Note: The system requires three fonts: system, monospace, and proportional. These are all classic fonts. We all use the system font.
8. Understand the font structure. You can pay attention to a lot of things when writing a program.

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.