4 #include "ui_FontToolWindow.h"
6 #include <Strings/components/classes/map/map.h>
23 Ui::FontToolWindow ui;
25 std::string existing_file_path =
"";
26 QPixmap cached_atlas = QPixmap();
27 bool any_glyphs_cutoff =
false;
28 BlamMap<char, BlamGlyphUVInfo> cached_uvs = BlamMap<char, BlamGlyphUVInfo>();
31 bool LoadExistingFont();
32 bool SaveAsXMLBitmap(
bool use_atlas);
35 QFont::HintingPreference GetSelectedHintingPreference();
36 QFont::StyleStrategy GetSelectedStyleStrategy();
37 QFont::Weight GetSelectedFontWeight();
43 void RefreshPreview();
44 void RefreshAtlasPreview(
bool regenerate_texture =
false);
45 QPixmap GenerateAtlasTexture(
int resolution,
int unit_size,
int units, QColor text_color = QColor(0,0,0, 255));
48 QImage GetCharacterImage(QChar character, QColor color = QColor(0, 0, 0, 255),
int max_width = -1,
int max_height = -1);
49 QImage CropImage(QImage bitm,
bool adjust_width,
bool adjust_height,
bool baseline_fix,
bool x_fix =
true,
50 int max_width = -1,
int max_height = -1);
51 bool IsRowEmpty(QImage bitm,
int row);
52 bool IsColumnEmpty(QImage bitm,
int column);
55 FontToolWindow(std::string _existing_file_path =
"", QWidget *parent = Q_NULLPTR);
59 void RefreshButtonClicked();
60 void ExitButtonClicked();
61 void ExportButtonClicked();
62 void EditGlyphsButtonClicked();
63 void FontBrowseButtonClicked();
64 void GenerateAtlasButtonClicked();
66 void GenericDropdownChanged(
int index);
67 void GenericCheckboxChanged(
int state);
68 void SizeSpinboxChanged(
double value);
69 void GenericSpinboxChanged(
int value);
71 void PreviewTextChanged(QString text);