OpenEnroth 73e68f7
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
GUIFont Class Reference

#include <GUIFont.h>

Public Member Functions

 GUIFont ()
 
 ~GUIFont ()
 
void CreateFontTex ()
 
void ReleaseFontTex ()
 
bool IsCharValid (unsigned char c) const
 
int GetHeight () const
 
int AlignText_Center (int width, std::string_view str)
 
int GetLineWidth (std::string_view str)
 
int CalcTextHeight (std::string_view str, int width, int x_offset, bool return_on_carriage=false)
 
std::string GetPageTop (std::string_view pInString, GUIWindow *pWindow, unsigned int uX, int a5)
 
Color DrawTextLine (std::string_view text, Color color, Color defaultColor, Pointi position, int max_len_pix)
 
void DrawText (GUIWindow *window, Pointi position, Color color, std::string_view text, int maxHeight, Color shadowColor)
 
int DrawTextInRect (GUIWindow *window, Pointi position, Color color, std::string_view text, int rect_width, int reverse_text)
 
std::string FitTextInAWindow (std::string_view inString, int width, int uX, bool return_on_carriage=false)
 
void DrawCreditsEntry (GUIFont *pSecondFont, int uFrameX, int uFrameY, unsigned int w, unsigned int h, Color firstColor, Color secondColor, std::string_view pString, GraphicsImage *image)
 
int GetStringHeight2 (GUIFont *secondFont, std::string_view text_str, GUIWindow *pWindow, int startX, int a6)
 

Static Public Member Functions

static std::unique_ptr< GUIFontLoadFont (std::string_view pFontFile, std::string_view pFontPalette)
 

Public Attributes

int maxcharwidth = 0
 
GraphicsImagefonttex = nullptr
 
GraphicsImagefontshadow = nullptr
 

Private Member Functions

std::string FitTwoFontStringINWindow (std::string_view inString, GUIFont *pFontSecond, GUIWindow *pWindow, int startPixlOff, bool return_on_carriage=false)
 
void DrawTextLineToBuff (Color color, Color *uX_buff_pos, std::string_view text, int line_width)
 

Private Attributes

FontData pData
 
Palette palette
 

Constructor & Destructor Documentation

◆ GUIFont()

GUIFont::GUIFont ( )
default

◆ ~GUIFont()

GUIFont::~GUIFont ( )

Member Function Documentation

◆ AlignText_Center()

int GUIFont::AlignText_Center ( int  width,
std::string_view  str 
)

◆ CalcTextHeight()

int GUIFont::CalcTextHeight ( std::string_view  str,
int  width,
int  x_offset,
bool  return_on_carriage = false 
)

◆ CreateFontTex()

void GUIFont::CreateFontTex ( )

◆ DrawCreditsEntry()

void GUIFont::DrawCreditsEntry ( GUIFont pSecondFont,
int  uFrameX,
int  uFrameY,
unsigned int  w,
unsigned int  h,
Color  firstColor,
Color  secondColor,
std::string_view  pString,
GraphicsImage image 
)

◆ DrawText()

void GUIFont::DrawText ( GUIWindow window,
Pointi  position,
Color  color,
std::string_view  text,
int  maxHeight,
Color  shadowColor 
)

◆ DrawTextInRect()

int GUIFont::DrawTextInRect ( GUIWindow window,
Pointi  position,
Color  color,
std::string_view  text,
int  rect_width,
int  reverse_text 
)

◆ DrawTextLine()

Color GUIFont::DrawTextLine ( std::string_view  text,
Color  color,
Color  defaultColor,
Pointi  position,
int  max_len_pix 
)

Draws a single line of text.

Parameters
textInput line of text.
colorColor that the text should be started to be drawn at - this allows feeding in the color returned from the previous call to maintain correct color when its split onto a new line.
defaultColorThe color that the text should return to on hitting a default color tag.
positionPosition to draw the text line to.
max_len_pixThe maximum allowed width for this line of text.
Returns
Color that was used to draw text at the end of the line.

◆ DrawTextLineToBuff()

void GUIFont::DrawTextLineToBuff ( Color  color,
Color uX_buff_pos,
std::string_view  text,
int  line_width 
)
private

◆ FitTextInAWindow()

std::string GUIFont::FitTextInAWindow ( std::string_view  inString,
int  width,
int  uX,
bool  return_on_carriage = false 
)

◆ FitTwoFontStringINWindow()

std::string GUIFont::FitTwoFontStringINWindow ( std::string_view  inString,
GUIFont pFontSecond,
GUIWindow pWindow,
int  startPixlOff,
bool  return_on_carriage = false 
)
private

◆ GetHeight()

int GUIFont::GetHeight ( ) const

◆ GetLineWidth()

int GUIFont::GetLineWidth ( std::string_view  str)

◆ GetPageTop()

std::string GUIFont::GetPageTop ( std::string_view  pInString,
GUIWindow pWindow,
unsigned int  uX,
int  a5 
)

◆ GetStringHeight2()

int GUIFont::GetStringHeight2 ( GUIFont secondFont,
std::string_view  text_str,
GUIWindow pWindow,
int  startX,
int  a6 
)

◆ IsCharValid()

bool GUIFont::IsCharValid ( unsigned char  c) const

◆ LoadFont()

std::unique_ptr< GUIFont > GUIFont::LoadFont ( std::string_view  pFontFile,
std::string_view  pFontPalette 
)
static

◆ ReleaseFontTex()

void GUIFont::ReleaseFontTex ( )

Member Data Documentation

◆ fontshadow

GraphicsImage* GUIFont::fontshadow = nullptr

◆ fonttex

GraphicsImage* GUIFont::fonttex = nullptr

◆ maxcharwidth

int GUIFont::maxcharwidth = 0

◆ palette

Palette GUIFont::palette
private

◆ pData

FontData GUIFont::pData
private

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