// -*- C++ -*- /* * font.cc: * Simple bitmap font rendering example. * * written by Naofumi Yasufuku <naofumi@users.sourceforge.net> */ #include <iostream> #include <cstdlib> #include <gtkmm.h> #include <gtkglmm.h> #ifdef G_OS_WIN32 #define WIN32_LEAN_AND_MEAN 1 #include <windows.h> #endif #include <GL/gl.h> #include <GL/glu.h> // // OpenGL frame buffer configuration utilities. // struct GLConfigUtil { static void print_gl_attrib(const Glib::RefPtr<const Gdk::GL::Config>& glconfig, const char* attrib_str, int attrib, bool is_boolean); static void examine_gl_attrib(const Glib::RefPtr<const Gdk::GL::Config>& glconfig); }; // // Print a configuration attribute. // void GLConfigUtil::print_gl_attrib(const Glib::RefPtr<const Gdk::GL::Config>& glconfig, const char* attrib_str, int attrib, bool is_boolean) { int value; if (glconfig->get_attrib(attrib, value)) { std::cout << attrib_str << " = "; if (is_boolean) std::cout << (value == true ? "true" : "false") << std::endl; else std::cout << value << std::endl; } else { std::cout << "*** Cannot get " << attrib_str << " attribute value\n"; } } // // Print configuration attributes. // void GLConfigUtil::examine_gl_attrib(const Glib::RefPtr<const Gdk::GL::Config>& glconfig) { std::cout << "\nOpenGL visual configurations :\n\n"; std::cout << "glconfig->is_rgba() = " << (glconfig->is_rgba() ? "true" : "false") << std::endl; std::cout << "glconfig->is_double_buffered() = " << (glconfig->is_double_buffered() ? "true" : "false") << std::endl; std::cout << "glconfig->is_stereo() = " << (glconfig->is_stereo() ? "true" : "false") << std::endl; std::cout << "glconfig->has_alpha() = " << (glconfig->has_alpha() ? "true" : "false") << std::endl; std::cout << "glconfig->has_depth_buffer() = " << (glconfig->has_depth_buffer() ? "true" : "false") << std::endl; std::cout << "glconfig->has_stencil_buffer() = " << (glconfig->has_stencil_buffer() ? "true" : "false") << std::endl; std::cout << "glconfig->has_accum_buffer() = " << (glconfig->has_accum_buffer() ? "true" : "false") << std::endl; std::cout << std::endl; print_gl_attrib(glconfig, "Gdk::GL::USE_GL", Gdk::GL::USE_GL, true); print_gl_attrib(glconfig, "Gdk::GL::BUFFER_SIZE", Gdk::GL::BUFFER_SIZE, false); print_gl_attrib(glconfig, "Gdk::GL::LEVEL", Gdk::GL::LEVEL, false); print_gl_attrib(glconfig, "Gdk::GL::RGBA", Gdk::GL::RGBA, true); print_gl_attrib(glconfig, "Gdk::GL::DOUBLEBUFFER", Gdk::GL::DOUBLEBUFFER, true); print_gl_attrib(glconfig, "Gdk::GL::STEREO", Gdk::GL::STEREO, true); print_gl_attrib(glconfig, "Gdk::GL::AUX_BUFFERS", Gdk::GL::AUX_BUFFERS, false); print_gl_attrib(glconfig, "Gdk::GL::RED_SIZE", Gdk::GL::RED_SIZE, false); print_gl_attrib(glconfig, "Gdk::GL::GREEN_SIZE", Gdk::GL::GREEN_SIZE, false); print_gl_attrib(glconfig, "Gdk::GL::BLUE_SIZE", Gdk::GL::BLUE_SIZE, false); print_gl_attrib(glconfig, "Gdk::GL::ALPHA_SIZE", Gdk::GL::ALPHA_SIZE, false); print_gl_attrib(glconfig, "Gdk::GL::DEPTH_SIZE", Gdk::GL::DEPTH_SIZE, false); print_gl_attrib(glconfig, "Gdk::GL::STENCIL_SIZE", Gdk::GL::STENCIL_SIZE, false); print_gl_attrib(glconfig, "Gdk::GL::ACCUM_RED_SIZE", Gdk::GL::ACCUM_RED_SIZE, false); print_gl_attrib(glconfig, "Gdk::GL::ACCUM_GREEN_SIZE", Gdk::GL::ACCUM_GREEN_SIZE, false); print_gl_attrib(glconfig, "Gdk::GL::ACCUM_BLUE_SIZE", Gdk::GL::ACCUM_BLUE_SIZE, false); print_gl_attrib(glconfig, "Gdk::GL::ACCUM_ALPHA_SIZE", Gdk::GL::ACCUM_ALPHA_SIZE, false); std::cout << std::endl; } // // Simple OpenGL scene using bitmap font. // class FontGLScene : public Gtk::DrawingArea, public Gtk::GL::Widget<FontGLScene> { public: FontGLScene(); virtual ~FontGLScene(); protected: virtual void on_realize(); virtual bool on_configure_event(GdkEventConfigure* event); virtual bool on_expose_event(GdkEventExpose* event); protected: // font rendering stuff: static const Glib::ustring m_FontString; GLuint m_FontListBase; int m_FontHeight; }; const Glib::ustring FontGLScene::m_FontString = "courier 12"; FontGLScene::FontGLScene() : m_FontListBase(0), m_FontHeight(0) { // // Configure OpenGL-capable visual. // Glib::RefPtr<Gdk::GL::Config> glconfig; // Try double-buffered visual glconfig = Gdk::GL::Config::create(Gdk::GL::MODE_RGB | Gdk::GL::MODE_DEPTH | Gdk::GL::MODE_DOUBLE); if (!glconfig) { std::cerr << "*** Cannot find the double-buffered visual.\n" << "*** Trying single-buffered visual.\n"; // Try single-buffered visual glconfig = Gdk::GL::Config::create(Gdk::GL::MODE_RGB | Gdk::GL::MODE_DEPTH); if (!glconfig) { std::cerr << "*** Cannot find any OpenGL-capable visual.\n"; std::exit(1); } } // print frame buffer attributes. GLConfigUtil::examine_gl_attrib(glconfig); // // Set OpenGL-capability to the widget. // set_gl_capability(glconfig); } FontGLScene::~FontGLScene() { } void FontGLScene::on_realize() { // We need to call the base on_realize() Gtk::DrawingArea::on_realize(); // // Get GL::Window. // Glib::RefPtr<Gdk::GL::Window> glwindow = get_gl_window(); // // GL calls. // // *** OpenGL BEGIN *** if (!glwindow->gl_begin(get_gl_context())) return; // // Generate font display lists. // m_FontListBase = glGenLists (128); Pango::FontDescription font_desc(m_FontString); Glib::RefPtr<Pango::Font> font = Gdk::GL::Font::use_pango_font(font_desc, 0, 128, m_FontListBase); if (!font) { std::cerr << "*** Can't load font " << m_FontString << std::endl; Gtk::Main::quit(); } Pango::FontMetrics font_metrics = font->get_metrics(); m_FontHeight = font_metrics.get_ascent() + font_metrics.get_descent(); m_FontHeight = PANGO_PIXELS(m_FontHeight); glClearColor(1.0, 1.0, 1.0, 1.0); glClearDepth(1.0); glViewport(0, 0, get_width(), get_height()); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0.0, get_width(), 0.0, get_height(), -1.0, 1.0); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glwindow->gl_end(); // *** OpenGL END *** } bool FontGLScene::on_configure_event(GdkEventConfigure* event) { // // Get GL::Window. // Glib::RefPtr<Gdk::GL::Window> glwindow = get_gl_window(); // // GL calls. // // *** OpenGL BEGIN *** if (!glwindow->gl_begin(get_gl_context())) return false; glViewport(0, 0, get_width(), get_height()); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0.0, get_width(), 0.0, get_height(), -1.0, 1.0); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glwindow->gl_end(); // *** OpenGL END *** return true; } bool FontGLScene::on_expose_event(GdkEventExpose* event) { // // Get GL::Window. // Glib::RefPtr<Gdk::GL::Window> glwindow = get_gl_window(); // // GL calls. // // *** OpenGL BEGIN *** if (!glwindow->gl_begin(get_gl_context())) return false; glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // // Draw some text. // glColor3f(0.0, 0.0, 0.0); for (int i = 2; i >= -2; --i) { glRasterPos2f(10.0, 0.5*get_height() + i*m_FontHeight); for (int j = ' '; j <= 'Z'; ++j) glCallList(m_FontListBase+j); } // // Show font description string. // glColor3f(1.0, 0.0, 0.0); glRasterPos2f(10.0, 10.0); glListBase(m_FontListBase); glCallLists(m_FontString.length(), GL_UNSIGNED_BYTE, m_FontString.c_str()); // Swap buffers. if (glwindow->is_double_buffered()) glwindow->swap_buffers(); else glFlush(); glwindow->gl_end(); // *** OpenGL END *** return true; } // // The application class. // class Font : public Gtk::Window { public: Font(); virtual ~Font(); protected: // signal handlers: void on_button_quit_clicked(); protected: // member widgets: Gtk::VBox m_VBox; FontGLScene m_FontGLScene; Gtk::Button m_ButtonQuit; }; Font::Font() : m_VBox(false, 0), m_ButtonQuit("Quit") { // // Top-level window. // set_title("Font"); // Get automatically redrawn if any of their children changed allocation. set_reallocate_redraws(true); add(m_VBox); // // Simple OpenGL scene using bitmap font. // m_FontGLScene.set_size_request(640, 240); m_VBox.pack_start(m_FontGLScene); // // Simple quit button. // m_ButtonQuit.signal_clicked().connect( sigc::mem_fun(*this, &Font::on_button_quit_clicked)); m_VBox.pack_start(m_ButtonQuit, Gtk::PACK_SHRINK, 0); // // Show window. // show_all(); } Font::~Font() {} void Font::on_button_quit_clicked() { Gtk::Main::quit(); } // // Main. // int main(int argc, char** argv) { Gtk::Main kit(argc, argv); // // Init gtkglextmm. // Gtk::GL::init(argc, argv); // // Query OpenGL extension version. // int major, minor; Gdk::GL::query_version(major, minor); std::cout << "OpenGL extension version - " << major << "." << minor << std::endl; // // Instantiate and run the application. // Font font; kit.run(font); return 0; }
00001 // -*- C++ -*- 00002 /* 00003 * font.cc: 00004 * Simple bitmap font rendering example. 00005 * 00006 * written by Naofumi Yasufuku <naofumi@users.sourceforge.net> 00007 */ 00008 00009 #include <iostream> 00010 #include <cstdlib> 00011 00012 #include <gtkmm.h> 00013 00014 #include <gtkglmm.h> 00015 00016 #ifdef G_OS_WIN32 00017 #define WIN32_LEAN_AND_MEAN 1 00018 #include <windows.h> 00019 #endif 00020 00021 #include <GL/gl.h> 00022 #include <GL/glu.h> 00023 00024 00026 // 00027 // OpenGL frame buffer configuration utilities. 00028 // 00030 00031 struct GLConfigUtil 00032 { 00033 static void print_gl_attrib(const Glib::RefPtr<const Gdk::GL::Config>& glconfig, 00034 const char* attrib_str, 00035 int attrib, 00036 bool is_boolean); 00037 00038 static void examine_gl_attrib(const Glib::RefPtr<const Gdk::GL::Config>& glconfig); 00039 }; 00040 00041 // 00042 // Print a configuration attribute. 00043 // 00044 void GLConfigUtil::print_gl_attrib(const Glib::RefPtr<const Gdk::GL::Config>& glconfig, 00045 const char* attrib_str, 00046 int attrib, 00047 bool is_boolean) 00048 { 00049 int value; 00050 00051 if (glconfig->get_attrib(attrib, value)) 00052 { 00053 std::cout << attrib_str << " = "; 00054 if (is_boolean) 00055 std::cout << (value == true ? "true" : "false") << std::endl; 00056 else 00057 std::cout << value << std::endl; 00058 } 00059 else 00060 { 00061 std::cout << "*** Cannot get " 00062 << attrib_str 00063 << " attribute value\n"; 00064 } 00065 } 00066 00067 // 00068 // Print configuration attributes. 00069 // 00070 void GLConfigUtil::examine_gl_attrib(const Glib::RefPtr<const Gdk::GL::Config>& glconfig) 00071 { 00072 std::cout << "\nOpenGL visual configurations :\n\n"; 00073 00074 std::cout << "glconfig->is_rgba() = " 00075 << (glconfig->is_rgba() ? "true" : "false") 00076 << std::endl; 00077 std::cout << "glconfig->is_double_buffered() = " 00078 << (glconfig->is_double_buffered() ? "true" : "false") 00079 << std::endl; 00080 std::cout << "glconfig->is_stereo() = " 00081 << (glconfig->is_stereo() ? "true" : "false") 00082 << std::endl; 00083 std::cout << "glconfig->has_alpha() = " 00084 << (glconfig->has_alpha() ? "true" : "false") 00085 << std::endl; 00086 std::cout << "glconfig->has_depth_buffer() = " 00087 << (glconfig->has_depth_buffer() ? "true" : "false") 00088 << std::endl; 00089 std::cout << "glconfig->has_stencil_buffer() = " 00090 << (glconfig->has_stencil_buffer() ? "true" : "false") 00091 << std::endl; 00092 std::cout << "glconfig->has_accum_buffer() = " 00093 << (glconfig->has_accum_buffer() ? "true" : "false") 00094 << std::endl; 00095 00096 std::cout << std::endl; 00097 00098 print_gl_attrib(glconfig, "Gdk::GL::USE_GL", Gdk::GL::USE_GL, true); 00099 print_gl_attrib(glconfig, "Gdk::GL::BUFFER_SIZE", Gdk::GL::BUFFER_SIZE, false); 00100 print_gl_attrib(glconfig, "Gdk::GL::LEVEL", Gdk::GL::LEVEL, false); 00101 print_gl_attrib(glconfig, "Gdk::GL::RGBA", Gdk::GL::RGBA, true); 00102 print_gl_attrib(glconfig, "Gdk::GL::DOUBLEBUFFER", Gdk::GL::DOUBLEBUFFER, true); 00103 print_gl_attrib(glconfig, "Gdk::GL::STEREO", Gdk::GL::STEREO, true); 00104 print_gl_attrib(glconfig, "Gdk::GL::AUX_BUFFERS", Gdk::GL::AUX_BUFFERS, false); 00105 print_gl_attrib(glconfig, "Gdk::GL::RED_SIZE", Gdk::GL::RED_SIZE, false); 00106 print_gl_attrib(glconfig, "Gdk::GL::GREEN_SIZE", Gdk::GL::GREEN_SIZE, false); 00107 print_gl_attrib(glconfig, "Gdk::GL::BLUE_SIZE", Gdk::GL::BLUE_SIZE, false); 00108 print_gl_attrib(glconfig, "Gdk::GL::ALPHA_SIZE", Gdk::GL::ALPHA_SIZE, false); 00109 print_gl_attrib(glconfig, "Gdk::GL::DEPTH_SIZE", Gdk::GL::DEPTH_SIZE, false); 00110 print_gl_attrib(glconfig, "Gdk::GL::STENCIL_SIZE", Gdk::GL::STENCIL_SIZE, false); 00111 print_gl_attrib(glconfig, "Gdk::GL::ACCUM_RED_SIZE", Gdk::GL::ACCUM_RED_SIZE, false); 00112 print_gl_attrib(glconfig, "Gdk::GL::ACCUM_GREEN_SIZE", Gdk::GL::ACCUM_GREEN_SIZE, false); 00113 print_gl_attrib(glconfig, "Gdk::GL::ACCUM_BLUE_SIZE", Gdk::GL::ACCUM_BLUE_SIZE, false); 00114 print_gl_attrib(glconfig, "Gdk::GL::ACCUM_ALPHA_SIZE", Gdk::GL::ACCUM_ALPHA_SIZE, false); 00115 00116 std::cout << std::endl; 00117 } 00118 00119 00121 // 00122 // Simple OpenGL scene using bitmap font. 00123 // 00125 00126 class FontGLScene : public Gtk::DrawingArea, 00127 public Gtk::GL::Widget<FontGLScene> 00128 { 00129 public: 00130 FontGLScene(); 00131 virtual ~FontGLScene(); 00132 00133 protected: 00134 virtual void on_realize(); 00135 virtual bool on_configure_event(GdkEventConfigure* event); 00136 virtual bool on_expose_event(GdkEventExpose* event); 00137 00138 protected: 00139 // font rendering stuff: 00140 static const Glib::ustring m_FontString; 00141 GLuint m_FontListBase; 00142 int m_FontHeight; 00143 }; 00144 00145 const Glib::ustring FontGLScene::m_FontString = "courier 12"; 00146 00147 FontGLScene::FontGLScene() 00148 : m_FontListBase(0), m_FontHeight(0) 00149 { 00150 // 00151 // Configure OpenGL-capable visual. 00152 // 00153 00154 Glib::RefPtr<Gdk::GL::Config> glconfig; 00155 00156 // Try double-buffered visual 00157 glconfig = Gdk::GL::Config::create(Gdk::GL::MODE_RGB | 00158 Gdk::GL::MODE_DEPTH | 00159 Gdk::GL::MODE_DOUBLE); 00160 if (!glconfig) 00161 { 00162 std::cerr << "*** Cannot find the double-buffered visual.\n" 00163 << "*** Trying single-buffered visual.\n"; 00164 00165 // Try single-buffered visual 00166 glconfig = Gdk::GL::Config::create(Gdk::GL::MODE_RGB | 00167 Gdk::GL::MODE_DEPTH); 00168 if (!glconfig) 00169 { 00170 std::cerr << "*** Cannot find any OpenGL-capable visual.\n"; 00171 std::exit(1); 00172 } 00173 } 00174 00175 // print frame buffer attributes. 00176 GLConfigUtil::examine_gl_attrib(glconfig); 00177 00178 // 00179 // Set OpenGL-capability to the widget. 00180 // 00181 00182 set_gl_capability(glconfig); 00183 } 00184 00185 FontGLScene::~FontGLScene() 00186 { 00187 } 00188 00189 void FontGLScene::on_realize() 00190 { 00191 // We need to call the base on_realize() 00192 Gtk::DrawingArea::on_realize(); 00193 00194 // 00195 // Get GL::Window. 00196 // 00197 00198 Glib::RefPtr<Gdk::GL::Window> glwindow = get_gl_window(); 00199 00200 // 00201 // GL calls. 00202 // 00203 00204 // *** OpenGL BEGIN *** 00205 if (!glwindow->gl_begin(get_gl_context())) 00206 return; 00207 00208 // 00209 // Generate font display lists. 00210 // 00211 00212 m_FontListBase = glGenLists (128); 00213 00214 Pango::FontDescription font_desc(m_FontString); 00215 00216 Glib::RefPtr<Pango::Font> font = 00217 Gdk::GL::Font::use_pango_font(font_desc, 0, 128, m_FontListBase); 00218 if (!font) 00219 { 00220 std::cerr << "*** Can't load font " 00221 << m_FontString 00222 << std::endl; 00223 Gtk::Main::quit(); 00224 } 00225 00226 Pango::FontMetrics font_metrics = font->get_metrics(); 00227 00228 m_FontHeight = font_metrics.get_ascent() + font_metrics.get_descent(); 00229 m_FontHeight = PANGO_PIXELS(m_FontHeight); 00230 00231 glClearColor(1.0, 1.0, 1.0, 1.0); 00232 glClearDepth(1.0); 00233 00234 glViewport(0, 0, get_width(), get_height()); 00235 00236 glMatrixMode(GL_PROJECTION); 00237 glLoadIdentity(); 00238 glOrtho(0.0, get_width(), 00239 0.0, get_height(), 00240 -1.0, 1.0); 00241 00242 glMatrixMode(GL_MODELVIEW); 00243 glLoadIdentity(); 00244 00245 glwindow->gl_end(); 00246 // *** OpenGL END *** 00247 } 00248 00249 bool FontGLScene::on_configure_event(GdkEventConfigure* event) 00250 { 00251 // 00252 // Get GL::Window. 00253 // 00254 00255 Glib::RefPtr<Gdk::GL::Window> glwindow = get_gl_window(); 00256 00257 // 00258 // GL calls. 00259 // 00260 00261 // *** OpenGL BEGIN *** 00262 if (!glwindow->gl_begin(get_gl_context())) 00263 return false; 00264 00265 glViewport(0, 0, get_width(), get_height()); 00266 00267 glMatrixMode(GL_PROJECTION); 00268 glLoadIdentity(); 00269 glOrtho(0.0, get_width(), 00270 0.0, get_height(), 00271 -1.0, 1.0); 00272 00273 glMatrixMode(GL_MODELVIEW); 00274 glLoadIdentity(); 00275 00276 glwindow->gl_end(); 00277 // *** OpenGL END *** 00278 00279 return true; 00280 } 00281 00282 bool FontGLScene::on_expose_event(GdkEventExpose* event) 00283 { 00284 // 00285 // Get GL::Window. 00286 // 00287 00288 Glib::RefPtr<Gdk::GL::Window> glwindow = get_gl_window(); 00289 00290 // 00291 // GL calls. 00292 // 00293 00294 // *** OpenGL BEGIN *** 00295 if (!glwindow->gl_begin(get_gl_context())) 00296 return false; 00297 00298 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 00299 00300 // 00301 // Draw some text. 00302 // 00303 glColor3f(0.0, 0.0, 0.0); 00304 for (int i = 2; i >= -2; --i) 00305 { 00306 glRasterPos2f(10.0, 0.5*get_height() + i*m_FontHeight); 00307 for (int j = ' '; j <= 'Z'; ++j) 00308 glCallList(m_FontListBase+j); 00309 } 00310 00311 // 00312 // Show font description string. 00313 // 00314 glColor3f(1.0, 0.0, 0.0); 00315 glRasterPos2f(10.0, 10.0); 00316 glListBase(m_FontListBase); 00317 glCallLists(m_FontString.length(), GL_UNSIGNED_BYTE, m_FontString.c_str()); 00318 00319 // Swap buffers. 00320 if (glwindow->is_double_buffered()) 00321 glwindow->swap_buffers(); 00322 else 00323 glFlush(); 00324 00325 glwindow->gl_end(); 00326 // *** OpenGL END *** 00327 00328 return true; 00329 } 00330 00331 00333 // 00334 // The application class. 00335 // 00337 00338 class Font : public Gtk::Window 00339 { 00340 public: 00341 Font(); 00342 virtual ~Font(); 00343 00344 protected: 00345 // signal handlers: 00346 void on_button_quit_clicked(); 00347 00348 protected: 00349 // member widgets: 00350 Gtk::VBox m_VBox; 00351 FontGLScene m_FontGLScene; 00352 Gtk::Button m_ButtonQuit; 00353 00354 }; 00355 00356 Font::Font() 00357 : m_VBox(false, 0), m_ButtonQuit("Quit") 00358 { 00359 // 00360 // Top-level window. 00361 // 00362 00363 set_title("Font"); 00364 00365 // Get automatically redrawn if any of their children changed allocation. 00366 set_reallocate_redraws(true); 00367 00368 add(m_VBox); 00369 00370 // 00371 // Simple OpenGL scene using bitmap font. 00372 // 00373 00374 m_FontGLScene.set_size_request(640, 240); 00375 00376 m_VBox.pack_start(m_FontGLScene); 00377 00378 // 00379 // Simple quit button. 00380 // 00381 00382 m_ButtonQuit.signal_clicked().connect( 00383 sigc::mem_fun(*this, &Font::on_button_quit_clicked)); 00384 00385 m_VBox.pack_start(m_ButtonQuit, Gtk::PACK_SHRINK, 0); 00386 00387 // 00388 // Show window. 00389 // 00390 00391 show_all(); 00392 } 00393 00394 Font::~Font() 00395 {} 00396 00397 void Font::on_button_quit_clicked() 00398 { 00399 Gtk::Main::quit(); 00400 } 00401 00402 00404 // 00405 // Main. 00406 // 00408 00409 int main(int argc, char** argv) 00410 { 00411 Gtk::Main kit(argc, argv); 00412 00413 // 00414 // Init gtkglextmm. 00415 // 00416 00417 Gtk::GL::init(argc, argv); 00418 00419 // 00420 // Query OpenGL extension version. 00421 // 00422 00423 int major, minor; 00424 Gdk::GL::query_version(major, minor); 00425 std::cout << "OpenGL extension version - " 00426 << major << "." << minor << std::endl; 00427 00428 // 00429 // Instantiate and run the application. 00430 // 00431 00432 Font font; 00433 00434 kit.run(font); 00435 00436 return 0; 00437 }