Max API
8.2.0
|
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. More... | |
t_jfont * | jfont_create_withstylename (const char *family, const char *stylename, double size) |
Create a new font object using a style instead of style flags. More... | |
t_jfont * | jfont_reference (t_jfont *font) |
Create new reference to an existing font object. More... | |
void | jfont_destroy (t_jfont *font) |
Release or free a font object. More... | |
long | jfont_isequalto (t_jfont *font, t_jfont *other) |
Compare two fonts to see if they are equivalent. More... | |
void | jfont_set_family (t_jfont *font, t_symbol *family) |
Set the name of the font family (e.g. More... | |
t_symbol * | jfont_get_family (t_jfont *font) |
Get the name of the font family (e.g. More... | |
void | jfont_set_style (t_jfont *font, t_symbol *style) |
Set the style of a font family (e.g. More... | |
t_symbol * | jfont_get_style (t_jfont *font) |
Get the style of the given font (e.g. More... | |
void | jfont_set_slant (t_jfont *font, t_jgraphics_font_slant slant) |
Set the slant of the font. More... | |
t_jgraphics_font_slant | jfont_get_slant (t_jfont *font) |
Get the slant of the font. More... | |
void | jfont_set_weight (t_jfont *font, t_jgraphics_font_weight weight) |
Set the weight of the font. More... | |
t_jgraphics_font_weight | jfont_get_weight (t_jfont *font) |
Get the weight of the font. More... | |
void | jfont_set_font_size (t_jfont *font, double size) |
Set the size of a font object. More... | |
double | jfont_get_font_size (t_jfont *font) |
Get the size of a font object. More... | |
void | jfont_set_underline (t_jfont *font, char ul) |
Set the underlining of a font object. More... | |
char | jfont_get_underline (t_jfont *font) |
Get the underline state of a font object. More... | |
void | jfont_extents (t_jfont *font, t_jgraphics_font_extents *extents) |
Get extents of this font. More... | |
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. More... | |
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. More... | |
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. More... | |
t_max_err | jfont_getfontlist (long *count, t_symbol ***list) |
Get a list of font names. More... | |
t_max_err | jfont_getfontstylenames (t_symbol *fontname, long *count, t_symbol ***stylenames) |
Get a list of font styles available for a given font face. More... | |
void | jfont_normalizefontname (t_symbol *fontfacewithstyle, t_symbol **fontface, t_symbol **style) |
Given a font name with style appended separate into the component parts. More... | |
long | jbox_get_font_weight (t_object *b) |
Get the slant box's font. More... | |
long | jbox_get_font_slant (t_object *b) |
Get the slant box's font. More... | |
const char * | systemfontname (void) |
Retrieve the name of Max's system font. More... | |
const char * | systemfontname_bold (void) |
Retrieve the name of Max's bold system font. More... | |
const char * | systemfontname_light (void) |
Retrieve the name of Max's light system font. More... | |
t_symbol * | systemfontsym (void) |
Retrieve the name of Max's system font as a symbol. More... | |
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. |
t_jfont* jfont_create_withstylename | ( | const char * | family, |
const char * | stylename, | ||
double | size | ||
) |
Create a new font object using a style instead of style flags.
family | The name of the font family (e.g. Arial). |
stylename | The name of the font style (e.g. Narrow Bold Italic). |
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 the name of the font family (e.g.
Arial).
font | The font object. |
double jfont_get_font_size | ( | t_jfont * | font | ) |
Get the size of a font object.
font | The font object. |
t_jgraphics_font_slant jfont_get_slant | ( | t_jfont * | font | ) |
Get the slant of the font.
font | The font object. |
Get the style of the given font (e.g.
Narrow Bold Italic).
font | The font object. |
char jfont_get_underline | ( | t_jfont * | font | ) |
Get the underline state of a font object.
font | The font object. |
t_jgraphics_font_weight jfont_get_weight | ( | t_jfont * | font | ) |
Get the weight of the font.
font | The font object. |
Get a list of font names.
Note, this includes each font style in each font family.
count | The address 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. |
Get a list of font styles available for a given font face.
fontanme | A symbol with the name of the font whose styles are to be retrieved. |
count | The address of a variable to hold the count of font styles in the 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 b freed using sysmem_freptr() 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. |
void jfont_normalizefontname | ( | t_symbol * | fontfacewithstyle, |
t_symbol ** | fontface, | ||
t_symbol ** | style | ||
) |
Given a font name with style appended separate into the component parts.
(e.g. "Arial Narrow Bold Italic" -> "Arial" and "Narrow Bold Italic".
Create new reference to an existing font object.
font | The font object for which to obtain a reference. |
Set the name of the font family (e.g.
Arial).
font | The font object. |
family | A t_symbol containing the name of the desired font family. |
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_slant | ( | t_jfont * | font, |
t_jgraphics_font_slant | slant | ||
) |
Set the slant of the font.
font | The font object |
slant | The desired slant. |
Set the style of a font family (e.g.
Narrow Bold Italic).
font | The font object. |
style | The desired style. |
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_set_weight | ( | t_jfont * | font, |
t_jgraphics_font_weight | weight | ||
) |
Set the weight of the font.
font | The font object |
weight | The desired weight (e.g. bold). |
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. |
const char* systemfontname | ( | void | ) |
Retrieve the name of Max's system font.
const char* systemfontname_bold | ( | void | ) |
Retrieve the name of Max's bold system font.
const char* systemfontname_light | ( | void | ) |
Retrieve the name of Max's light system font.
t_symbol* systemfontsym | ( | void | ) |
Retrieve the name of Max's system font as a symbol.