2 // "$Id: fl_font.cxx 8722 2011-05-23 16:06:13Z ianmacarthur $"
4 // Font selection code for the Fast Light Tool Kit (FLTK).
6 // Copyright 1998-2010 by Bill Spitzak and others.
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Library General Public
10 // License as published by the Free Software Foundation; either
11 // version 2 of the License, or (at your option) any later version.
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Library General Public License for more details.
18 // You should have received a copy of the GNU Library General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23 // Please report all bugs and problems on the following page:
25 // http://www.fltk.org/str.php
29 # ifndef WIN32_LEAN_AND_MEAN
30 # define WIN32_LEAN_AND_MEAN
32 /* We require Windows 2000 features such as GetGlyphIndices */
33 # if !defined(WINVER) || (WINVER < 0x0500)
37 # define WINVER 0x0500
39 # if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500)
43 # define _WIN32_WINNT 0x0500
47 // Select fonts from the FLTK font table.
50 #include <FL/fl_draw.H>
58 # include "fl_font_win32.cxx"
59 #elif defined(__APPLE__)
60 # include "fl_font_mac.cxx"
62 # include "fl_font_xft.cxx"
64 # include "fl_font_x.cxx"
68 double fl_width(const char* c
) {
69 if (c
) return fl_width(c
, strlen(c
));
73 void fl_draw(const char* str
, int x
, int y
) {
74 fl_draw(str
, strlen(str
), x
, y
);
77 void fl_draw(int angle
, const char* str
, int x
, int y
) {
78 fl_draw(angle
, str
, strlen(str
), x
, y
);//must be fixed!
81 void fl_text_extents(const char *c
, int &dx
, int &dy
, int &w
, int &h
) {
82 if (c
) fl_text_extents(c
, strlen(c
), dx
, dy
, w
, h
);
90 void fl_draw(const char* str
, int l
, float x
, float y
) {
92 fl_graphics_driver
->draw(str
, l
, x
, y
);
94 fl_draw(str
, l
, (int)x
, (int)y
);
98 // End of "$Id: fl_font.cxx 8722 2011-05-23 16:06:13Z ianmacarthur $".