use a more complete font did some primitive font substitution logic.
NotoSans was chosen because it contains all Latin, Cyrillic and Greek characters in one file. To test the substitution the separate font files for Armenian and Georgian were also added, even though the languages have not been translated.
This commit is contained in:
parent
3caca15c61
commit
f5c4964902
11 changed files with 104 additions and 21 deletions
|
|
@ -4,5 +4,12 @@
|
|||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
std::vector<uint8_t> LoadWidgetFontData(const std::string& name);
|
||||
struct SingleFontData
|
||||
{
|
||||
std::vector<uint8_t> fontdata;
|
||||
std::vector<std::pair<uint32_t, uint32_t>> ranges;
|
||||
int language = -1; // mainly useful if we start supporting Chinese so that we can use another font there than for Japanese.
|
||||
};
|
||||
|
||||
std::vector<SingleFontData> LoadWidgetFontData(const std::string& name);
|
||||
std::vector<uint8_t> LoadWidgetImageData(const std::string& name);
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ private:
|
|||
|
||||
bool select_all_on_focus_gain = false;
|
||||
|
||||
std::shared_ptr<Font> font = Font::Create("Segoe UI", 12.0);
|
||||
std::shared_ptr<Font> font = Font::Create("NotoSans", 12.0);
|
||||
|
||||
template<typename T>
|
||||
static T clamp(T val, T minval, T maxval) { return std::max<T>(std::min<T>(val, maxval), minval); }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue