diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 1998-12-02 15:51:38 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 1998-12-02 15:51:38 +0000 |
| commit | beb210d4d4ea2550fcc9de5a610b8fe6d9afc631 (patch) | |
| tree | f792a964cfdc82e9de4fd838be0c58282eefbbd5 /src/fl_font_win32.cxx | |
| parent | c061230dc7ba0d14dcfa96dedb59f34f6a16d378 (diff) | |
Font changes from Bill.
git-svn-id: file:///fltk/svn/fltk/trunk@109 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/fl_font_win32.cxx')
| -rw-r--r-- | src/fl_font_win32.cxx | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/fl_font_win32.cxx b/src/fl_font_win32.cxx index c37acac17..8138b069e 100644 --- a/src/fl_font_win32.cxx +++ b/src/fl_font_win32.cxx @@ -1,5 +1,5 @@ // -// "$Id: fl_font_win32.cxx,v 1.6 1998/12/02 15:39:36 mike Exp $" +// "$Id: fl_font_win32.cxx,v 1.7 1998/12/02 15:51:36 mike Exp $" // // WIN32 font selection routines for the Fast Light Tool Kit (FLTK). // @@ -33,7 +33,7 @@ #include <stdlib.h> #include <string.h> -Fl_XFont::Fl_XFont(const char *name, int size, int num) { +Fl_FontSize::Fl_FontSize(const char* name, int size) { int weight = FW_NORMAL; int italic = 0; switch (*name++) { @@ -68,13 +68,12 @@ Fl_XFont::Fl_XFont(const char *name, int size, int num) { #if HAVE_GL listbase = 0; #endif - number = num; minsize = maxsize = size; } -Fl_XFont *fl_current_xfont; +Fl_FontSize* fl_current_xfont; -Fl_XFont::~Fl_XFont() { +Fl_FontSize::~Fl_FontSize() { #if HAVE_GL // Delete list created by gl_draw(). This is not done by this code // as it will link in GL unnecessarily. There should be some kind @@ -113,15 +112,15 @@ static Fl_Fontdesc built_in_table[] = { {" Wingdings"}, }; -Fl_Fontdesc *fl_fonts = built_in_table; +Fl_Fontdesc* fl_fonts = built_in_table; -static Fl_XFont *find(int fnum, int size) { - Fl_Fontdesc *s = fl_fonts+fnum; +static Fl_FontSize* find(int fnum, int size) { + Fl_Fontdesc* s = fl_fonts+fnum; if (!s->name) s = fl_fonts; // use 0 if fnum undefined - Fl_XFont *f; + Fl_FontSize* f; for (f = s->first; f; f = f->next) if (f->minsize <= size && f->maxsize >= size) return f; - f = new Fl_XFont(s->name, size, fnum); + f = new Fl_FontSize(s->name, size); f->next = s->first; s->first = f; return f; @@ -148,13 +147,13 @@ int fl_descent() { return fl_current_xfont->metr.tmDescent; } -double fl_width(const char *c) { +double fl_width(const char* c) { double w = 0.0; while (*c) w += fl_current_xfont->width[uchar(*c++)]; return w; } -double fl_width(const char *c, int n) { +double fl_width(const char* c, int n) { double w = 0.0; while (n--) w += fl_current_xfont->width[uchar(*c++)]; return w; @@ -164,16 +163,16 @@ double fl_width(uchar c) { return fl_current_xfont->width[c]; } -void fl_draw(const char *str, int n, int x, int y) { +void fl_draw(const char* str, int n, int x, int y) { SetTextColor(fl_gc, fl_RGB()); SelectObject(fl_gc, fl_current_xfont->fid); TextOut(fl_gc, x, y, str, n); } -void fl_draw(const char *str, int x, int y) { +void fl_draw(const char* str, int x, int y) { fl_draw(str, strlen(str), x, y); } // -// End of "$Id: fl_font_win32.cxx,v 1.6 1998/12/02 15:39:36 mike Exp $". +// End of "$Id: fl_font_win32.cxx,v 1.7 1998/12/02 15:51:36 mike Exp $". // |
