Hubbry Logo
TwipTwipMain
Open search
Twip
Community hub
Twip
logo
7 pages, 0 posts
0 subscribers
Be the first to start a discussion here.
Be the first to start a discussion here.
Twip
Twip
from Wikipedia
twip
Unit systemTypographic units
Unit ofLength
Conversions
1 twip in ...... is equal to ...
   Typographic units   1/20 points
   Imperial/US units   1/1440 in
   Metric (SI) units   17.64 μm

A twip (abbreviating "twentieth of a point" or "twentieth of an inch point"[1]) is a typographical measurement, defined as 120 of a typographical point. One twip is 11440 inch, or 17.64 μm.[2]

In computing

[edit]

Twips are screen-independent units to ensure that the proportion of screen elements are the same on all display systems. A twip is defined as being 11440 of an inch (approximately 17.64 μm).

A pixel is a screen-dependent unit, standing for 'picture element'. A pixel is a dot that represents the smallest graphical measurement on a screen. Twips are the default unit of measurement in Visual Basic (version 6 and earlier, prior to VB.NET). Converting between twips and screen pixels is achieved using the TwipsPerPixelX and TwipsPerPixelY properties[3] or the ScaleX and ScaleY methods.[4]

Twips can be used with Symbian OS bitmap images for automatic scaling from bitmap pixels to device pixels.[5] They are also used in Rich Text Format from Microsoft for platform-independent exchange and they are the base length unit in OpenOffice.org and its fork LibreOffice.

Flash internally specifies most sizes in units it calls twips, but which are really 120 of a logical pixel,[6] which is 34 of an actual twip.[7]

See also

[edit]

References

[edit]
Revisions and contributorsEdit on WikipediaRead on Wikipedia
from Grokipedia
A twip is a used in and , defined as one-twentieth of a printer's point or 1/1440 of an inch (approximately 17.64 micrometers). The term "twip" is an for "twentieth of a point," referring to the traditional typographical point as a base unit. Twips provide a device-independent scale for precise positioning and sizing of text, graphics, and layouts in environments, particularly within Windows applications and file formats. This unit ensures consistent rendering across varying screen resolutions and print outputs by allowing sub-pixel accuracy, with 1440 twips equaling one inch regardless of display density. In practice, twips are integral to systems like the (WMF) format, where the MM_TWIPS mapping mode defines logical units as twips for drawing operations, and to document standards such as (RTF) and binary files for controlling margins, fonts, and spacing. The adoption of twips originated in the context of early graphical user interfaces and printer technologies, where fine-grained measurements were needed to bridge the gap between screen pixels and high-resolution print media. Today, while modern web standards favor units like pixels or CSS points, twips remain relevant in legacy tools, (VBA), and certain calls for coordinate systems in controls and forms. For example, properties like ScaleMode in VBA can be set to twips to specify units for drawing methods such as Line or , facilitating portable code across different hardware.

Definition

Etymology

The term "twip" is an abbreviation for "twentieth of a point," denoting a unit equivalent to one-twentieth of a typographical point. Microsoft coined the term as a fabricated word to describe this subdivision. The twip relates directly to the point as its foundational measure in typography.

Precise Measurement

A twip is defined as exactly 1/20 of a typographical point, with one point equivalent to 1/72 inch in digital . This results in the precise of 1 twip = 120×72=11440\frac{1}{20 \times 72} = \frac{1}{1440} inch. To derive the metric equivalent, note that 1 inch is defined as exactly 25.4 mm. Thus, 1 twip = 25.41440\frac{25.4}{1440} mm ≈ 0.0176388889 mm, or equivalently 17.64 μm. This fractional relationship to the inch-based point ensures device independence in digital contexts, as it ties the unit to a fixed physical scale that remains consistent regardless of varying screen resolutions or output devices, allowing uniform proportions in layout and rendering.

Relation to Other Units

Typographic Units

