Friday, July 4, 2008

Points, Pixels, and EMs on Web Pages, for MAT 113

A PIXEL is the smallest visual unit in a computer graphic. Pixels are arranged into a grid to make an image. A pixel is not a size unit, but rather is a measure of the number of discrete units in the graphic. Pixels take on the attribute of size when rendered by some sort of device such as a computer monitor. An image consisting of 72 pixels in height will appear smaller on a monitor set to 96 ppi (pixels per inch) than it does on a monitor having a resolution of 72 ppi. The number of pixels per inch is a function of the resolution setting of the monitor. A monitor set at 1024 by 768 will have a different number of pixels per inch than at a setting of 1600x1200 pixels. At the same time, a 17" monitor set at 1024 by 768 will have a different number of ppi than a 22" monitor at the same setting.

Points, on the other hand, are an immutable, resolution-independent measure of distance. An inch is comprised of 72 points. Einstein not withstanding, an inch is an absolute distance. At the same time, the actual rendering of a letter-form with a specified point size is problematic.

An EM is a measure relative to the configuration of a letter-form. As an heuristic rule, an EM unit of measure extends from the top of a capital letter to the bottom of a descender on a lower case letter. As the point size changes, so does that of the EM. This measure is sometimes defined as the width of a capital letter "M," possibly because of the inclusion of the "M" in the term, and because of the use of the terms EM dash and EN dash to define longer and shorter dashes respectively. In any case, the EM is an arbitrary unit defined by the type founder.

The way in which all of the above translates into the size of type rendered on a Web page varies according to device and browser. Measures such as the specification of a pixel size for a letter face may yield unexpected results on some browsers. The difference in appearance of a letter form at a specified size can vary significantly from browser to browser, and from system to system. Complete control over letter size is an impossibility.

See also:

Monday, June 30, 2008

Obfuscate Mailto For MAT 113

Spambots harvest email addresses by parsing mailto elements in Web pages. Here is a nifty Javascript that you can use to convert a mailto into a Javascript that is invisible to spambots. Simply enter your email address into the form provided. Place the resulting text in your HTML code where you want the mailto to appear.

See also: