Skip to content

Commit e8461a6

Browse files
committed
Document Fl::set_font(Fl_Font, const char *) with platform-specific details.
1 parent 5b26d2b commit e8461a6

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/fl_set_font.cxx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,18 @@ extern FL_EXPORT Fl_Fontdesc *fl_fonts; // the table
2929

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

0 commit comments

Comments
 (0)