Document Fl::set_font(Fl_Font, const char *) with platform-specific details.

This commit is contained in:
ManoloFLTK 2022-03-10 19:06:46 +01:00
parent 5b26d2b203
commit e8461a6191

View File

@ -29,8 +29,18 @@ extern FL_EXPORT Fl_Fontdesc *fl_fonts; // the table
static int table_size;
/**
Changes a face. The string pointer is simply stored,
the string is not copied, so the string must be in static memory.
Changes a face.
\param fnum The font number to be assigned a new face
\param name Name of the font to assign. The string pointer is simply stored,
the string is not copied, so the string must be in static memory. The exact name to be used
depends on the platform :
\li Windows, X11, Xft: use the family name prefixed by one character to indicate the desired font variant.
Characters <tt>' ', 'I', 'B', 'P' </tt>denote plain, italic, bold, and bold-italic variants, respectively. For example,
string \c "IGabriola" is to be used to denote the <tt>"Gabriola italic"</tt> font. The \c "Oblique" suffix,
in whatever case, is to be treated as \c "italic", that is, prefix the family name with \c 'I'.
\li Other platforms, i.e., X11 + Pango, Wayland, macOS: use the full font name as returned by
function Fl::get_font_name() or as listed by applications test/fonts or test/utf8. No prefix is to be added.
*/
void Fl::set_font(Fl_Font fnum, const char* name) {
Fl_Graphics_Driver &d = Fl_Graphics_Driver::default_driver();