TTFont.h

Go to the documentation of this file.
00001 /*
00002 Copyright (C) 2004-2006 The Pentagram team
00003 
00004 This program is free software; you can redistribute it and/or
00005 modify it under the terms of the GNU General Public License
00006 as published by the Free Software Foundation; either version 2
00007 of the License, or (at your option) any later version.
00008 
00009 This program is distributed in the hope that it will be useful,
00010 but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 GNU General Public License for more details.
00013 
00014 You should have received a copy of the GNU General Public License
00015 along with this program; if not, write to the Free Software
00016 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00017 */
00018 
00019 #ifndef TTFONT_H
00020 #define TTFONT_H
00021 
00022 #include "Font.h"
00023 
00024 // This is TTF_Font struct from SDL_ttf
00025 typedef struct _TTF_Font TTF_Font;
00026 
00027 class TTFont : public Pentagram::Font
00028 {
00029 public:
00030         TTFont(TTF_Font* font, uint32 rgb, int bordersize,
00031                    bool antiAliased, bool SJIS);
00032         virtual ~TTFont();
00033 
00034         virtual int getHeight();
00035         virtual int getBaseline();
00036         virtual int getBaselineSkip();
00037 
00038         bool isAntialiased() { return antiAliased; }
00039 
00040         virtual void getStringSize(const std::string& text,
00041                                                            int& width, int& height);
00042 
00043         virtual void getTextSize(const std::string& text,
00044                                                          int& resultwidth, int& resultheight,
00045                                                          unsigned int& remaining,
00046                                                          int width=0, int height=0,
00047                                                          TextAlign align=TEXT_LEFT, bool u8specials=false);
00048 
00049         virtual RenderedText* renderText(const std::string& text,
00050                                                                          unsigned int& remaining,
00051                                                                          int width=0, int height=0,
00052                                                                          TextAlign align=TEXT_LEFT,
00053                                                                          bool u8specials=false,
00054                                                                          std::string::size_type cursor
00055                                                                                         =std::string::npos);
00056 
00057         ENABLE_RUNTIME_CLASSTYPE();
00058 protected:
00059         TTF_Font* ttf_font;
00060         uint32 rgb;
00061         int bordersize;
00062         bool antiAliased;
00063         bool SJIS;
00064 
00065         uint16 bullet;
00066 };
00067 
00068 
00069 #endif

Generated on Fri Jul 27 22:27:45 2007 for pentagram by  doxygen 1.4.7