allegro

This document pertains to font related methods found in the Allegro egg.

Please see the main [allegro] wiki page for more information.

  1. allegro
  2. Enums
    1. font-align
  3. Records
    1. font
    2. utf-string
  4. Functions
    1. Fonts
    2. True Type Font Support
    3. UTF Strings

Enums

font-align

[procedure] (font-align->int font-align)

font-align may be one of the following symbols:

[procedure] (int->font-align integer)

Records

font

[record] font
[procedure] (font-data font)
[procedure] (font-height font)

utf-string

[record] utf-string

Functions

Fonts

[procedure] (register-font-loader (string extension) (function font (string integer integer)))

Implements al_register_font_loader.

[procedure] (load-bitmap-font* string)

Implements al_load_bitmap_font.

[procedure] (load-bitmap-font string)

Implements al_load_bitmap_font, with (free-font!) declared as a finalizer.

[procedure] (load-font* string (integer size) (integer flags))

Implements al_load_font.

[procedure] (load-font string (integer size) (integer flags))

Implements al_load_font, with (free-font!) declared as a finalizer.

[procedure] (make-font-from-bitmap* bitmap (integer n) (s32vector ranges))

Implements al_grab_font_from_bitmap.

[procedure] (make-font-from-bitmap bitmap (integer n) (s32vector ranges))

Implements al_grab_font_from_bitmap, with (free-font!) declared as a finalizer.

[procedure] (free-font! font)

Implements al_destroy_font.

[procedure] (font-draw-utf (font f) (color c) (float x) (float y) (font-align flags) (utf-string ustr))

Implements al_draw_ustr.

[procedure] (font-draw-string (font f) (color c) (float x) (float y) (font-align flags) (string text))

Implements al_draw_text.

[procedure] (font-draw-justified-string (font f) (color c) (float x1) (float x2) (float y) (float diff) (font-align flags) (c-string text))

Implements al_draw_justified_text.

[procedure] (font-draw-justified-utf-string (font f) (color c) (float x1) (float x2) (float y) (float diff) (font-align flags) (utf-string text))

Implements al_draw_justified_ustr.

[procedure] (font-width font string)

Implements al_get_text_width.

[procedure] (font-utf-width font utf-string)

Implements al_get_ustr_width.

[procedure] (font-line-height font)

Implements al_get_font_line_height.

[procedure] (font-ascent font)

Implements al_get_font_ascent.

[procedure] (font-descent font)

Implements al_get_font_descent.

[procedure] (font-utf-dimensions (font f) (utf-string text))

Returns a 4-element list consisting of the bounding box elements: x, y, width and height.

[procedure] (font-dimensions (font f) (string text))

Returns a 4-element list consisting of the bounding box elements: x, y, width and height.

[procedure] (font-addon-install)

Implements al_init_font_addon.

[procedure] (font-addon-uninstall)

Implements al_shutdown_font_addon.

[procedure] (font-addon-version)

Implements al_get_allegro_font_version.

True Type Font Support

[procedure] (load-ttf* (string filename) (integer size) (integer flags))

Implements al_load_ttf_font.

[procedure] (load-ttf (string filename) (integer size) (integer flags))

Implements al_load_ttf_font, with (free-font!) declared as a finalizer.

[procedure] (load-ttf-from-file* (file f) (string filename) (integer size) (integer flags))

Implements al_load_ttf_font_f.

[procedure] (load-ttf-from-file (file f) (string filename) (integer size) (integer flags))

Implements al_load_ttf_font_f, with (free-font!) declared as a finalizer.

[procedure] (ttf-addon-install)

Implements al_init_ttf_addon.

[procedure] (ttf-addon-uninstall)

Implements al_shutdown_ttf_addon.

[procedure] (ttf-addon-version)

Implements al_get_allegro_ttf_version.

UTF Strings

[procedure] (make-utf-string* string)

Implements al_ustr_new.

[procedure] (make-utf-string string)

Implements al_ustr_new, with (free-utf-string!) declared as a finalizer.

[procedure] (make-utf-string-from-buffer* blob)

Given a blob, produces a new utf-string.

[procedure] (make-utf-string-from-buffer blob)

Given a blob, produces a new utf-string, with (free-utf-string!) declared as a finalizer.

[procedure] (free-utf-string! utf-string)

Implements al_ustr_free.

[procedure] (utf->string utf-string)

Implements al_cstr.

[procedure] (utf->buffer! utf-string blob)

Implements al_ustr_to_buffer.

[procedure] (utf->string-copy utf-string)

Implements al_cstr_dup.

[procedure] (utf-copy* utf-string)

Implements al_ustr_dup.

[procedure] (utf-copy utf-string)

Implements al_ustr_dup, with (free-utf-string!) declared as a finalizer.

[procedure] (utf-substring* utf-string (integer start) (integer end))

Implements al_ustr_dup_substr.

[procedure] (utf-substring utf-string (integer start) (integer end))

Implements al_ustr_dup_substr, with (free-utf-string!) declared as a finalizer.

[procedure] (utf-empty-string)

Implements al_ustr_empty_string.

[procedure] (make-utf-null-string*)

Makes an empty utf-string struct, where the string pointer is unset.

