|theory||AFM parser b0.1|
Flash does not associate the pixel width of text field with the actual text populating the field. The width value is the bounding box width. This is a caveat of Flash text manipulation via ActionScript. Using the proprietary AFM Parser (Adobe Font Metrics), this problem is resolved thus allowing the absolute positioning of text.
Using Adobe Font Metrics file information, a two-part process may be used to calculate the precise pixel width of graphical text. The off-line utility parses an AFM file and exports the actual character widths. The information is then imported into the on-line Flash movie which requires the metrics. This setup process only occurs once.
Part two of the process employs a routine which scans a string of text and returns the associated pixel width. Calculations work for any text point size since font metrics are scalable.
The first application of AFM Parser has been implemented in Arc Text.
Copyright © 2002 Noel Rubin
|Nov 20th, 2001|