#include "asvisual.h"
#include "char2uni.h"
Go to the source code of this file.
Classes | |
struct | ASGlyph |
struct | ASGlyphRange |
struct | ASFont |
struct | ASFontManager |
struct | ASTextAttributes |
Defines | |
#define | MAX_GLYPHS_PER_FONT 2048 |
#define | MAGIC_ASFONT 0xA3A3F098 |
#define | ASF_TypeMask (ASF_GuessWho|ASF_Freetype) |
#define | MAX_SPECIAL_GLYPH ((ASGlyph*)0x00000003) |
#define | GLYPH_TAB ((ASGlyph*)0x00000003) |
#define | GLYPH_SPACE ((ASGlyph*)0x00000002) |
#define | GLYPH_EOL ((ASGlyph*)0x00000001) |
#define | GLYPH_EOT ((ASGlyph*)0x00000000) |
#define | ASTA_UseTabStops (0x01<<0) |
#define | ASTA_VERSION_1 1 |
#define | ASTA_VERSION_INTERNAL ASTA_VERSION_1 |
Enumerations | |
enum | ASFontType |
enum | ASText3DType |
enum | ASCharType |
Functions | |
ASFontManager * | create_font_manager (Display *dpy, const char *font_path, struct ASFontManager *reusable_memory) |
void | destroy_font_manager (struct ASFontManager *fontman, Bool reusable) |
ASFont * | open_freetype_font (struct ASFontManager *fontman, const char *font_string, int face_no, int size, Bool verbose) |
ASFont * | open_X11_font (struct ASFontManager *fontman, const char *font_string) |
ASFont * | get_asfont (struct ASFontManager *fontman, const char *font_string, int face_no, int size, ASFontType type_and_flags) |
ASFont * | dup_asfont (ASFont *font) |
int | release_font (struct ASFont *font) |
void | print_asfont (FILE *stream, struct ASFont *font) |
void | print_asglyph (FILE *stream, struct ASFont *font, unsigned long c) |
ASGlyph ** | get_text_glyph_list (const char *text, ASFont *font, ASCharType char_type, int length) |
ASImage * | draw_text (const char *text, struct ASFont *font, ASText3DType type, int compression) |
ASImage * | draw_utf8_text (const char *text, struct ASFont *font, ASText3DType type, int compression) |
ASImage * | draw_unicode_text (const CARD32 *text, struct ASFont *font, ASText3DType type, int compression) |
ASImage * | draw_fancy_text (const void *text, struct ASFont *font, ASTextAttributes *attr, int compression, int length) |
Bool | get_text_size (const char *text, struct ASFont *font, ASText3DType type, unsigned int *width, unsigned int *height) |
Bool | get_utf8_text_size (const char *text, struct ASFont *font, ASText3DType type, unsigned int *width, unsigned int *height) |
Bool | get_unicode_text_size (const CARD32 *text, struct ASFont *font, ASText3DType type, unsigned int *width, unsigned int *height) |
Bool | get_fancy_text_size (const void *text, struct ASFont *font, ASTextAttributes *attr, unsigned int *width, unsigned int *height, int length, int *x_positions) |
Bool | get_asfont_glyph_spacing (ASFont *font, int *x, int *y) |
Bool | set_asfont_glyph_spacing (ASFont *font, int x, int y) |
#define ASF_TypeMask (ASF_GuessWho|ASF_Freetype) |
Referenced by get_asfont().
#define ASTA_VERSION_INTERNAL ASTA_VERSION_1 |
Definition at line 295 of file asfont.h.
Referenced by draw_fancy_text(), draw_text(), draw_unicode_text(), draw_utf8_text(), get_fancy_text_size(), get_text_size(), get_unicode_text_size(), get_utf8_text_size(), and handle_asxml_tag_text().
#define MAGIC_ASFONT 0xA3A3F098 |
Definition at line 71 of file asfont.h.
Referenced by asfont_destroy(), open_freetype_font_int(), open_X11_font_int(), and release_font().
#define MAX_GLYPHS_PER_FONT 2048 |
enum ASCharType |
enum ASFontType |
enum ASText3DType |
struct ASFontManager* create_font_manager | ( | Display * | dpy, | |
const char * | font_path, | |||
struct ASFontManager * | reusable_memory | |||
) |
Definition at line 105 of file asfont.c.
References asfont_destroy(), create_ashash, ASFontManager::dpy, ASFontManager::font_path, ASFontManager::fonts_hash, FT_Init_FreeType(), ASFontManager::ft_ok, LOCAL_DEBUG_OUT, mystrdup, NULL, safecalloc, show_error, string_compare, string_hash_value, and True.
Referenced by create_generic_fontman(), and TASImage::DrawText().
void destroy_font_manager | ( | struct ASFontManager * | fontman, | |
Bool | reusable | |||
) |
Definition at line 131 of file asfont.c.
References destroy_ashash, False, ASFontManager::font_path, ASFontManager::fonts_hash, free(), FT_Done_FreeType(), and ASFontManager::ft_ok.
Referenced by compose_asimage_xml_from_doc().
struct ASImage* draw_fancy_text | ( | const void * | text, | |
struct ASFont * | font, | |||
ASTextAttributes * | attr, | |||
int | compression, | |||
int | length | |||
) |
Definition at line 2138 of file asfont.c.
References ARGB32_White, ASCT_Char, ASCT_UTF8, ASTA_VERSION_INTERNAL, ASTextAttributes::char_type, draw_text_internal(), IsUTF8Locale, NULL, ASTextAttributes::tab_size, and ASTextAttributes::version.
Referenced by handle_asxml_tag_text().
struct ASImage* draw_text | ( | const char * | text, | |
struct ASFont * | font, | |||
ASText3DType | type, | |||
int | compression | |||
) |
Definition at line 2112 of file asfont.c.
References ARGB32_White, ASCT_Char, ASCT_UTF8, ASTA_VERSION_INTERNAL, ASTextAttributes::char_type, draw_text_internal(), IsUTF8Locale, NULL, and ASTextAttributes::type.
Referenced by TASImage::DrawText().
struct ASImage* draw_unicode_text | ( | const CARD32 * | text, | |
struct ASFont * | font, | |||
ASText3DType | type, | |||
int | compression | |||
) |
struct ASImage* draw_utf8_text | ( | const char * | text, | |
struct ASFont * | font, | |||
ASText3DType | type, | |||
int | compression | |||
) |
Definition at line 2130 of file asfont.c.
References ARGB32_White, ASCT_UTF8, ASTA_VERSION_INTERNAL, draw_text_internal(), NULL, and ASTextAttributes::type.
struct ASFont* get_asfont | ( | struct ASFontManager * | fontman, | |
const char * | font_string, | |||
int | face_no, | |||
int | size, | |||
ASFontType | type_and_flags | |||
) |
Definition at line 286 of file asfont.c.
References add_hash_item, AS_HASHABLE, ASF_Freetype, ASF_GuessWho, ASF_TypeMask, ASH_Success, False, ASFontManager::fonts_hash, free(), get_flags, get_hash_item, len, mystrdup, ASFont::name, NULL, open_freetype_font_int(), open_X11_font_int(), ASFont::ref_count, safemalloc, sprintf(), True, type, and ASHashData::vptr.
Referenced by TASImage::DrawText(), and handle_asxml_tag_text().
Definition at line 2155 of file asfont.c.
References False, ASFont::spacing_x, ASFont::spacing_y, and True.
Bool get_fancy_text_size | ( | const void * | text, | |
struct ASFont * | font, | |||
ASTextAttributes * | attr, | |||
unsigned int * | width, | |||
unsigned int * | height, | |||
int | length, | |||
int * | x_positions | |||
) |
Definition at line 1759 of file asfont.c.
References ASCT_Char, ASCT_UTF8, ASTA_VERSION_INTERNAL, ASTextAttributes::char_type, get_text_size_internal(), IsUTF8Locale, NULL, ASTextAttributes::tab_size, and ASTextAttributes::version.
ASGlyph** get_text_glyph_list | ( | const char * | text, | |
ASFont * | font, | |||
ASCharType | char_type, | |||
int | length | |||
) |
Definition at line 1550 of file asfont.c.
References ASCT_Char, ASCT_Unicode, ASCT_UTF8, get_character_glyph(), get_text_length(), get_unicode_glyph(), get_utf8_glyph(), NULL, ptr, safecalloc, and UTF8_CHAR_SIZE.
Bool get_text_size | ( | const char * | text, | |
struct ASFont * | font, | |||
ASText3DType | type, | |||
unsigned int * | width, | |||
unsigned int * | height | |||
) |
Definition at line 1733 of file asfont.c.
References ASCT_Char, ASCT_UTF8, ASTA_VERSION_INTERNAL, ASTextAttributes::char_type, get_text_size_internal(), IsUTF8Locale, NULL, and ASTextAttributes::type.
Referenced by draw_text_internal(), and TASImage::DrawText().
Bool get_unicode_text_size | ( | const CARD32 * | text, | |
struct ASFont * | font, | |||
ASText3DType | type, | |||
unsigned int * | width, | |||
unsigned int * | height | |||
) |
Bool get_utf8_text_size | ( | const char * | text, | |
struct ASFont * | font, | |||
ASText3DType | type, | |||
unsigned int * | width, | |||
unsigned int * | height | |||
) |
Definition at line 1751 of file asfont.c.
References ASCT_UTF8, ASTA_VERSION_INTERNAL, get_text_size_internal(), NULL, and ASTextAttributes::type.
struct ASFont* open_freetype_font | ( | struct ASFontManager * | fontman, | |
const char * | font_string, | |||
int | face_no, | |||
int | size, | |||
Bool | verbose | |||
) |
struct ASFont* open_X11_font | ( | struct ASFontManager * | fontman, | |
const char * | font_string | |||
) |
void print_asfont | ( | FILE * | stream, | |
struct ASFont * | font | |||
) |
Definition at line 2180 of file asfont.c.
References ASFont::flags, fprintf(), ASFont::max_ascend, ASFont::max_descend, ASFont::max_height, ASFont::space_size, ASFont::spacing_x, ASFont::spacing_y, and ASFont::type.
Definition at line 2198 of file asfont.c.
References ASGlyph::ascend, ASGlyph::descend, fprintf(), get_unicode_glyph(), ASGlyph::height, k, ASGlyph::lead, NULL, ASGlyph::pixmap, ASGlyph::width, and x80.
int release_font | ( | struct ASFont * | font | ) |
Definition at line 351 of file asfont.c.
References ASFont::fontman, ASFontManager::fonts_hash, ASFont::magic, MAGIC_ASFONT, ASFont::name, NULL, ASFont::ref_count, remove_hash_item, and True.
Referenced by TASImage::DrawText().
Definition at line 2168 of file asfont.c.
References False, ASFont::spacing_x, ASFont::spacing_y, and True.
Referenced by handle_asxml_tag_text().