Text.hpp
Go to the documentation of this file.
1 
4 #ifndef GOSU_TEXT_HPP
5 #define GOSU_TEXT_HPP
6 
7 #include <Gosu/Fwd.hpp>
8 #include <Gosu/Color.hpp>
9 #include <Gosu/GraphicsBase.hpp>
10 #include <string>
11 
12 namespace Gosu
13 {
16  std::wstring defaultFontName();
17 
23  unsigned textWidth(const std::wstring& text,
24  const std::wstring& fontName, unsigned fontHeight,
25  unsigned fontFlags = 0);
26 
34  void drawText(Bitmap& bitmap, const std::wstring& text, int x, int y,
35  Color c, const std::wstring& fontName, unsigned fontHeight,
36  unsigned fontFlags = 0);
37 
45  Bitmap createText(const std::wstring& text,
46  const std::wstring& fontName, unsigned fontHeight,
47  unsigned fontFlags = 0);
48 
61  Bitmap createText(const std::wstring& text,
62  const std::wstring& fontName, unsigned fontHeight,
63  int lineSpacing, unsigned width, TextAlign align,
64  unsigned fontFlags = 0);
65 
68  void registerEntity(const std::wstring& name, const Bitmap& replacement);
69 }
70 
71 #endif
void drawText(Bitmap &bitmap, const std::wstring &text, int x, int y, Color c, const std::wstring &fontName, unsigned fontHeight, unsigned fontFlags=0)
Draws a line of unformatted text on a bitmap.
void registerEntity(const std::wstring &name, const Bitmap &replacement)
Registers a new HTML-style entity that can subsequently be used with Gosu::Font and Gosu::createText...
Contains declarations of all of Gosu&#39;s available classes.
std::wstring defaultFontName()
Returns the name of a neutral font that is available on the current platform.
Bitmap createText(const std::wstring &text, const std::wstring &fontName, unsigned fontHeight, unsigned fontFlags=0)
Creates a bitmap that is filled with a line of formatted text given to the function.
unsigned textWidth(const std::wstring &text, const std::wstring &fontName, unsigned fontHeight, unsigned fontFlags=0)
Returns the width an unformatted line of text would span on a bitmap if it were drawn using drawText ...
Interface of the Color class.
Contains general typedefs and enums related to graphics.