In typography, the point (pt) serves as a fundamental absolute unit of measurement, defined as 1/72 of an inch in the Anglo-American system, with 12 points equaling one pica, a larger unit traditionally used for layout grids and column widths. The twip, derived from "twentieth of a point," functions as a subdivision of this system, where 20 twips constitute one point, providing a finer for precise positioning in and design. This structure allows twips to handle sub-point adjustments that points alone might not accommodate with sufficient accuracy. Unlike relative units such as the em, which equals the current font's point size and scales with the height, or the en, defined as half an em for spacing elements like dashes, the twip maintains an absolute measure independent of font variations. This absolute quality makes twips particularly suited for consistent cross-device or cross-font applications where relative units like em and en could introduce variability based on the chosen . Twips align with the historical Anglo-American point system, which differs from European scales like the Didot system—where 12 Didot points form one , approximately 0.178 inches—and the slightly larger French ligne-based measurements. For context, one twip equals 1/1440 of an inch, reinforcing its basis in the imperial-derived Anglo-American framework rather than metric-influenced alternatives like the Didot point.

Imperial and Metric Equivalents

The twip is fundamentally tied to the imperial system, where it is defined as exactly 1/1440 of an inch. This makes 1440 twips equivalent to one inch. In relation to other , 20 twips equal one typographical point, which itself measures 1/72 of an inch. For larger scales relevant in digital contexts such as document layouts spanning multiple feet, one foot comprises 12 inches or 17,280 twips, while one yard equals 36 inches or 51,840 twips. Conversions to the metric system derive from the exact equivalence of one inch to 25.4 millimeters, established internationally in 1959. Thus, one twip measures 25.4 / 1440 millimeters, or approximately 0.01764 millimeters. This equates to about 17.64 micrometers (μm). For broader scale, one meter contains approximately 56,693 twips, calculated as 1,000 millimeters divided by 0.01764 mm per twip. A practical example illustrates these conversions in : a standard A4 sheet, with a width of exactly 210 millimeters per , corresponds to 210 / 0.01764 ≈ 11,905 twips. This value is obtained by first converting 210 mm to inches (8.2677 inches) and then multiplying by 1,440 twips per inch. In computational implementations, approximations like 0.01764 mm per twip can introduce precision loss when using , potentially leading to cumulative errors in rendering or layout calculations. To mitigate this, many applications, including products, store and process measurements as values in twips, leveraging the unit's for exact fractional representation of inches without decimal approximations.

Applications in Computing

Typography and Document Processing

In , all measurements such as margins, line spacing, and font sizing are internally stored and processed in twips to ensure precision across different display and printing environments. For instance, user inputs in inches or centimeters are converted to twips upon entry, with values like a 0.25-inch margin equating to 360 twips for consistent layout calculations. Twip's device-independent nature, defined as 1/1440 of an inch, facilitates accurate scaling in without reliance on specific hardware resolutions. In the (RTF), twips serve as the fundamental unit for platform-independent text exchange, enabling uniform formatting across applications. RTF control words, such as \margl for the left margin, specify positions and dimensions directly in twips; for example, \margl720 sets a left margin of 0.5 inches. This approach ensures that elements like indents and spacing remain consistent when documents are transferred between systems supporting RTF. In applications, particularly those in the ecosystem like Word and Publisher, twips support consistent rendering of typographic features such as , leading, and indents across printers and screens. By using twips for these adjustments, software maintains proportional spacing regardless of , preventing distortions in text alignment. A practical example is font height calculation: a 12-point font equates to 240 twips, which is used to determine baseline alignment and interline spacing in document layouts. This conversion, derived from 1 point equaling 20 twips, allows precise vertical positioning in RTF and Word files.

User Interface Design

