Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Font.win32.h

00001 /*
00002   File: Font.h
00003 
00004   Copyright(C) C. Kotterink, Computed Graphics
00005 */
00006 #ifndef FONT_H
00007 #define FONT_H
00008 
00009 #include<windows.h>
00010 #include<string>
00011 
00012 class GLWindow;
00013 
00017 class Font
00018 {
00019     friend GLWindow;
00020 public:
00022     static void setFont(Font *font) {
00023         defaultFont = font;
00024     }
00025 
00027     static Font *getFont() {
00028         return defaultFont;
00029     }
00030 
00032     static int getDefaultFontWidth() {
00033         return fontWidth;
00034     }
00035 
00037     static int getDefaultFontHeight() {
00038         return fontWidth;
00039     }
00040 
00042     virtual ~Font();
00043 
00045     void printf(int x, int y, int width, const char *fmt, ...);
00046 
00048     void print(int x, int y, int width, const string &text) {
00049         print(x, y, width, text.begin(), text.size());
00050     }
00051 
00053     void print(
00054         int x, int y, int width, const char *str, int size);
00055 
00056 protected:
00058     Font(HDC dc);
00059 
00061     static Font *defaultFont;
00062 
00064     static int fontHeight;
00065 
00067     static int fontWidth;
00068 
00070     int base;
00071 };
00072 #endif

This documentation was generated using doxygen. If you have any comments or additions please mail me.