Create a summary of font and text control display

Source: Internet
Author: User

Using the default font of the control, while displaying both Japanese and Chinese, will appear garbled, according to the settings inside the skinmagic, using MS Sans Serif (Microsoft fine Word) font, you can solve the problem.

Use this font to display Chinese on text controls at the same time, both Japanese and English in three languages.

Create a font, and then setfont the text control.

M_fontscrolltext.createfont (18,

0,

0,

0,

Fw_normal,

FALSE,

FALSE,

FALSE,

Ansi_charset,

Out_default_precis,

Clip_default_precis,

Default_quality,

Default_pitch,

_t ("MS Sans Serif")

);

Briefly explain the parameters.

1. 1th parameter

Font size, there is a method of conversion between the number of points and the logical height.

Method 1:

In the source code of CreatePointFont

int nheight; Height of font

Point pt;

Pt.y =:: GetDeviceCaps (HDC, logpixelsy) * pointsize;

Pt.y/= 720; Points/inch, ten Decipoints/point

::D Ptolp (HDC, &pt, 1);

Point ptorg = {0, 0};

::D Ptolp (HDC, &ptorg, 1);

nheight =-abs (PT.Y-PTORG.Y);

Method 2:

nheight =-muldiv (pointsize, GetDeviceCaps (HDC, Logpixelsy), 72);

2. 5th parameter

You can set whether the font is bold

3. 6th parameter

Set whether the font is skewed

4. 7th parameter

Set whether the font is underlined

5. Last parameter

The name of the font.

The above conversions are not tested and modified if there are any problems.

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.