In Visual Basic applications, particularly in Visual Basic 6.0 and Microsoft Access forms, twips serve as the default unit for specifying the size and position of graphical user interface elements such as form controls, buttons, and dialog boxes. This approach ensures layout consistency across varying display resolutions by tying measurements to physical dimensions rather than device-specific pixels. For instance, the Width property of a CommandButton control is set in twips, where 1440 twips equate to one inch, allowing developers to define button dimensions that scale appropriately when rendered. Twips promote device independence in Windows-based UI design by converting to pixels based on the system's (DPI) setting, enabling dynamic scaling for different monitors. At a standard 96 DPI, 1440 twips correspond to 96 pixels, representing one inch on screen; on higher-DPI displays, the same twip value maps to more pixels to maintain proportional sizing. In the Windows (GDI), the MM_TWIPS mapping mode further supports this by defining each logical unit as one twip (1/1440 inch), facilitating resolution-agnostic positioning of UI components like window coordinates. In legacy software developed with or the , twips enable partial high-DPI awareness by allowing specifications for control widths and dialog layouts that adjust automatically during runtime conversion to pixels. For example, form properties like SubdatasheetHeight or InputBox positioning use twips to define vertical and horizontal extents, helping older applications avoid bitmap stretching on modern high-resolution screens when DPI scaling is enabled. Despite these advantages, twips have limitations in contemporary UI frameworks, where device-independent pixels (DIPs, defined as 1/96 inch) in CSS for web interfaces or English Metric Units (EMUs, with 914400 per inch) in Open XML have largely supplanted them for greater precision and cross-platform compatibility. However, twips persist in formats like the legacy .doc structure for maintaining in UI-related positioning data. RTF files, often embedded in UIs for text rendering, also rely on twips for similar consistency.

History and Adoption

Origins in Microsoft Products

The twip unit emerged in the 1980s as a key component of 's graphics and document handling systems, designed to mitigate inconsistencies in visual rendering across diverse hardware setups, including varying screen resolutions and printer capabilities. It was integrated into the (GDI) with the release of in November 1985, where it underpinned the MM_TWIPS mapping mode to enable precise, device-independent coordinate transformations. Although 1.0 for launched in October 1983, twips gained prominence in word processing through their adoption in the (RTF), first specified in 1987 alongside Word 3.0 for Macintosh. The rationale for selecting the twip—a unit equal to 1/1440 of an inch—centered on its exceptional divisibility, as 1440 divides evenly into 72 (points per inch) by a factor of 20, facilitating accurate scaling for both digital displays and print outputs without fractional losses. This choice allowed to transcend the limitations of coarser units like points, providing a unified scale for maintaining proportional integrity in layouts. A pivotal milestone was the twip's embedding in the Windows GDI for defining logical coordinate systems, which abstracted device specifics to support consistent graphics rendering from the platform's inception. Its formal documentation occurred in the RTF specification, published in the March 1987 issue of Microsoft Systems Journal, establishing twips as the standard for encoding measurements in text and graphics interchange across applications. Microsoft's overarching motivation in developing the twip was to foster platform and device independence, enabling seamless output portability in an era of environments and predating widespread high-DPI display challenges.

Use in Other Software

Twips serve as a base unit for drawing and text measurements in , an open-source office suite derived from , enabling precise compatibility with legacy documents during import and export operations. 's API includes functions such as TwipsPerPixelX and TwipsPerPixelY to convert between pixels and twips, ensuring consistent rendering across display systems. This internal use of twips facilitates the handling of .doc files, where measurements like margins and font sizes are stored in twips, allowing seamless support for binary Word formats without proprietary dependencies. Adobe products, including and legacy versions of InDesign, provide partial support for twips through compatibility with RTF and older Word formats, primarily to enable import of formatted documents from ecosystems. While Adobe prefers units like points or English Metric Units (EMUs) in its native workflows, twips are parsed during RTF processing to maintain layout fidelity in cross-application exchanges. This limited integration ensures for users migrating content from Word but does not extend to full native adoption in modern Adobe tools. The (RTF), an open specification originally developed by but widely adopted beyond its ecosystem, relies on twips for all measurements, including margins, indents, and line spacing, making it a key vector for twip usage in non-proprietary contexts. RTF's has led to its implementation in diverse applications, such as on Windows and various third-party word processors like those in the or older Lotus suites, as well as clients supporting formatted text exchange. The binary .doc format specifications, now publicly documented, also specify twips for structural elements, influencing parsers in open-source tools that handle legacy files. As of 2025, twips face trends in contemporary , with modern standards like CSS favoring relative units such as pixels, ems, and rems for web and cross-platform , reducing reliance on fixed typographic measures. However, twips persist in legacy codebases, file parsers, and compatibility layers for handling pre-ODF and pre-DOCX documents, particularly in enterprise environments maintaining older document workflows. This retention underscores twips' role in ensuring archival accuracy amid ongoing migrations to open formats.

References

Add your contribution
Related Hubs
User Avatar
No comments yet.