Point, Points (PT), pixel relationships and conversions in Apple devices, and the length of the iphone emulator vs. the real machine

Source: Internet
Author: User
Tags macbook

Look at a lot of information has not been found to have a detailed introduction, including Apple official documents, is also a cursory. It was later seen in a blog that introduced the MacBook print font and was inspired.

First, the length unit of the Apple device drawing can be thought of as point, not pound (PT). This point is a logical concept and is device-independent.

Figure 1: Different resolution screen display 1point

For traditional conventional screens, 1 point maps physical screen 1 pixel. For Retina's high split screen, the 1point maps physical screen 2 pixel. This can unify the shape of the graphics in the same kind of different models of the size of the device.

So in the development, do not distinguish between the regular screen or the retina screen, on the iphone (3.5 inch) are (480, 360) on the MacBook (1280, 800).

In the actual rendering to the screen, there will be a scale factor to map point to the physical pixel, on the traditional screen factor is equal to the 1,retina screen is equal to 2, that is, why the line width of 1 point on the Retina screen map line width of 2 pixel.

A method for converting the points (PT) on a font to an Apple device. There is no immediate support for a function that supports a pound. However, it is possible to convert. First, unify the PT and PX units to the feet

PT/72 = INCHPIXEL/DPI = Inch

So it's easy to convert.

For a traditional screen, the dpi of the MacBook screen is the dpi of the 96,iphone screen is 163. For the Retina screen, the dpi of the MacBook screen is the dpi of the 192,iphone screen is 326. But for development, the drawing is still in point

It turns out that this is not a distinction between a traditional screen or a retina screen.

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.