[procedure] (make-utf-null-string)

Makes an empty utf-string struct, where the string pointer is unset, with (free-utf-string!) declared as a finalizer.

[procedure] (utf-reference-cstr* string)

Implements al_ref_cstr.

[procedure] (utf-reference-cstr string)

Implements al_ref_cstr, with (free-utf-string!) declared as a finalizer.

[procedure] (utf-reference-buffer* blob)

Implements al_ref_buffer.

[procedure] (utf-reference-buffer blob)

Implements al_ref_buffer, with (free-utf-string!) declared as a finalizer.

[procedure] (utf-reference-utf-string* utf-string (integer start) (integer end))

Implements al_ref_ustr.

[procedure] (utf-reference-utf-string utf-string (integer start) (integer end))

Implements al_ref_ustr, with (free-utf-string!) declared as a finalizer.

[procedure] (utf-size utf-string)

Implements al_ustr_size.

[procedure] (utf-length utf-string)

Implements al_ustr_length.

[procedure] (utf-offset utf-string integer)

Implements al_ustr_offset.

[procedure] (utf-next utf-string integer)

Implements al_ustr_next, modified to return #f at the end of the string.

[procedure] (utf-previous utf-string integer)

Implements al_ustr_prev, modified to return #f at the end of the string.

[procedure] (utf-get utf-string integer)

Implements al_ustr_get.

[procedure] (utf-get-next utf-string integer)

Returns a 2-element list consisting of the next code and its position, or #f if at the end of the string.

[procedure] (utf-get-prev utf-string integer)

Returns a 2-element list consisting of the previous code and its position, or #f if at the start of the string.

[procedure] (utf-remove-char! utf-string integer)

Implements al_ustr_remove_chr.

[procedure] (utf-remove-range! utf-string (integer start) (integer end))

Implements al_ustr_remove_range.

[procedure] (utf-truncate! utf-string integer)

Implements al_ustr_truncate.

[procedure] (utf-ltrim! utf-string)

Implements al_ustr_ltrim_ws.

[procedure] (utf-rtrim! utf-string)

Implements al_ustr_rtrim_ws.

[procedure] (utf-trim! utf-string)

Implements al_ustr_trim_ws.

[procedure] (utf-assign! utf-string utf-string)

Implements al_ustr_assign.

[procedure] (utf-assign-substring! utf-string utf-string (integer start) (integer end))

Implements al_ustr_assign_substr.

[procedure] (utf-assign-string! utf-string string)

Implements al_ustr_assign_cstr.

[procedure] (utf-set-char! utf-string (integer pos) (integer char))

Implements al_ustr_set_chr.

[procedure] (utf-replace-range! utf-string (integer start) (integer end) utf-string)

Implements al_ustr_replace_range.

[procedure] (utf-find utf-string (integer start) utf-string)

Implements al_ustr_find_str.

[procedure] (utf-find-string utf-string (integer start) string)

Implements al_ustr_find_cstr.

[procedure] (utf-find-char utf-string (integer start) (integer char))

Implements al_ustr_find_chr.

[procedure] (utf-find-set utf-string (integer start) utf-string)

Implements al_ustr_find_set.

[procedure] (utf-find-set-string utf-string integer string)

Implements al_ustr_find_set_cstr.

[procedure] (utf-find-cset utf-string integer utf-string)

Implements al_ustr_find_cset.

[procedure] (utf-find-cset-string utf-string integer string)

Implements al_ustr_find_set_cstr.

[procedure] (utf-rfind utf-string integer utf-string)

Implements al_ustr_rfind_str.

[procedure] (utf-rfind-char utf-string integer (integer char))

Implements al_ustr_rfind_char.

[procedure] (utf-rfind-string utf-string integer string)

Implements al_ustr_rfind_cstr.

[procedure] (utf-find&replace! utf-string integer utf-string utf-string)

Implements al_ustr_find_replace.

[procedure] (utf-find&replace-string! utf-string integer string string)

Implements al_ustr_find_replace_cstr.

[procedure] (utf-equal? utf-string utf-string)

Implements al_ustr_equal.

[procedure] (utf-compare utf-string utf-string)

Implements al_ustr_compare.

[procedure] (utf-ncompare utf-string utf-string integer)

Implements al_ustr_ncompare.

[procedure] (utf-prefix? utf-string utf-string)

Implements al_ustr_has_prefix.

[procedure] (utf-prefix-string? utf-string string)

Implements al_ustr_has_prefix_cstr.

[procedure] (utf-suffix? utf-string utf-string)

Implements al_ustr_has_prefix.

[procedure] (utf-suffix-string? utf-string string)

Implements al_ustr_has_suffix_cstr.

[procedure] (utf8-width integer32)

Implements al_utf8_width.

[procedure] (utf8-encode! blob integer32)

Implements al_utf8_encode.

[procedure] (utf-string-utf16-size utf-string)

Implements al_ustr_size_utf16.

[procedure] (utf-string-utf16-encode utf-string blob integer)

Implements al_ustr_encode_utf16.

[procedure] (utf16-width integer)

Implements al_utf16_width.

[procedure] (utf16-encode u16vector integer32)

Implements al_utf16_encode.