Atrinik Client  4.0
Data Structures | Macros | Typedefs
text.h File Reference

Go to the source code of this file.

Data Structures

struct  font_struct
 
struct  text_info_struct
 

Macros

#define FONT(font_name, font_size)   font_get_weak(font_name, font_size)
 
#define FONT_INCREF(font)   (font)->ref++;
 
#define FONT_DECREF(font)   (font)->ref--;
 
#define FONT_GC_MAX_TIME   100000
 
#define FONT_GC_CHANCE   500
 
#define FONT_GC_FREE_TIME   60 * 30
 
#define FONT_SANS7   FONT("sans", 7)
 
#define FONT_SANS8   FONT("sans", 8)
 
#define FONT_SANS9   FONT("sans", 9)
 
#define FONT_SANS10   FONT("sans", 10)
 
#define FONT_SANS11   FONT("sans", 11)
 
#define FONT_SANS12   FONT("sans", 12)
 
#define FONT_SANS13   FONT("sans", 13)
 
#define FONT_SANS14   FONT("sans", 14)
 
#define FONT_SANS15   FONT("sans", 15)
 
#define FONT_SANS16   FONT("sans", 16)
 
#define FONT_SANS18   FONT("sans", 18)
 
#define FONT_SANS20   FONT("sans", 20)
 
#define FONT_SERIF8   FONT("serif", 8)
 
#define FONT_SERIF10   FONT("serif", 10)
 
#define FONT_SERIF12   FONT("serif", 12)
 
#define FONT_SERIF14   FONT("serif", 14)
 
#define FONT_SERIF16   FONT("serif", 16)
 
#define FONT_SERIF18   FONT("serif", 18)
 
#define FONT_SERIF20   FONT("serif", 20)
 
#define FONT_SERIF22   FONT("serif", 22)
 
#define FONT_SERIF24   FONT("serif", 24)
 
#define FONT_SERIF26   FONT("serif", 26)
 
#define FONT_SERIF28   FONT("serif", 28)
 
#define FONT_SERIF30   FONT("serif", 30)
 
#define FONT_SERIF32   FONT("serif", 32)
 
#define FONT_SERIF34   FONT("serif", 34)
 
#define FONT_SERIF36   FONT("serif", 36)
 
#define FONT_SERIF38   FONT("serif", 38)
 
#define FONT_SERIF40   FONT("serif", 40)
 
#define FONT_MONO8   FONT("mono", 8)
 
#define FONT_MONO9   FONT("mono", 9)
 
#define FONT_MONO10   FONT("mono", 10)
 
#define FONT_MONO12   FONT("mono", 12)
 
#define FONT_MONO14   FONT("mono", 14)
 
#define FONT_MONO16   FONT("mono", 16)
 
#define FONT_MONO18   FONT("mono", 18)
 
#define FONT_MONO20   FONT("mono", 20)
 
#define FONT_ARIAL8   FONT("arial", 8)
 
#define FONT_ARIAL10   FONT("arial", 10)
 
#define FONT_ARIAL11   FONT("arial", 11)
 
#define FONT_ARIAL12   FONT("arial", 12)
 
#define FONT_ARIAL13   FONT("arial", 13)
 
#define FONT_ARIAL14   FONT("arial", 14)
 
#define FONT_ARIAL15   FONT("arial", 15)
 
#define FONT_ARIAL16   FONT("arial", 16)
 
#define FONT_ARIAL18   FONT("arial", 18)
 
#define FONT_ARIAL20   FONT("arial", 20)
 
#define TEXT_MARKUP   1
 
#define TEXT_WORD_WRAP   2
 
#define TEXT_SOLID   4
 
#define TEXT_ALIGN_CENTER   8
 
#define TEXT_HEIGHT   16
 
#define TEXT_VALIGN_CENTER   32
 
#define TEXT_NO_COLOR_CHANGE   64
 
#define TEXT_OUTLINE   128
 
