diff options
author | inmarket <inmarket@ugfx.org> | 2016-11-14 09:15:51 +1000 |
---|---|---|
committer | inmarket <inmarket@ugfx.org> | 2016-11-14 09:15:51 +1000 |
commit | 7f79b89eda65e2529128710168a5b1de431ff7f0 (patch) | |
tree | 10abbb813ca37e5ce86f763edd2446b00a905e87 /src/gdisp/gdisp.h | |
parent | 9ad9472662aaee8076df420014ef426c2c7c1879 (diff) | |
download | uGFX-7f79b89eda65e2529128710168a5b1de431ff7f0.tar.gz uGFX-7f79b89eda65e2529128710168a5b1de431ff7f0.tar.bz2 uGFX-7f79b89eda65e2529128710168a5b1de431ff7f0.zip |
Add support for adding fonts to the font list
Diffstat (limited to 'src/gdisp/gdisp.h')
-rw-r--r-- | src/gdisp/gdisp.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gdisp/gdisp.h b/src/gdisp/gdisp.h index 98a1363b..7878233e 100644 --- a/src/gdisp/gdisp.h +++ b/src/gdisp/gdisp.h @@ -1053,6 +1053,8 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co * @details Allocates memory for new font metadata using gfxAlloc, remember to close font after use! * @return A new font or NULL if out of memory. * @pre GDISP_NEED_TEXT must be TRUE in your gfxconf.h + * @note A scaled font should probably not be added to the font list as it will prevent the + * unscaled font of the same name being found as it will be the scaled version that will be found. * * @param[in] font The base font to use. * @param[in] scale_x The scale factor in horizontal direction. @@ -1070,6 +1072,17 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co * @api */ const char *gdispGetFontName(font_t font); + + /** + * @brief Add a font permanently to the font list. + * @returns TRUE on success. Reasons it may fail: out of memory, if it is already on the list, it is not a font loaded in RAM. + * @pre GDISP_NEED_TEXT must be TRUE in your gfxconf.h + * + * @param[in] font The font to add to the font list. + * + * @api + */ + bool_t gdispAddFont(font_t font); #endif /* Extra Arc Functions */ |