Gosu
Text.hpp
Go to the documentation of this file.
1 
4 #pragma once
5 
6 #include <Gosu/Fwd.hpp>
7 #include <Gosu/Color.hpp>
8 #include <Gosu/GraphicsBase.hpp>
9 #include <string>
10 
11 namespace Gosu
12 {
14  std::string default_font_name();
15 
20  double text_width(const std::u32string& text, const std::string& font_name, double font_height,
21  unsigned font_flags = 0);
22 
29  double draw_text(Bitmap& bitmap, double x, double y, Color c, const std::u32string& text,
30  const std::string& font_name, double font_height, unsigned font_flags = 0);
31 
45  Bitmap layout_text(const std::string& text, const std::string& font_name,
46  double font_height, double line_spacing = 0,
47  int width = -1, Alignment align = AL_LEFT, unsigned font_flags = 0);
48 
62  Bitmap layout_markup(const std::string& markup, const std::string& font_name,
63  double font_height, double line_spacing = 0,
64  int width = -1, Alignment align = AL_LEFT, unsigned font_flags = 0);
65 }
Definition: Audio.hpp:12
Bitmap layout_text(const std::string &text, const std::string &font_name, double font_height, double line_spacing=0, int width=-1, Alignment align=AL_LEFT, unsigned font_flags=0)
Creates a bitmap that is filled with the formatted text given to the function.
double draw_text(Bitmap &bitmap, double x, double y, Color c, const std::u32string &text, const std::string &font_name, double font_height, unsigned font_flags=0)
Draws a line of unformatted text on a bitmap.
double text_width(const std::u32string &text, const std::string &font_name, double font_height, unsigned font_flags=0)
Returns the width an unformatted line of text would span on a bitmap if it were drawn using draw_text...
std::string default_font_name()
Returns the name of a neutral font that is available on the current platform.
Bitmap layout_markup(const std::string &markup, const std::string &font_name, double font_height, double line_spacing=0, int width=-1, Alignment align=AL_LEFT, unsigned font_flags=0)
Creates a bitmap that is filled with the formatted text given to the function.
Interface of the Color class.
Contains general typedefs and enums related to graphics.