Typedefs | |
typedef struct _jfont | t_jfont |
An instance of a jgraphics font. | |
Enumerations | |
enum | t_jgraphics_font_slant { JGRAPHICS_FONT_SLANT_NORMAL, JGRAPHICS_FONT_SLANT_ITALIC } |
Enumeration of slanting options for font display. More... | |
enum | t_jgraphics_font_weight { JGRAPHICS_FONT_WEIGHT_NORMAL, JGRAPHICS_FONT_WEIGHT_BOLD } |
Enumeration of font weight options for font display. More... | |
Functions | |
t_jfont * | jfont_create (const char *family, t_jgraphics_font_slant slant, t_jgraphics_font_weight weight, double size) |
Create a new font object. | |
t_jfont * | jfont_reference (t_jfont *font) |
Create new reference to an existing font object. | |
void | jfont_destroy (t_jfont *font) |
Release or free a font object. | |
long | jfont_isequalto (t_jfont *font, t_jfont *other) |
Compare two fonts to see if they are equivalent. | |
void | jfont_set_font_size (t_jfont *font, double size) |
Set the size of a font object. | |
void | jfont_set_underline (t_jfont *font, char ul) |
Set the underlining of a font object. | |
void | jfont_extents (t_jfont *font, t_jgraphics_font_extents *extents) |
Get extents of this font. | |
void | jfont_text_measure (t_jfont *font, const char *utf8, double *width, double *height) |
Given a font, find out how much area is required to render a string of text. | |
void | jfont_text_measuretext_wrapped (t_jfont *font, const char *utf8, double wrapwidth, long includewhitespace, double *width, double *height, long *numlines) |
Given a font, find out how much area is required to render a string of text, provided a horizontal maximum limit at which the text is wrapped. | |
void | jfont_get_em_dimensions (t_jfont *font, double *width, double *height) |
Given a font, find out the width and height of the 'M' character. | |
t_max_err | jfont_getfontlist (long *count, t_symbol ***list) |
Get a list of font names. | |
long | jbox_get_font_weight (t_object *b) |
Get the slant box's font. | |
long | jbox_get_font_slant (t_object *b) |
Get the slant box's font. |
long jbox_get_font_slant | ( | t_object * | b | ) |
Get the slant box's font.
b | An object's box. |
long jbox_get_font_weight | ( | t_object * | b | ) |
Get the slant box's font.
b | An object's box. |
t_jfont* jfont_create | ( | const char * | family, |
t_jgraphics_font_slant | slant, | ||
t_jgraphics_font_weight | weight, | ||
double | size | ||
) |
Create a new font object.
family | The name of the font family (e.g. Arial). |
slant | The type of slant for the font. |
weight | The type of weight for the font. |
size | The size of the font. |
void jfont_destroy | ( | t_jfont * | font | ) |
Release or free a font object.
font | The font object to release. |
void jfont_extents | ( | t_jfont * | font, |
t_jgraphics_font_extents * | extents | ||
) |
Get extents of this font.
font | The font object. |
extents | The font extents upon return/ |
void jfont_get_em_dimensions | ( | t_jfont * | font, |
double * | width, | ||
double * | height | ||
) |
Given a font, find out the width and height of the 'M' character.
This is equivalent to jfont_text_measure(font, "M", width, height) but is faster.
font | The font object. |
width | The address of a variable to hold the width upon return. |
height | The address of a variable to hold the height upon return. |
Get a list of font names.
count | The addres of a variable to hold the count of font names in list upon return. |
list | The address of a t_symbol** initialized to NULL. Upon return this will be set to an array of count t_symbol pointers. This array should be freed using sysmem_freeptr() when you are done with it. |
Compare two fonts to see if they are equivalent.
font | The first font object that is being compared. |
other | The second font object that is being compared. |
Create new reference to an existing font object.
font | The font object for which to obtain a reference. |
void jfont_set_font_size | ( | t_jfont * | font, |
double | size | ||
) |
Set the size of a font object.
font | The font object. |
size | The new size for the font object. |
void jfont_set_underline | ( | t_jfont * | font, |
char | ul | ||
) |
Set the underlining of a font object.
font | The font object. |
ul | Pass true to underline, or false for no underlining. |
void jfont_text_measure | ( | t_jfont * | font, |
const char * | utf8, | ||
double * | width, | ||
double * | height | ||
) |
Given a font, find out how much area is required to render a string of text.
font | The font object. |
utf8 | The text whose rendering will be measured. |
width | The address of a variable to hold the width upon return. |
height | The address of a variable to hold the height upon return. |
void jfont_text_measuretext_wrapped | ( | t_jfont * | font, |
const char * | utf8, | ||
double | wrapwidth, | ||
long | includewhitespace, | ||
double * | width, | ||
double * | height, | ||
long * | numlines | ||
) |
Given a font, find out how much area is required to render a string of text, provided a horizontal maximum limit at which the text is wrapped.
font | The font object. |
utf8 | The text whose rendering will be measured. |
wrapwidth | The maximum width, above which text should wrap onto a new line. |
includewhitespace | If non-zero, include whitespace in the measurement. |
width | The address of a variable to hold the width upon return. |
height | The address of a variable to hold the height upon return. |
numlines | The address of a variable to hold the number of lines of text after wrapping upon return. |