Picasso API 2.5

Data Structures

struct  _ps_font_info
 A structure that contains font information. More...
 

Typedefs

typedef enum _ps_charset ps_charset
 Charset for a font.
 
typedef enum _ps_font_weight ps_font_weight
 Font weight.
 
typedef struct _ps_font_info ps_font_info
 A structure that contains font information.
 

Enumerations

enum  _ps_charset { CHARSET_ANSI , CHARSET_UNICODE }
 Charset for a font. More...
 
enum  _ps_font_weight { FONT_WEIGHT_REGULAR = 400 , FONT_WEIGHT_MEDIUM = 500 , FONT_WEIGHT_BOLD = 700 , FONT_WEIGHT_HEAVY = 900 }
 Font weight. More...
 

Functions

PEXPORT ps_font *PICAPI ps_font_create (const char *name, ps_charset charset, float size, int weight, ps_bool italic)
 Create a font object using the given parameters.
 
PEXPORT ps_font *PICAPI ps_font_create_copy (const ps_font *font)
 Create a copy from an existing font object.
 
PEXPORT ps_font *PICAPI ps_font_ref (ps_font *font)
 Increases the reference count of the font by 1.
 
PEXPORT void PICAPI ps_font_unref (ps_font *font)
 Decrements the reference count for the font object. If the reference count on the font falls to 0, the font is freed.
 
PEXPORT void PICAPI ps_font_set_size (ps_font *font, float size)
 Set size for a font object.
 
PEXPORT void PICAPI ps_font_set_weight (ps_font *font, int weight)
 Set weight for a font object.
 
PEXPORT void PICAPI ps_font_set_italic (ps_font *font, ps_bool italic)
 Set italic for a font object.
 
PEXPORT void PICAPI ps_font_set_charset (ps_font *font, ps_charset charset)
 Set charset for a font object.
 
PEXPORT void PICAPI ps_font_set_hint (ps_font *font, ps_bool hint)
 Set hiting for a font object.
 
PEXPORT void PICAPI ps_font_set_flip (ps_font *font, ps_bool flip)
 Set flip for a font object.
 
PEXPORT ps_bool PICAPI ps_get_font_info (ps_context *ctx, ps_font_info *info)
 Return the font information from the graphics context.
 
PEXPORT ps_font *PICAPI ps_set_font (ps_context *ctx, const ps_font *font)
 Set a new font to graphics context.
 

Detailed Description

Enumeration Type Documentation

◆ _ps_charset

Charset for a font.

Enumerator
CHARSET_ANSI 

Ansi ISO-8859-x charset

CHARSET_UNICODE 

Unicode UCS-2 charset

Definition at line 1919 of file picasso.h.

◆ _ps_font_weight

Font weight.

Enumerator
FONT_WEIGHT_REGULAR 

Regular weight.

FONT_WEIGHT_MEDIUM 

Medium weight.

FONT_WEIGHT_BOLD 

Bold weight.

FONT_WEIGHT_HEAVY 

Heavy weight.

Definition at line 1933 of file picasso.h.

Function Documentation

◆ ps_font_create()

PEXPORT ps_font *PICAPI ps_font_create ( const char * name,
ps_charset charset,
float size,
int weight,
ps_bool italic )

Create a font object using the given parameters.

Parameters
nameThe font family name.
charsetThe charset type.
sizeThe font size.
weightThe font weight.
italicWhether or not it is italic.
Returns
If the function succeeds, the return value is the pointer to a new font object. If the function fails, the return value is NULL.
Note
To get extended error information, call ps_last_status.
See also
ps_font_create_copy, ps_font_ref, ps_font_unref

◆ ps_font_create_copy()

PEXPORT ps_font *PICAPI ps_font_create_copy ( const ps_font * font)

Create a copy from an existing font object.

