won't finish strokes below a certrain number of points
[numtypysics.git] / Font.h
blobea0e6fb2cebded9e458c47066e68bf38132cd6fb
1 /*
2 * This file is part of NumptyPhysics
3 * Copyright (C) 2008 Tim Edmonds
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 3 of the
8 * License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
17 #ifndef FONT_H
18 #define FONT_H
20 #include "Common.h"
21 #include "Path.h"
22 #include "Array.h"
23 #include <string>
25 class Canvas;
27 class Font
29 public:
30 Font( const std::string& file, int ptsize=10 );
31 Vec2 metrics( const std::string& text ) const;
32 Canvas* renderFont(const std::string& text, int colour) const;
33 void drawLeft( Canvas* canvas, Vec2 pt,
34 const std::string& text, int colour ) const;
35 void drawCenter( Canvas* canvas, Vec2 pt,
36 const std::string& text, int colour ) const;
37 void drawWrap( Canvas* canvas, Rect area,
38 const std::string& text, int colour ) const;
40 static const Font* titleFont();
41 static const Font* headingFont();
42 static const Font* blurbFont();
43 private:
44 typedef void* State;
45 State m_state;
49 #endif //FONT_H