#define TEXT_LINES_CALC   256
 
#define TEXT_LINES_SKIP   512
 
#define TEXT_NO_FONT_CHANGE   1024
 
#define TEXT_WIDTH   2048
 
#define TEXT_MAX_WIDTH   4096
 
#define TEXT_FLIP_HORIZONTAL   1
 
#define TEXT_FLIP_VERTICAL   2
 
#define TEXT_FLIP_BOTH   (TEXT_FLIP_HORIZONTAL | TEXT_FLIP_VERTICAL)
 
#define COLOR_WHITE   "ffffff"
 
#define COLOR_ORANGE   "ff9900"
 
#define COLOR_NAVY   "00ffff"
 
#define COLOR_RED   "ff3030"
 
#define COLOR_GREEN   "00ff00"
 
#define COLOR_BLUE   "0080ff"
 
#define COLOR_GRAY   "999999"
 
#define COLOR_BROWN   "c07f40"
 
#define COLOR_PURPLE   "cc66ff"
 
#define COLOR_PINK   "ff9999"
 
#define COLOR_YELLOW   "ffff33"
 
#define COLOR_DK_NAVY   "00c4c2"
 
#define COLOR_DK_GREEN   "006600"
 
#define COLOR_DK_ORANGE   "ff6600"
 
#define COLOR_BRIGHT_PURPLE   "ff66ff"
 
#define COLOR_HGOLD   "d4d553"
 
#define COLOR_DGOLD   "999900"
 
#define COLOR_BLACK   "000000"
 
#define FONT_HEIGHT(font)   ((font)->height)
 
#define FONT_TRY_INFO(_font, _info, _surface)   ((_info).calc_font != NULL && !(_surface) && !(_info).obscured ? (_info).calc_font : (_font))
 

Typedefs

typedef struct font_struct font_struct
 
typedef struct text_info_struct text_info_struct
 
typedef int(* text_anchor_handle_func )(const char *anchor_action, const char *buf, size_t len, void *custom_data)
 

Detailed Description

Header file for text drawing API.

Definition in file text.h.

Macro Definition Documentation

#define FONT (   font_name,
  font_size 
)    font_get_weak(font_name, font_size)

Shortcut macro for getting a weak reference to the specified font.

Definition at line 63 of file text.h.

#define FONT_DECREF (   font)    (font)->ref--;

Decrease reference count of the specified font.

Warning
Only use this if you know exactly what you're doing; almost always you should use font_free() instead.

Definition at line 73 of file text.h.

#define FONT_GC_CHANCE   500

The font_gc() routine will execute once in X number of times.

Definition at line 83 of file text.h.

#define FONT_GC_FREE_TIME   60 * 30

Number of seconds that must pass after the last registered usage of a font before it's garbage-collected.

Definition at line 88 of file text.h.

#define FONT_GC_MAX_TIME   100000

Maximum amount of time the font_gc() function can spend attempting to free fonts.

Definition at line 79 of file text.h.

#define FONT_HEIGHT (   font)    ((font)->height)

Get font's maximum height.

Definition at line 327 of file text.h.

#define FONT_INCREF (   font)    (font)->ref++;

Increase reference count of the specified font.

Definition at line 67 of file text.h.

Typedef Documentation

typedef struct font_struct font_struct

One font.

typedef int(* text_anchor_handle_func)(const char *anchor_action, const char *buf, size_t len, void *custom_data)

Anchor handler function to try and execute before the defaults.

Parameters
anchor_actionThe action to execute, which can be empty (but not NULL) - for example, 'help'.
bufText to pass to the action decided by the anchor action; in case of links, the URL to open, for example. Will not contain any markup, and should not be freed.
lenLength of 'buf'.
custom_dataUser-supplied data. Can be NULL.
Returns
1 if handled the action and should not handle it using default actions, 0 otherwise.

Definition at line 348 of file text.h.

Structure that holds information about markup and other things when drawing.