Freeciv21
Develop your civilization from humble roots to a global empire
fcFont Class Reference

#include <fonts.h>

+ Collaboration diagram for fcFont:

Public Member Functions

void setFont (const QString &name, const QFont &qf)
 Adds new font or overwrite old one. More...
 
void setSizeAll (int)
 Increases/decreases all fonts sizes. More...
 
QFont getFont (const QString &name, double zoom=1.0) const
 Returns desired font. More...
 
void initFonts ()
 Initiazlizes fonts from client options. More...
 
void releaseFonts ()
 Deletes all fonts. More...
 

Static Public Member Functions

static fcFontinstance ()
 Returns instance of fc_font. More...
 
static void drop ()
 Deletes fc_icons instance. More...
 

Private Member Functions

 Q_DISABLE_COPY (fcFont)
 
 fcFont ()
 Font provider constructor. More...
 

Private Attributes

QMap< QString, QFont > font_map
 

Static Private Attributes

static fcFontm_instance = 0
 

Detailed Description

Definition at line 28 of file fonts.h.

Constructor & Destructor Documentation

◆ fcFont()

fcFont::fcFont ( )
explicitprivate

Font provider constructor.

Definition at line 29 of file fonts.cpp.

Referenced by instance().

Member Function Documentation

◆ drop()

void fcFont::drop ( )
static

Deletes fc_icons instance.

Definition at line 45 of file fonts.cpp.

◆ getFont()

◆ initFonts()

void fcFont::initFonts ( )

Initiazlizes fonts from client options.

default font names are: gui_qt_font_notify_label and so on. (full list is in options.c in client dir)

Definition at line 77 of file fonts.cpp.

Referenced by fc_client::fc_client().

◆ instance()

◆ Q_DISABLE_COPY()

fcFont::Q_DISABLE_COPY ( fcFont  )
private

◆ releaseFonts()

void fcFont::releaseFonts ( )

Deletes all fonts.

Definition at line 117 of file fonts.cpp.

Referenced by drop().

◆ setFont()

void fcFont::setFont ( const QString &  name,
const QFont &  qf 
)

Adds new font or overwrite old one.

Definition at line 122 of file fonts.cpp.

Referenced by apply_help_font(), configure_font(), gui_qt_apply_font(), gui_update_font(), and initFonts().

◆ setSizeAll()

void fcFont::setSizeAll ( int  new_size)

Increases/decreases all fonts sizes.

Definition at line 99 of file fonts.cpp.

Referenced by gui_update_allfonts().

Member Data Documentation

◆ font_map

QMap<QString, QFont> fcFont::font_map
private

Definition at line 32 of file fonts.h.

Referenced by getFont(), releaseFonts(), and setFont().

◆ m_instance

fcFont * fcFont::m_instance = 0
staticprivate

Definition at line 33 of file fonts.h.

Referenced by drop(), and instance().