Parameters
fontPointer to an existing font object.
Returns
If the function succeeds, the return value is the pointer to a new font object. If the function fails, the return value is NULL.
Note
To get extended error information, call ps_last_status.
See also
ps_font_create, ps_font_ref, ps_font_unref

◆ ps_font_ref()

PEXPORT ps_font *PICAPI ps_font_ref ( ps_font * font)

Increases the reference count of the font by 1.

Parameters
fontPointer to an existing font object.
Returns
If the function succeeds, the return value is the pointer to the font object. If the function fails, the return value is NULL.
Note
To get extended error information, call ps_last_status.
See also
ps_font_create, ps_font_create_copy, ps_font_unref

◆ ps_font_set_charset()

PEXPORT void PICAPI ps_font_set_charset ( ps_font * font,
ps_charset charset )

Set charset for a font object.

Parameters
fontPointer to an existing font object.
charsetCharset for the font.
See also
ps_font_set_size, ps_font_set_weight, ps_font_set_italic, ps_font_set_hint, ps_font_set_flip

◆ ps_font_set_flip()

PEXPORT void PICAPI ps_font_set_flip ( ps_font * font,
ps_bool flip )

Set flip for a font object.

Parameters
fontPointer to an existing font object.
flipWhether or not flip y for the font. (False default)
See also
ps_font_set_size, ps_font_set_weight, ps_font_set_italic, ps_font_set_charset, ps_font_set_hint

◆ ps_font_set_hint()

PEXPORT void PICAPI ps_font_set_hint ( ps_font * font,
ps_bool hint )

Set hiting for a font object.

Parameters
fontPointer to an existing font object.
hintWhether or not auto hiting for the font. (True default)
See also
ps_font_set_size, ps_font_set_weight, ps_font_set_italic, ps_font_set_charset, ps_font_set_flip

◆ ps_font_set_italic()

PEXPORT void PICAPI ps_font_set_italic ( ps_font * font,
ps_bool italic )

Set italic for a font object.

Parameters
fontPointer to an existing font object.
italicWhether or not italic for the font. (False default)
See also
ps_font_set_size, ps_font_set_weight, ps_font_set_charset, ps_font_set_hint, ps_font_set_flip

◆ ps_font_set_size()

PEXPORT void PICAPI ps_font_set_size ( ps_font * font,
float size )

Set size for a font object.

Parameters
fontPointer to an existing font object.
sizeSize for the font.
See also
ps_font_set_weight, ps_font_set_italic, ps_font_set_charset, ps_font_set_hint, ps_font_set_flip

◆ ps_font_set_weight()

PEXPORT void PICAPI ps_font_set_weight ( ps_font * font,
int weight )

Set weight for a font object.

Parameters
fontPointer to an existing font object.
weightWeight for the font.
See also
ps_font_set_size, ps_font_set_italic, ps_font_set_charset, ps_font_set_hint, ps_font_set_flip

◆ ps_font_unref()

PEXPORT void PICAPI ps_font_unref ( ps_font * font)

Decrements the reference count for the font object. If the reference count on the font falls to 0, the font is freed.

Parameters
fontPointer to an existing font object.
See also
ps_font_create, ps_font_create_copy, ps_font_ref

◆ ps_get_font_info()

PEXPORT ps_bool PICAPI ps_get_font_info ( ps_context * ctx,
ps_font_info * info )

Return the font information from the graphics context.

Parameters
ctxPointer to an existing context object.
infoPointer to a structure to receiving the font information.
Returns
True if is success, otherwise False.
See also
ps_set_font

◆ ps_set_font()

PEXPORT ps_font *PICAPI ps_set_font ( ps_context * ctx,
const ps_font * font )

Set a new font to graphics context.

Parameters
ctxPointer to an existing context object.
fontThe new font to be set.
Returns
If the function succeeds, the return value is the pointer to old font object. If the function fails, the return value is NULL.
Note
To get extended error information, call ps_last_status.
See also
ps_get_font_info