IOS Font Size conversion issues

Source: Internet
Author: User

One, PS and pt convert px: relative length units. Pixels (Pixel). (PS Font) PT: absolute length unit. Point. The formula (iOS font) is as follows: pt= (PX/96) *72.

Second, the conversion between fonts 1in = 2.54cm = 25.4 mm = 72PT = 6pc specific conversion is: Points Pixels Ems Percent 6pt 8px 0.5em 50%        7pt 9px 0.55em 55% 7.5pt 10px 0.625em 62.5% 8pt 11px 0.7em 70% 9pt     12px 0.75em 75% 10pt 13px 0.8em 80% 10.5pt 14px 0.875em 87.5% 11pt 15px 0.95em 95% 12pt 16px 1em 100% 13pt 17px 1.05em 105% 13.5pt 18px 1.125e M 112.5% 14pt 19px 1.2em 120% 14.5pt 20px 1.25em 125% 15pt 21px 1.3em 13 0% 16pt 22px 1.4em 140% 17pt 23px 1.45em 145% 18pt 24px 1.5em 150% 20       PT 26px 1.6em 160% 22pt 29px 1.8em 180% 24pt 32px 2em 200% 26pt     35px 2.2em 220% 27pt 36px 2.25em 225% 28pt 37px 2.3em 230% 29pt 38px 2.35em 235% 30pt       40px 2.45em 245% 32pt 42px 2.55em 255% 34pt 45px 2.75em 275% 36pt 48 PX 3em 300%

Conversion of pixels to millimeters you need to know another parameter: dpi (dots per inch) pixels/dpi = inches in number of inches * 25.4 = mm number for the display device, whether it is a printer or a screen, there is a common way to first use GetDeviceCaps (device handle, Logpix ELSX) or GetDeviceCaps (device handle, Logpixelsy) the number of pixels per inch of the device is recorded as: px and py one inch is equal to 25.4mm so millimeters converted into pixels are converted  horizontally: X * px/25.4 Vertical direction change Count: Y * py/25.4 pixels converted to millimeters x * 25.4/px in the program so write mycontrol.height: = 10{mm} * pixelsperinch * div 254; The numerator and denominator are multiplied by 10, and the floating-point operations are converted to integer operations, and the DPI computed by the standard resolutions such as 1024x768 or 800x600, which is more efficient, is a constant: 96, so the calculated millimeter-to-pixel relationship is approximately equal to a constant: roughly 1 millimeters equals 3.78 Megapixels

IOS Font Size conversion issues

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.