4 #include "ui_FontToolWindow.h"
6 #include <Strings/components/classes/map/map.h>
35 Ui::FontToolWindow ui;
37 std::string existing_file_path =
"";
38 QPixmap cached_atlas = QPixmap();
39 bool any_glyphs_cutoff =
false;
40 BlamMap<char, BlamGlyphUVInfo> cached_uvs = BlamMap<char, BlamGlyphUVInfo>();
51 bool LoadExistingFont();
61 bool SaveAsXMLBitmap(
bool use_atlas);
70 QFont::HintingPreference GetSelectedHintingPreference();
77 QFont::StyleStrategy GetSelectedStyleStrategy();
84 QFont::Weight GetSelectedFontWeight();
110 void RefreshPreview();
117 void RefreshAtlasPreview(
bool regenerate_texture =
false);
129 QPixmap GenerateAtlasTexture(
int resolution,
int unit_size,
int units, QColor text_color = QColor(0,0,0, 255));
143 QImage GetCharacterImage(QChar character, QColor color = QColor(0, 0, 0, 255),
int max_width = -1,
int max_height = -1);
160 QImage CropImage(QImage bitm,
bool adjust_width,
bool adjust_height,
bool baseline_fix,
bool x_fix =
true,
161 int max_width = -1,
int max_height = -1);
173 bool IsRowEmpty(QImage bitm,
int row);
185 bool IsColumnEmpty(QImage bitm,
int column);
194 FontToolWindow(std::string _existing_file_path =
"", QWidget* parent = Q_NULLPTR);
202 void RefreshButtonClicked();
207 void ExitButtonClicked();
212 void ExportButtonClicked();
217 void EditGlyphsButtonClicked();
222 void FontBrowseButtonClicked();
227 void GenerateAtlasButtonClicked();
234 void GenericDropdownChanged(
int index);
241 void GenericCheckboxChanged(
int state);
248 void SizeSpinboxChanged(
double value);
255 void GenericSpinboxChanged(
int value);
262 void PreviewTextChanged(QString text);