ShapeFont.h

Go to the documentation of this file.
00001 /*
00002 Copyright (C) 2003-2005 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 SHAPEFONT_H
00020 #define SHAPEFONT_H
00021 
00022 #include "Font.h"
00023 #include "Shape.h"
00024 
00025 class ShapeFont : public Pentagram::Font, public Shape
00026 {
00027         int height;
00028         int baseline;
00029         int vlead;
00030         int hlead;
00031 
00032 public:
00033         ShapeFont(const uint8* data,uint32 size, const ConvertShapeFormat *format,
00034                           const uint16 flexId, const uint32 shapenum);
00035         virtual ~ShapeFont();
00036 
00037         virtual int getHeight();
00038         virtual int getBaseline();
00039         virtual int getBaselineSkip();
00040 
00041         int getWidth(char c);
00042         int getVlead() const { return vlead; }
00043         int getHlead() const { return hlead; }
00044 
00045         void setVLead(int vl) { vlead = vl; }
00046         void setHLead(int hl) { hlead = hl; }
00047 
00048         virtual void getStringSize(const std::string& text,
00049                                                            int& width, int& height);
00050 
00051         virtual RenderedText* renderText(const std::string& text,
00052                                                                          unsigned int& remaining,
00053                                                                          int width=0, int height=0,
00054                                                                          TextAlign align=TEXT_LEFT,
00055                                                                          bool u8specials=false,
00056                                                                          std::string::size_type cursor
00057                                                                                         =std::string::npos);
00058 
00059         ENABLE_RUNTIME_CLASSTYPE();
00060 };
00061 
00062 #endif

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