OpenGothic
Open source reimplementation of Gothic I and II
Loading...
Searching...
No Matches
GthFont Class Referencefinal

#include <gthfont.h>

Public Member Functions

 GthFont ()
 
 GthFont (zenkit::Read &data, std::string_view ftex, const Tempest::Color &cl)
 
 GthFont (const GthFont &)=default
 
 GthFont (GthFont &&)=default
 
GthFontoperator= (const GthFont &)=default
 
GthFontoperator= (GthFont &&)=default
 
int pixelSize () const
 
void setScale (float s)
 
void drawText (Tempest::Painter &p, int x, int y, int w, int h, std::string_view txt, Tempest::AlignFlag align, int firstLine=0) const
 
void drawText (Tempest::Painter &p, int x, int y, std::string_view txt) const
 
auto textSize (const std::string_view txt) const -> Tempest::Size
 
auto textSize (const char *b, const char *e) const -> Tempest::Size
 
auto textSize (const uint8_t *b, const uint8_t *e) const -> Tempest::Size
 
auto textSize (int w, std::string_view txt) const -> Tempest::Size
 
auto lineCount (int w, std::string_view txt) const -> int32_t
 

Detailed Description

Definition at line 7 of file gthfont.h.

Constructor & Destructor Documentation

◆ GthFont() [1/4]

GthFont::GthFont ( )

Definition at line 8 of file gthfont.cpp.

◆ GthFont() [2/4]

GthFont::GthFont ( zenkit::Read &  data,
std::string_view  ftex,
const Tempest::Color &  cl 
)

◆ GthFont() [3/4]

GthFont::GthFont ( const GthFont )
default

◆ GthFont() [4/4]

GthFont::GthFont ( GthFont &&  )
default

Member Function Documentation

◆ drawText() [1/2]

void GthFont::drawText ( Tempest::Painter &  p,
int  x,
int  y,
int  w,
int  h,
std::string_view  txt,
Tempest::AlignFlag  align,
int  firstLine = 0 
) const

◆ drawText() [2/2]

void GthFont::drawText ( Tempest::Painter &  p,
int  x,
int  y,
std::string_view  txt 
) const

Definition at line 103 of file gthfont.cpp.

◆ lineCount()

int32_t GthFont::lineCount ( int  w,
std::string_view  txt 
) const -> int32_t

Definition at line 184 of file gthfont.cpp.

◆ operator=() [1/2]

GthFont & GthFont::operator= ( const GthFont )
default

◆ operator=() [2/2]

GthFont & GthFont::operator= ( GthFont &&  )
default

◆ pixelSize()

int GthFont::pixelSize ( ) const

Definition at line 18 of file gthfont.cpp.

◆ setScale()

void GthFont::setScale ( float  s)

Definition at line 22 of file gthfont.cpp.

◆ textSize() [1/4]

Size GthFont::textSize ( const char *  b,
const char *  e 
) const -> Tempest::Size

Definition at line 137 of file gthfont.cpp.

◆ textSize() [2/4]

Size GthFont::textSize ( const std::string_view  txt) const -> Tempest::Size

Definition at line 131 of file gthfont.cpp.

◆ textSize() [3/4]

Size GthFont::textSize ( const uint8_t *  b,
const uint8_t *  e 
) const -> Tempest::Size

Definition at line 143 of file gthfont.cpp.

◆ textSize() [4/4]

Size GthFont::textSize ( int  w,
std::string_view  txt 
) const -> Tempest::Size

Definition at line 178 of file gthfont.cpp.


The documentation for this class was generated from the following files: