23

There was a time when computer graphics had to deal with non-square pixels. Happily that time ended once everyone had VGA or better.

But Windows 2 supported both EGA and VGA. And while the latter has resolution 640x480, the best the former can do is 640x350. That's not just fewer pixels overall, it's non-square pixels.

What did Windows do about this?

Provide two complete sets of icons and fonts, one for each aspect ratio?

Design for EGA and accept that everything will look a bit squashed on VGA?

Design for VGA and accept that everything will look a bit elongated on EGA?

Design for halfway in between, and accept that everything will look a little bit distorted on either display?

Something else?

rwallace
  • 60,953
  • 17
  • 229
  • 552
  • 13
    There was a time when Windows even supported CGA in all its 640×200 glory! – Stephen Kitt Feb 22 '23 at 13:36
  • 7
    @StephenKitt And even Hercules Monochrome - Which has somewhat of a luxury crisp and clear look today. – tofro Feb 22 '23 at 13:42
  • 7
    @tofro indeed, I mentioned CGA because of its extreme pixel ratio; Hercules produced very nice displays (especially since monochrome displays don’t have a shadow mask). – Stephen Kitt Feb 22 '23 at 13:45
  • 1
    Even today, Windows 10 and 11 technically don't handle the display's aspect ratio. It's the video driver that does that. – tofro Feb 22 '23 at 13:58
  • 2
    When using CGA card and CGA monitor, the pixels are non-square only if the 320x200 area is adjusted to fill the 4:3 screen, which is the default. However, using the CGA composite output on a TV will not have 4:3 image aspect as TV scans more visible lines and card sends only 200 active lines of video. So more close to 1:1 pixel aspect. – Justme Feb 22 '23 at 15:30
  • 1
    @Justme but Windows uses 640×200, and probably wouldn’t be used with a TV anyway. – Stephen Kitt Feb 22 '23 at 16:01
  • 1
    Isn't device independent handling of output - i.e. working in virtual units and letting the device driver turn that into real ones - the whole point of Windows? The whole point it exists and GDI being it's most important part (same with GEM). – Raffzahn Feb 22 '23 at 16:49
  • 5
    The standard bitmap fonts (Courier, MS Serif, MS Sans Serif, Small Fonts, Terminal, FixedSys, System) were shipped as part of the graphics driver. The graphics driver supplied these fonts matching the pixel size and aspect ratio to provide a device-independent font display as much as possible. – Michael Karcher Feb 22 '23 at 20:06
  • 2
    The PC had no way of knowing what the screen aspect ratio was when using CGA or EGA graphics, because many monitors had easily accessible size controls, and different users had different "tastes", with some preferring to use more of the screen even if the geometry and focus weren't perfect at the edges, and others preferring to only use the central area of the tube that was clear and non-distorted. – supercat Feb 22 '23 at 22:30
  • @Raffzahn — some people would say that the whole pointy-clicky-user-experiency stuff matters, too ;-) – Michael Graf Feb 22 '23 at 23:21
  • @MichaelGraf Hmm, you might be up to something ... – Raffzahn Feb 23 '23 at 12:15
  • 4
    As an aside, it should be noted that all 16 bit versions of Windows supported EGA, not just Windows 2. (I ran versions up to 3.11 on a machine with an EGA, and the machine was originally supplied with 1.02 which I presume worked, although I admit I never actually tested it). – occipita Feb 23 '23 at 13:34
  • 3
    @occipita Not only EGA, but the win3.0 driver for CGA mono mode will work in 3.1/3.11 as well, although not included or officially supported. – mnem Feb 23 '23 at 14:20
  • 2
    I had non square pixels on VGA. I just assumed nobody cared because it wasn't that far off. (It was only a little noticeable at 100x100; things that were 32x32 weren't far enough from best fit to matter.) I'm surprised you're telling me that VGA pixels were square. – Joshua Feb 23 '23 at 20:08
  • 3
    @Joshua The picture width/height controls on VGA monitors are supposed to be adjusted in a way that in the 640x480 mode, pixels are square. Of course, you might have worked with a monitor that was not set up as intended. – Michael Karcher Feb 23 '23 at 21:47
  • 1
    @MichaelKarcher: We adjusted for maximum sharpness. Assuming square was possible it would have been blurred pretty bad. Didn't have too many monitors to try but none of them were quite the aspect ratio needed for square pixels. – Joshua Feb 23 '23 at 21:52

2 Answers2

38

Most of Windows’ display model is device-independent, or at least provides all the information required to produce consistent displays, and it’s the display drivers that handle discrepancies. As a result, programs look similar regardless of the display’s aspect ratio:

Reversi in 640×200 mode on CGA

Reversi in 640×350 mode on EGA

Reversi in 640×480 mode on VGA

(I’ve scaled these to 4:3, so the images all have the same width and height, but that doesn’t give an accurate representation of how the displays would look on real CGA or EGA monitors.)

