- DESCRIPTION
- PROPERTIES
- height : Int32
- The original pixel height of each character in the font.
- color : Color
- The multiplier for each pixel in this font as it's drawn. The default color of Color(255,255,255,255) ensures that the font will appear "normal". A color of Color(255,255,0) would not draw any of the blue channel, making a grey-scale letter appear to be tinted yellow. The 'alpha' value is applied to the color as the letters are drawn.
- scale : Vector2
- The size multiplier for rendering, (1.0,1.0) by default. Setting "scale = Vector2(2.0,0.5)" would cause the font to render at twice the width and half the height.
- characters : HashTable<<Char,FontCharacter>>
- METHODS
- init(String filename[,FontStyle style][,String mapping])
- Intializes this font from characters in the given font strip.
- Parameters:
filename
A png or jpeg file containing a strip of characters.
style
Any combination of FontStyle categories.
mapping
A string of characters specifying the Unicode value of
each character in the font strip. The default is a
string of 95 characters ranging from ' ' (space) to
'~'.
If you want to create a single font out of several different font strips, use a FontBuilder instead.
- init(Bitmap bitmap[,FontStyle style][,String mapping])
- init(HashTable<<Char,FontCharacter>> init:characters,Int32 init:height)
- Initializes this font with an existing lookup table of Char->FontCharacter mappings and a font height.
- alpha().Int32
- Alpha property-get method - returns the alpha component (0-255) of the current color multiplier.
- alpha(Int32 new_alpha)
- Alpha property-set method - sets the alpha component of this image's color multiplier.
- new_alpha should be 0 (transparent) through 255 (opaque).
- height().Real64
- Height property-get. Returns the original pixel height times the y-scale value.
- scaled(Vector2 new_scale)
- scaled(Real64 uniform_scale)
- draw(String st,Vector2 pos)
- Draws the given string of characters to the screen with the top-left corner of the first character at the given position.
- draw_center(String st,Vector2 pos)
- Draws the given string to the screen with the top-center of all the characters at the given position.
- draw_center(String st,Vector2 pos,Real64 field_width)
- Draws the given string centered in the given field width. 'pos' is the top-left corner of the field.
- draw_right(String st,Vector2 pos,Real64 field_width)
- Draws the given string right-justified in a field with the given top-left 'pos' and width.
- draw_right(String st,Vector2 pos)
- Draws the given string right-justified with its right edge at 'pos'.
- draw_line(String st,Vector2 pos)
- Internal use. Draws a single line of text with its top-left corner at position 'pos'.
- text_width_of(String text).Real64
- Returns the render width of 'text' in pixels, taking the current scale into account.
- text_width_of(Char ch).Real64
- Returns the render width of 'ch' in pixels, taking the current scale into account.
- adjust_character_widths(Int32 amount)
- Adjusts the logical widths of all the characters in this font. A positive value will space characters further apart while a negative value will scoot them closer together.
- word_wrap(String st,Int32 pixel_width).String[]
- Returns a word-wrapped version of this string as a list of lines. Existing newlines characters will cause a new line to begin immediately. Spaces immediately following existing newline characters are preserved.
- init_object()
- hash_code().Int32
- create_duplicate().Object
- to_String().String
- op==(Object other).Logical {multimethod}
- op<>(Object other).Logical {multimethod}
- type_name().String : native
- runtime_type().RuntimeType : native
- runtime_properties().RuntimeProperties
- runtime_methods().RuntimeMethods
|