JNGL
Classes | Namespaces | Functions
font.hpp File Reference

Contains jngl::Font class and related functions. More...

#include "Color.hpp"
#include "Vec2.hpp"
#include <memory>
#include <string>
Include dependency graph for font.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Font
 Font loaded from a TTF or OTF file. More...
 

Namespaces

 jngl
 JNGL's main namespace.
 

Functions

void print (const std::string &text, jngl::Vec2 position)
 Print text at position.
 
void print (const std::string &text, int xposition, int yposition)
 Print text at { xposition, yposition }.
 
int getFontSize ()
 Get the font size used by print()
 
void setFontSize (int size)
 Change the font size used by print()
 
std::string getFont ()
 Returns the currently active font name. More...
 
void setFont (const std::string &filename)
 Sets the currently active font to filename. More...
 
void setFontByName (const std::string &name)
 Sets the currently active font by a font name. More...
 
void setFontColor (jngl::Color)
 Sets the color of the currently active font.
 
void setFontColor (unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha=255)
 Sets the color of the currently active font. More...
 
void pushFontColor (unsigned char red, unsigned char green, unsigned char blue)
 Pushes the currently active font color on a stack and sets a new one.
 
void popFontColor ()
 Resets the font color on the top of stack which is used by jngl::pushFontColor.
 
int getLineHeight ()
 Get line height used py print() in pixel.
 
void setLineHeight (int)
 Set line height used by print() in pixel.
 
double getTextWidth (const std::string &text)
 Calculates the width of text in pixels if it would be drawn with the currently active font.
 

Detailed Description

Contains jngl::Font class and related functions.

Definition in file font.hpp.