When dealing with graphical output, Windows programs use logical coordinates, and those coordinates are mapped to physical coordinates using a configurable mapping. Programs which care about the squareness of squares etc. can request a mapping where logical coordinates correspond to real-world dimensions, e.g. 0.1mm, 0.01mm, 0.01” and so on (although the actual physical result can vary widely, depending on the user’s display adjustments), or even request an “isotropic” mode allowing them to scale their coordinate system as they wish while preserving aspect ratios.

In the screenshots above, note in particular the circles used on the board. The Reversi program only asks Windows to draw circles, and the display driver takes care of actually drawing the circles with whatever horizontal-to-vertical ratio is appropriate. The game board does end up varying in size, because the available display area is different. The CGA and EGA screenshots are of Windows 1.01, with its icon bar at the bottom of the screen; the VGA screenshot is of Windows 2, which gives maximised windows more room (because it eliminated the icon bar, instead allowing icons for minimised windows to appear anywhere on the screen and thus to be covered by windows).

Fonts are provided by display drivers (although they can choose to re-use Windows-provided fonts); if you look at Windows installation disks, you’ll see font files for CGA, EGA, VGA, and possibly 8514/A. This is similar to BIOS support for “plain” text mode (CGA text mode uses 8 vertical pixels per character, EGA uses 14, VGA 16). Many programs use text size as a reference for their general layouts (but users of Windows 3 who tried SVGA modes with the SVGA font probably remember programs which didn’t, and ended up being unusable in that mode; SVGA modes could also be used with VGA fonts, avoiding that problem).

There is one part of the UI that doesn’t adjust: the mouse pointer, which ends up stretched out on EGA and even more so on CGA. Mouse coordinates are always reported as device coordinates.

Icons are device-independent bitmaps, scaled appropriately. In the screenshots above, the icons have approximately the same physical height, even though that requires using a very different number of pixels vertically.

Dialog boxes have a specific coordinate system designed to ensure that their contents remain usable across a variety of outputs (when used properly…).

See the “Introduction to GDI” chapter in Charles Petzold’s Programming Windows for details.

Cody Gray - on strike
  • 1,554
  • 14
  • 21
Stephen Kitt
  • 121,835
  • 17
  • 505
  • 462
  • 3
    If you'd rather demonstrate VGA on Windows 1, I have a patch for that: http://www.seasip.info/DOS/Win1/index.html – john_e Feb 23 '23 at 09:29
  • 4
    If I understand you right, you're saying that the display driver is programmed with information about the shape of the pixels, and it uses that information to ensure that a square looks like a square on any device that it supports; is that right? The pictures that you've attached seem pretty misleading, since at first glance, they seem to be showing the opposite of what you're actually saying. – Tanner Swett Feb 23 '23 at 11:33
  • 2
    @TannerSwett yes, that’s right. Ignore the EGA screenshot (the middle one), it is indeed misleading; the CGA and VGA screenshots show squares which are pretty much squares, and circles which have pretty much the same width and height (calling the CGA circles circles would be rather generous). If you ignored aspect ratio, and drew an 80×80 pixel square, it would be square on a 4:3 VGA output (assuming the user hadn’t adjusted it to no longer be 4:3), occupying 1/8 of the width and 1/6 of the height, but elongated on a 4:3 CGA monitor, occupying 1/8 of the width and 2/5s of the height! – Stephen Kitt Feb 23 '23 at 13:00
  • 2
    @TannerSwett so instead, on CGA an 80×80 pixel device-independent square would be rendered as an 80×33 on-screen pixel square. – Stephen Kitt Feb 23 '23 at 13:01
  • 1
    Icon scaling could get a little weird with some applications and displays. My school ran Windows 3.0 on RM Nimbus PCs which have an odd display resolution (https://retrocomputing.stackexchange.com/questions/5099 suggests 320x250 which sounds about right) which meant it used a very odd icon size (16x32? Not sure) which ended up with some 3rd party applications only displaying half of their icons. – occipita Feb 23 '23 at 13:45
  • 1
    @CodyGray -- on the first two images you can see a space reserved at the bottom of the screen for application icons, similar to a modern task bar. Windows 2 & 3 allowed maximized windows to overlap this area, but it was kept distinct in Windows 1. – occipita Feb 23 '23 at 16:24
0

The standard display device during this time was an analog CRT display. Most of this type of monitor had horizontal/vertical size adjustments that could be used to square things up.

Zed909
  • 1
  • 1
    Not enough to make up for a program assuming pixels are square, certainly not on CGA, and typically not on EGA either (and even if it were possible, it would result in significant horizontal black bars). – Stephen Kitt Feb 23 '23 at 15:52
  • 1
    Recommended setup for picture width/height was to obtain a 4:3 picture aspect ratio. You only get square pixels if the pixel/line count also has a 4:3 ratio, as 640x480 on the VGA card does. – Michael Karcher Feb 23 '23 at 21:50
  • Most of the programs assume the monitor is adjusted as expected and pixels are non-square, so most programs would look wrong if you tweak the size adjustment to have square pixels. – Justme Feb 24 '23 at 09:14