Saturday, September 1, 2018

DPI scaling in Windows

【Move to another page】
Quote
https://ift.tt/2wxGguz
DPI scaling in Windows

Leaderboard: main content, some taken from DPI article


This article describes the methods used by Windows to scale its items when DPI went beyond 96.

== Introduction ==
Since the 1980s, the [[Microsoft Windows]] operating system has set the default display "DPI" to 96 PPI, while [[Apple Inc|Apple]]/[[Macintosh]] computers have used a default of 72 PPI.<ref>
Liquid error: wrong number of arguments (1 for 2)</ref> These default specifications arose out of the problems rendering standard fonts in the early display systems of the 1980s, including the [[IBM]]-based [[Color Graphics Adapter|CGA]], [[Enhanced Graphics Adapter|EGA]], [[VGA]] and [[8514]] displays as well as the [[Macintosh]] displays featured in the [[Macintosh 128K|128K]] computer and its successors. The choice of 72&nbsp;PPI by Macintosh for their displays arose from the convenient fact that the official 72 ''points per inch'' mirrored the 72 ''pixels per inch'' that appeared on their display screens. ([[Point (typography)|Points]] are a physical unit of measure in [[typography]], dating from the days of [[printing presses]], where 1 point by the [[Point (typography)#Current DTP point system|modern definition]] is 1/72 of the [[international inch]] (25.4&nbsp;mm), which therefore makes 1 point approximately 0.0139&nbsp;in or 352.8&nbsp;µm). Thus, the 72 pixels per inch seen on the display had exactly the same physical dimensions as the 72 points per inch later seen on a printout, with 1&nbsp;pt in printed text equal to 1&nbsp;px on the display screen. As it is, the Macintosh 128K featured a screen measuring 512 pixels in width by 342 pixels in height, and this corresponded to the width of standard office paper (512&nbsp;px ÷ 72&nbsp;px/in ≈ 7.1&nbsp;in, with a 0.7&nbsp;in margin down each side when assuming [[Letter paper|8.5&nbsp;in × 11&nbsp;in North American paper size]] (in Europe, it's 21cm x 30cm - called "A4". B5 is 176 millimeters x 250 millimeters)).Liquid error: wrong number of arguments (1 for 2)

A consequence of Apple's decision was that the widely used 10-point fonts from the typewriter era had to be allotted 10 display pixels in [[Em (typography)|em]] height, and 5 display pixels in ''[[x-height]]''. This is technically described as 10 ''pixels per em'' (''PPEm''). This made 10-point fonts be rendered crudely and made them difficult to read on the display screen, particularly the lowercase characters. Furthermore, there was the consideration that computer screens are typically viewed (at a desk) at a distance 30% greater than printed materials, causing a mismatch between the perceived sizes seen on the computer screen and those on the printouts.Liquid error: wrong number of arguments (1 for 2)

[[Microsoft]] tried to solve both problems with a hack that has had long-term consequences for the understanding of what DPI and PPI mean.<ref name="msdn-greg">Liquid error: wrong number of arguments (1 for 2)</ref> Microsoft began writing its software to treat the screen as though it provided a PPI characteristic that is <math>\tfrac{4}{3}</math> of what the screen actually displayed. Because most screens at the time provided around 72 PPI, Microsoft essentially wrote its software to assume that every screen provides 96 PPI (because <math>72 * (1+\tfrac{1}{3}) = 96</math>). The short-term gain of this trickery was twofold:

* It would seem to the software that <math>\tfrac{1}{3}</math> more pixels were available for rendering an image, thereby allowing for bitmap fonts to be created with greater detail.
* On every screen that actually provided 72 PPI, each graphical element (such as a character of text) would be rendered at a size <math>\tfrac{1}{3}</math> larger than it "should" be, thereby allowing a person to sit a comfortable distance from the screen. However, larger graphical elements meant less screen space was available for programs to draw; indeed, although the default 720-pixel wide mode of a Hercules mono graphics adaptor (the one-time gold standard for high resolution PC graphics) – or a "tweaked" VGA adaptor – provided an apparent 7.5-inch page width at this resolution, the more common and color-capable display adaptors of the time all provided a 640-pixel wide image in their high resolution modes, enough for a bare 6.67 inches at 100% zoom (and barely any greater visible page ''height'' – a maximum of 5 inches, versus 4.75). Consequently, the default margins in Microsoft Word were set, ''and still remain'' at 1 full inch on all sides of the page, keeping the "text width" for standard size printer paper within visible limits; despite most computer monitors now being both larger and finer-pitched, and printer paper transports having become more sophisticated, the Mac-standard half-inch borders remain listed in Word 2010's page layout presets as the "narrow" option (versus the 1-inch default).Liquid error: wrong number of arguments (1 for 2)
* Without using supplemental, software-provided zoom levels, the 1:1 relationship between display and print size was (deliberately) lost; the availability of different-sized, user-adjustable monitors and display adaptors with varying output resolutions exacerbated this, as it was not possible to rely on a properly-adjusted "standard" monitor and adaptor having a known PPI. For example, a 12" Hercules monitor and adaptor with a thick bezel and a little underscan may offer 90 "physical" PPI, with the displayed image appearing nearly identical to hardcopy (assuming the H-scan density was properly adjusted to give square pixels) but a thin-bezel 14" VGA monitor adjusted to give a borderless display may be closer to 60, with the same bitmap image thus appearing 50% larger; yet, someone with an 8514 ("XGA") adaptor and the same monitor could achieve 100 DPI using its 1024-pixel wide mode and adjusting the image to be underscanned. A user who wanted to directly compare on-screen elements against those on an existing printed page by holding it up against the monitor would therefore first need to determine the correct zoom level to use, largely by trial and error, and often not be able to obtain an exact match in programs that only allowed integer percent settings, or even fixed pre-programmed zoom levels. For the examples above, they may need to use respectively 94% (precisely, 93.75) – or 95/90, 63% (62.5) – or 60/66.7; and 104% (104.167) – or 105, with the more commonly accessible 110% actually being a less precise match.Liquid error: wrong number of arguments (1 for 2)

Thus, for example, a 10-point font on a Macintosh (at 72&nbsp;PPI) was represented with 10 pixels (i.e., 10&nbsp;PPEm), whereas a 10-point font on a Windows platform (at 96&nbsp;PPI) at the same zoom level<!--"on the same screen" text removed because of both a) Mac and Windows monitors being mutually incompatible at the time, before Mac moved to using multisync VGA monitors re-engineered to use their proprietary socket standards, b) it doesn't actually matter what the screen is, in terms of physical size, or logical or physical resolution, because at the moment we're talking purely about the virtual display surface inside the computer itself, which can be of arbitrary resolution so long as it's big enough to show at least one text character--> is represented with 13 pixels (i.e., Microsoft rounded 13.3333 to 13 pixels, or 13&nbsp;PPEm) – and, on a typical consumer grade monitor, would have physically appeared around 15/72 to 16/72 of an inch high instead of 10/72. Likewise, a 12-point font was represented with 12 pixels on a Macintosh, and 16 pixels (or a physical display height of maybe 19/72 of an inch) on a Windows platform at the same zoom, and so on.<ref>
Liquid error: wrong number of arguments (1 for 2)</ref> The negative consequence of this standard is that with 96 PPI displays, there is no longer a 1-to-1 relationship between the font size in pixels and the printout size in points. This difference is accentuated on more recent displays that feature higher [[pixel densities]]. This has been less of a problem with the advent of [[vector graphics]] and fonts being used in place of bitmap graphics and fonts. Moreover, many Windows software programs have been written since the 1980s which assume that the screen provides 96 PPI. Accordingly, these programs do not display properly at common alternative resolutions such as 72&nbsp;PPI or 120&nbsp;PPI. The solution has been to introduce two concepts:<ref name="msdn-greg" />

* '''logical PPI''': The PPI that software claims a screen provides. This can be thought of as the PPI provided by a virtual screen created by the operating system.
* '''physical PPI''': The PPI that a physical screen actually provides.

Software programs render images to the virtual screen and then the operating system renders the virtual screen onto the physical screen. With a logical PPI of 96 PPI, older programs can still run properly regardless of the actual physical PPI of the display screen, although they may exhibit some visual distortion thanks to the effective 133.3% pixel zoom level (requiring either that every third pixel be doubled in width/height, or heavy-handed smoothing be employed).Liquid error: wrong number of arguments (1 for 2)

== Before Windows XP ==
Since [[Windows 95]], Windows provides an option to set the font size by Display Properties>Settings>Advanced. The default options are 96 DPI (standard), 120 DPI and custom, wherein one can set the desired font zoom. In this mode, only text is scaled, and often improperly, as most applications back then considered 96 DPI as the standard. [[File:Windows 2000 scaling at 200%.png|thumb|Windows 2000 desktop at 200%, with [[Windows Explorer]] and [[Internet Explorer 5|Internet Explorer 5]]. Click to see full image.]]

== Windows XP ==
Windows XP introduced the GDI+ library which allows resolution-independent text scaling. [[Windows XP]] scales up the font and UI object sizes as if you'd gone and adjusted your theme's size settings, which can cause some graphical anomalies in some apps that're hardcoded to use default font and icon sizes. <ref>https://ift.tt/2LQuUGW>, basically scaling up text which causes clipping for those which are not designed to deal with High-DPI applications.

== Windows Vista, 7 and 8==
[[Windows Vista]] includes the now-ubiquitous concept of DPI virtualisation. In this mode, apps are rendered in a 96 DPI buffer off the screen and then upscaled to match the current DPI. This, while ensuring that icons and text stay intact and in the same position, introduces blurriness which is due to the fact that everything is essentially zoomed.
== Windows 8.1 ==
The maximum scaling level was increased from 150% to 200%, and it is now possible to independently set scaling level for each monitor. <ref>https://ift.tt/2wyAoS1
</ref>

== References ==
<references />

September 02, 2018 at 02:39AM

注目の投稿

List of companies founded by University of Pennsylvania alumni

 投稿 L List of companies founded by University of Pennsylvania alumni 投稿者: Blogger さん 7  Nation's Most Visible Mass Gathering During Cor...

人気の投稿