2010-04-23 239 views

回答

0

假设你的意思是this Cimg库,几个draw_text的重载将采用名为“font”的参数。这些似乎是一个合理的起点......

1

不。CImg的文字图很简单。

CImg<T>& draw_text(const int x0, const int y0, 
        const char *const text, 
        const int, const tc *const background_color, 
        const float opacity, const CImgList<t>& font, ...) 

font只是一个字母CImgList(即font[letter-'a']是 “字母” 的图像)。要么让自己的或使用的内置选项之一:

static const CImgList<T>& font(const unsigned int font_height, 
           const bool variable_size=true); 

static CImgList<T> _font(const unsigned int *const font, 
         const unsigned int w, const unsigned int h, 
         const bool variable_size) 

其中font这里是CImg.h的顶部,如font12x24预定义的字体之一。

相关问题