asfont.h File Reference

#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

ASFontManagercreate_font_manager (Display *dpy, const char *font_path, struct ASFontManager *reusable_memory)
void destroy_font_manager (struct ASFontManager *fontman, Bool reusable)
ASFontopen_freetype_font (struct ASFontManager *fontman, const char *font_string, int face_no, int size, Bool verbose)
ASFontopen_X11_font (struct ASFontManager *fontman, const char *font_string)
ASFontget_asfont (struct ASFontManager *fontman, const char *font_string, int face_no, int size, ASFontType type_and_flags)
ASFontdup_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)
ASImagedraw_text (const char *text, struct ASFont *font, ASText3DType type, int compression)
ASImagedraw_utf8_text (const char *text, struct ASFont *font, ASText3DType type, int compression)
ASImagedraw_unicode_text (const CARD32 *text, struct ASFont *font, ASText3DType type, int compression)
ASImagedraw_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 Documentation

#define ASF_TypeMask   (ASF_GuessWho|ASF_Freetype)

Referenced by get_asfont().

#define ASTA_UseTabStops   (0x01<<0)

Definition at line 277 of file asfont.h.

#define ASTA_VERSION_1   1

Definition at line 293 of file asfont.h.

#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 GLYPH_EOL   ((ASGlyph*)0x00000001)

Definition at line 151 of file asfont.h.

#define GLYPH_EOT   ((ASGlyph*)0x00000000)

Definition at line 152 of file asfont.h.

#define GLYPH_SPACE   ((ASGlyph*)0x00000002)

Definition at line 150 of file asfont.h.

#define GLYPH_TAB   ((ASGlyph*)0x00000003)

Definition at line 149 of file asfont.h.

#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

Definition at line 67 of file asfont.h.

Referenced by open_freetype_font_int().

#define MAX_SPECIAL_GLYPH   ((ASGlyph*)0x00000003)

Definition at line 148 of file asfont.h.


Enumeration Type Documentation

enum ASCharType

Definition at line 263 of file asfont.h.

enum ASFontType

Definition at line 81 of file asfont.h.

enum ASText3DType

Definition at line 249 of file asfont.h.


Function Documentation

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* dup_asfont ( ASFont font  ) 

Definition at line 341 of file asfont.c.

References ASFont::fontman, NULL, and ASFont::ref_count.

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().

Bool get_asfont_glyph_spacing ( ASFont font,
int *  x,
int *  y 
)

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 
)

Definition at line 243 of file asfont.c.

References open_freetype_font_int().

struct ASFont* open_X11_font ( struct ASFontManager fontman,
const char *  font_string 
)

Definition at line 280 of file asfont.c.

References open_X11_font_int().

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.

void print_asglyph ( FILE *  stream,
struct ASFont font,
unsigned long  c 
)

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().

Bool set_asfont_glyph_spacing ( ASFont font,
int  x,
int  y 
)

Definition at line 2168 of file asfont.c.

References False, ASFont::spacing_x, ASFont::spacing_y, and True.

Referenced by handle_asxml_tag_text().


Generated on Tue Jul 5 15:57:44 2011 for ROOT_528-00b_version by  doxygen 1.5.1