Font: A combobox that lets you pick the font to extract the glyphs (characters) vectors from.
Characters: Here you enter the characters you want to extract. The SPACE character is always included.
Use a MINUS to include character ranges and a COMMA to separate characters and character ranges.
For example, "a-e,n,L-N" would extract the vector information for the characters a, b, c, d, e, n, L,
M and N. If, however, you only want the vector information to display a fixed piece of text, you might as well
simply paste that text into this textfield.
When such a fixed text contains the MINUS character, you have to remove it from the text, type "-,"
into the Characters: field and paste the changed text behind the "-,". If the text contains the COMMA
character, start with ",," or "-,,," when it contains both MINUS and COMMA.
The two default ranges (as pictured above) include the Basic Latin and Latin-1 Supplement characters.
Create AS3 Code Extracts the vector information for the chosen characters and font and compiles it into a
class named "GlyphData". The resulting ActionScript 3.0 code is displayed in the AS3 Code: textfield
as well as copied to the Clipboard in text format.
The first member of the "GlyphData" class is the Object "inf". Every extracted glyph is
represented by the letter "G" followed by the Unicode character code of the character. An "A"
(Unicode 65) is represented by "G65", the SPACE character (Unicode 32) by "G32" and so on.
Each glyph has a function (as in public function G65():Array) and a property entry
in the "inf" Object (like "G56":[146, 38, 579]). The function
returns an Array containing the vector information (drawing commands and coordinates) for the character. The
drawing commands are as the flash.display.GraphicsPathCommand class dictates: 1 for moveTo, 2 for lineTo and 3
for curveTo. Please be advised that the drawPath() method renders drawings faster than a series of individual
moveTo(), lineTo() and curveTo() methods. The value of the "inf" Object entry for each glyph is an
Array comprised of 3 integers. The first is the count of coordinate entries and the second the number of drawing
commands. You'll need the two values when you want to create the Vectors which feed the drawPath() method. The
third and last element of the Array is the advance value for the character (the distance from its left border
to the left border of the next character). With the checkbox Add GetGlyphsDim Function you can add a
Function that removes any unsupported characters from a given input text and calculates the required Vector
dimensions for such text. The Add GetGlyphs Function checkbox triggers the inclusion of a Function which
fills the previously created Vectors for a text String, its position and character size. Studying the
demo projects
for Action Glyphs might help to get a better understanding of how to use the two Functions.
|