GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Enumerations | Functions
gp_fonts.h File Reference

A font lookup functions. More...

#include <text/gp_font.h>

Go to the source code of this file.

Data Structures

struct  gp_fonts_iter
 Font family iterator. More...
 

Macros

#define GP_FONT_FAMILY_FOREACH(iter, family)
 A loop over all compiled in fonts.
 

Typedefs

typedef struct gp_fonts_iter gp_fonts_iter
 Font family iterator.
 

Enumerations

enum  gp_fonts_iter_dir {
  GP_FONTS_ITER_NOP = 0 , GP_FONTS_ITER_PREV = -1 , GP_FONTS_ITER_NEXT = 1 , GP_FONTS_ITER_FIRST = -2 ,
  GP_FONTS_ITER_LAST = 2
}
 An iterator direction. More...
 

Functions

const gp_font_familygp_font_family_lookup (const char *family_name)
 Font family lookup.
 
const gp_font_facegp_font_family_face_lookup (const gp_font_family *family, uint8_t style)
 Looks up a font face in a family given a style flags.
 
const gp_font_facegp_font_face_lookup (const char *family_name, uint8_t style)
 Looks up a font face in a family given a family name and style flags.
 
const gp_font_facegp_fonts_iter_font (gp_fonts_iter *iter, int wrap, enum gp_fonts_iter_dir dir)
 Iterates over all compiled in fonts.
 
const gp_font_familygp_fonts_iter_family (gp_fonts_iter *iter, int wrap, enum gp_fonts_iter_dir dir)
 Iterates over all compiled in families.
 

Detailed Description

A font lookup functions.

Functions to lookup compiled-in fonts.

Definition in file gp_fonts.h.

Enumeration Type Documentation

◆ gp_fonts_iter_dir

An iterator direction.

Enumerator
GP_FONTS_ITER_NOP 

No action.

GP_FONTS_ITER_PREV 

Move to previous.

GP_FONTS_ITER_NEXT 

Move to next.

GP_FONTS_ITER_FIRST 

Move to first.

GP_FONTS_ITER_LAST 

Move to last.

Definition at line 65 of file gp_fonts.h.

Function Documentation

◆ gp_font_face_lookup()

const gp_font_face * gp_font_face_lookup ( const char *  family_name,
uint8_t  style 
)

Looks up a font face in a family given a family name and style flags.

Parameters
family_nameA family name such as 'gfxprim', 'tiny', etc.
styleA bitmask of enum gp_font_style. If GP_FONT_FALLBACK is passed the function never returns NULL.
Returns
A pointer to a font family or NULL if not found.

◆ gp_font_family_face_lookup()

const gp_font_face * gp_font_family_face_lookup ( const gp_font_family family,
uint8_t  style 
)

Looks up a font face in a family given a style flags.

If family pointer is a null default 'gfxprim' family is used instead.

Parameters
familyA pointer to a font family. If NULL is passed default is used.
styleA bitmask of enum gp_font_style. If GP_FONT_FALLBACK is passed the function never returns NULL.
Returns
A pointer to a font or NULL if not found.

◆ gp_font_family_lookup()

const gp_font_family * gp_font_family_lookup ( const char *  family_name)

Font family lookup.

Looks up a font family by a family name in the compiled in fonts.

Parameters
family_nameA family name, such as 'gfxprim', 'tiny', etc.
Returns
A pointer to a font family or NULL if not found.

◆ gp_fonts_iter_family()

const gp_font_family * gp_fonts_iter_family ( gp_fonts_iter iter,
int  wrap,
enum gp_fonts_iter_dir  dir 
)

Iterates over all compiled in families.

Parameters
iterAn iterator.
wrapIf non zero makes the iteration circular, i.e. NULL is not returned at the end.
dirDirection to move to.
Returns
Current font family.

◆ gp_fonts_iter_font()

const gp_font_face * gp_fonts_iter_font ( gp_fonts_iter iter,
int  wrap,
enum gp_fonts_iter_dir  dir 
)

Iterates over all compiled in fonts.

Parameters
iterAn iterator.
wrapIf non zero makes the iteration circular, i.e. NULL is not returned at the end.
dirDirection to move to.
Returns
A font face.