Freeciv-3.2: fc_font Class Reference

Freeciv-3.2

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Data Fields | Private Member Functions | Private Attributes | Static Private Attributes
fc_font Class Reference

`#include <fonts.h>`

## Public Member Functions

void | set_font (QString name, QFont *qf)
QFont * | get_font (QString name)
void | init_fonts ()
void | release_fonts ()
void | get_mapfont_size ()

## Static Public Member Functions

static fc_font * | instance ()
static void | drop ()

## Data Fields

int | city_fontsize
int | prod_fontsize

## Private Member Functions

| Q_DISABLE_COPY (fc_font)
| fc_font ()

## Private Attributes

QMap< QString, QFont * > | font_map

## Static Private Attributes

static fc_font * | m_instance = 0

## Detailed Description

Definition at line 38 of file fonts.h.

## Constructor & Destructor Documentation

## ◆ fc_font()

fc_font::fc_font | ( |  | ) |

explicitprivate

Font provider constructor

Definition at line 34 of file fonts.cpp.

Referenced by instance().

## Member Function Documentation

## ◆ drop()

void fc_font::drop | ( |  | ) |

static

Deletes fc_font instance

Definition at line 51 of file fonts.cpp.

## ◆ get_font()

QFont * fc_font::get_font | ( | QString | name | ) |

Returns desired font

Definition at line 63 of file fonts.cpp.

Referenced by apply_font(), apply_help_font(), city_dialog::city_dialog(), city_font_update(), fc_corner::fc_corner(), get_font(), get_mapfont_size(), hud_input_box::hud_input_box(), hud_message_box::hud_message_box(), hud_text::hud_text(), info_tile::info_tile(), notify_dialog::notify_dialog(), plr_item_delegate::paint(), hud_unit_combat::paintEvent(), city_production_model::populate(), qtg_gui_update_font(), qtg_load_gfxnumber(), units_select::units_select(), unittype_item::unittype_item(), hud_units::update_actions(), chatwdg::update_font(), help_widget::update_fonts(), mr_menu::zoom_reset(), and mr_menu::zoom_scale_fonts().

## ◆ get_mapfont_size()

void fc_font::get_mapfont_size | ( |  | ) |

Stores default font sizes

Definition at line 114 of file fonts.cpp.

Referenced by apply_font(), init_fonts(), and qtg_gui_update_font().

## ◆ init_fonts()

void fc_font::init_fonts | ( |  | ) |

Initializes 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::init().

## ◆ instance()

fc_font * fc_font::instance | ( |  | ) |

static

Returns instance of fc_font

Definition at line 41 of file fonts.cpp.

Referenced by apply_font(), apply_help_font(), chatwdg::chatwdg(), city_dialog::city_dialog(), city_font_update(), configure_font(), fc_corner::fc_corner(), get_font(), hud_input_box::hud_input_box(), hud_message_box::hud_message_box(), hud_text::hud_text(), info_tile::info_tile(), fc_client::init(), notify_dialog::notify_dialog(), plr_item_delegate::paint(), hud_unit_combat::paintEvent(), city_production_model::populate(), qtg_gui_update_font(), qtg_load_gfxnumber(), units_select::units_select(), unittype_item::unittype_item(), hud_units::update_actions(), chatwdg::update_font(), help_widget::update_fonts(), fc_sidewidget::update_fonts(), mr_menu::zoom_reset(), and mr_menu::zoom_scale_fonts().

## ◆ Q_DISABLE_COPY()

fc_font::Q_DISABLE_COPY | ( | fc_font |  | ) |

private

## ◆ release_fonts()

void fc_font::release_fonts | ( |  | ) |

Deletes all fonts

Definition at line 104 of file fonts.cpp.

Referenced by drop().

## ◆ set_font()

void fc_font::set_font | ( | QString | name,
|  | QFont * | qf
| ) |  |

Adds new font or overwrite old one

Definition at line 123 of file fonts.cpp.

Referenced by apply_font(), apply_help_font(), configure_font(), init_fonts(), and qtg_gui_update_font().

## Field Documentation

## ◆ city_fontsize

int fc_font::city_fontsize

Definition at line 53 of file fonts.h.

Referenced by get_mapfont_size().

## ◆ font_map

QMap<QString, QFont *> fc_font::font_map

private

Definition at line 42 of file fonts.h.

Referenced by get_font(), release_fonts(), and set_font().

## ◆ m_instance

fc_font * fc_font::m_instance = 0

staticprivate

Definition at line 43 of file fonts.h.

Referenced by drop(), and instance().

## ◆ prod_fontsize

int fc_font::prod_fontsize

Definition at line 54 of file fonts.h.

Referenced by get_mapfont_size().