(12) Patent Application Publication (10) Pub. No.: US 2007/01394.15 A1 Stamm Et Al
Total Page:16
File Type:pdf, Size:1020Kb
US 20070139415A1 (19) United States (12) Patent Application Publication (10) Pub. No.: US 2007/01394.15 A1 Stamm et al. (43) Pub. Date: Jun. 21, 2007 (54) STROKE CONTRAST IN FONT HINTING Publication Classification (51) Int. Cl. (75) Inventors: Beat Stamm, Redmond, WA (US); G06T II/00 (2006.01) Gregory Hitchcock, Woodinville, WA (52) U.S. Cl. .............................................................. 345/472 (US); Michael J. Duggan, Kirkland, (57) ABSTRACT WA (US) Stroke contrast is preserved for a range of font sizes and display resolutions using programmatic constraints or Correspondence Address: "hints'. One implementation of a “font hinting approach MCROSOFT CORPORATION enforces a regularization of stroke weights such that stroke ONE MCROSOFT WAY contrast is preserved for font sizes and display resolutions REDMOND, WA 98052-6399 (US) Sufficient to render it. Font hinting instructions determine a stroke contrast threshold, which may be used to decide whether to preserve or omit stroke contrast when rendering (73) Assignee: Microsoft Corporation, Redmond, WA the glyph. In one implementation, the stroke contrast thresh old is based on one or more stroke contrast relationships (21) Appl. No.: 11/311.946 associated with the typeface. In other implementations, the stroke contrast threshold is based on a minimum size thresh (22) Filed: Dec. 19, 2005 old or lowercase? uppercase stroke contrast relationships. | | | | | | | | | | | | | | TTTTTTTTTTTTTTTTTTTTT 104 TT III TTL T 10s HEE I T Font Hinting Module 100 TTT Patent Application Publication Jun. 21, 2007 Sheet 1 of 5 US 2007/01394.15 A1 H s g I C.RRR-. 3 s O O s cy) . Hu . C w-d c O C m s S JS TN H Patent Application Publication Jun. 21, 2007 Sheet 3 of 5 US 2007/O13941S A1 Z09) 909 809 009 9 61 Patent Application Publication Jun. 21, 2007 Sheet 5 of 5 US 2007/01394.15 A1 17 »JOLINOW W BOW-??|B|N}|BOWERHEINIBOWERHEINI BOW-REALNI SET(\GOW 0NILWYJEdO WELSÅS US 2007/01 394.15 A1 Jun. 21, 2007 STROKE CONTRAST IN FONT HINTING encoding a computer program. Another implementation of a computer program product may be provided in a computer BACKGROUND data signal embodied in a carrier wave by a computing system and encoding the computer program. Other imple 0001. Many computing systems can present information mentations are also described and recited herein. to a user by displaying text on a screen or some other media, Such as a printed page. The physical characteristics of the 0007. This Summary is provided to introduce a selection human visual system and the various types and qualities of of concepts in a simplified form that are further described electronic display or print technology offer unique chal below in the Detailed Description. This Summary is not lenges to a type designer when developing typefaces in intended to identify key features or essential features of the which the text can be presented. claimed subject matter, nor is it intended to be used to limit the scope of the claimed Subject matter. 0002. In typography, a typeface consists of a coordinated set of character designs. A typeface is usually comprised of BRIEF DESCRIPTIONS OF THE DRAWINGS an alphabet of letters, numerals, punctuation marks, ideo grams, and symbols (collectively referred to as characters or 0008 FIG. 1 illustrates an exemplary font hinting module glyphs). Arial, Times New Roman, Verdana, and Georgia are and resulting character displayS. four examples of typefaces. Traditionally, the word “font 0009 FIG. 2 illustrates exemplary operations for render denotes a complete typeface in a particular size (usually ing a glyph in a given font. measured in points), weight (e.g., light, book, bold, black), and orientation (e.g., roman, italic, oblique). For a given 0010 FIG. 3 illustrates exemplary operations for defining typeface, each character typically corresponds to a single a typeface with stroke contrast preserving font hinting. glyph, although certain characters of some typefaces may 0011 FIG. 4 illustrates exemplary operations for render include multiple glyphs. ing a glyph in a font using stroke contrast preserving font 0003 Strokes are prominent features of many glyphs. For hinting. example, a glyph representing the character E may be said 0012 FIG. 5 illustrates an exemplary system that may be to include three horizontal strokes (also called “crossbars) useful in implementing the described technology. and one vertical stroke. 0004. In many typefaces, individual strokes may have DETAILED DESCRIPTIONS different relative thicknesses or weights. A relationship of 0013 Scalable outline fonts are defined as continuous stroke weights is referred to as “stroke contrast'. Stroke shapes or outlines described by coordinates, mathematical contrast can contribute to the readability and aesthetics of a curves, and/or other parameters. Generally, glyphs may be typeface. One challenge to modem type designers is dis defined by high resolution representations, of which outlines playing a glyph of a given typeface in Such as way as to best are an example. Other high resolution representations may preserve stroke contrast for a range of font sizes and display include without limitations assorted contours, component resolutions. elements, bitmaps, mathematical descriptions, and other representations. SUMMARY 0014 Base outlines are described in a font definition that 0005 Implementations described and claimed herein can be read from memory (e.g., a font file or a font cache) help preserve stroke contrast for a range of font sizes and when an individual glyph is to be displayed or otherwise display resolutions using programmatic constraints or output (e.g., printed). Font definitions may be based on a "hints'. One implementation of a “font hinting approach Cartesian grid having X and y axes in font design units (or enforces a regularization of stroke weights such that stroke “font units), although other coordinate frameworks may be contrast is preserved for font sizes and display resolutions employed. Using Such font units, a base outline of the glyph sufficient to render it. Alternatively, if the font size and in the specified typeface may be described without regard to display resolution are insufficient to render all needed stroke the displayed glyph size or the resolution of the output weights for a given font, some stroke weights may be device. equalized to accommodate these size and resolution limita 0015. When a glyph is to be generated, the base outline tions while others may still be varied to preserve at least is scaled to a specified size and then used to create a discrete Some of the stroke contrast. Font hinting instructions deter raster of dots (e.g., a bitmap of pixels) on a display or mine a stroke contrast threshold, which may be used to hardcopy output device at the specified size. If such a bitmap decide whether to preserve or omit stroke contrast when is made in a simplistic way. Such as simply turning off each rendering the glyph. In one implementation, the stroke pixel or printer cell that has its centerlying within the scaled contrast threshold is based on one or more stroke contrast outline, then a number of visually distracting artifacts can relationships associated with the typeface. In another imple arise. Such as misalignments of features and breaks in shapes mentation, the stroke contrast threshold is based on a mini (referred to as “drop-outs”). For example, if the glyph is mum size threshold. In yet another implementation, the scaled and rendered at a small size and/or to a low resolution stroke contrast threshold is based on lowercase? uppercase display, the pixels turned on/off to represent the glyph will stroke contrast relationships. only grossly approximate the scaled outline because the 0006. In some implementations, articles of manufacture resulting pixels are too large and discrete in nature to are provided as computer program products. One implemen perfectly follow the scaled outline. tation of a computer program product provides a computer 0016. As such, additional processing, called “font hint program storage medium readable by a computer system and ing, may be employed to optimize the rendering of the US 2007/01 394.15 A1 Jun. 21, 2007 glyph for a given size and display resolution. Font hinting 0021. As such, the size of the glyph and the resolution of code can be included in or associated with the font definition the display can cause errors in a displayed glyph of a given of each individual glyph. Font hinting provides information font. In particular, these parameters can corrupt stroke to the raster image processor (RIP) to enhance the raster contrast in certain fonts. Therefore, the font hinting module ization of fonts. For example, font hinting may be used to 100 executes font hinting instructions to distort the scaled distort the scaled outline so as to improve the rendering. outline of the glyph so as to preserve as much stroke contrast Font hinting may be used to (1) ensure strokes intended to as possible. be equally thick appear equally thick; (2) Suppress undesired 0022 FIG. 2 illustrates exemplary operations 200 for overshoots (e.g., when a rounded letter, such as “O'”, is rendering a glyph in a given font. A definition operation 202 unintentionally scaled to appear taller than flat letters, such defines the typeface. As discussed, a typeface is typically as “M); (3) line up features on different glyphs that should defined to include a set of coordinates defining a base outline be at the same height; (4) keep the spaces between stems of each glyph in its character set. In some implementations, open (e.g., the spaces between the vertical strokes of an 'm' the definition of an individual glyph in a typeface may be should be visible); (5) force consistent spacing between sets manually defined by a typographer. In other implementa of parallel strokes; and (6) compensate for errors in the tions, the definition of an individual glyph may be automati rasterization algorithm, Such as errors causing drop-outs.