SDRPlusPlus
SDRPlusPlus copied to clipboard
core/gui/style: support specifying fonts in the config; facilitate CJK languages users
Allow the user to specify fonts used via the configuration file and facilitate CJK users. This pull request addresses issues #701 #275 and #528 (partially); and also aims to improve the customizability of SDR++.
- Add a new config field
"fonts"containing an name-value map of font descriptors. The font descriptor object is as follows (pseudocode):
struct {
string path; // path to .ttf or .otf file
float size = 16.0f; // normal size of the font
int oversample = 2; // font oversampling level
};
By default, font descriptors Roboto and NotoSansCJK_{jp,tc,sc} are specified.
-
Add three new config fields
"baseFonts","bigFonts"and"hugeFonts"which are arrays of strings that refer to a font descriptor defined in the"fonts"field; those fields are used to build the fonts used by ImGui.
By default, all three fields only contain"Roboto". -
Adjust the placement of the comma character in the
frequency_selectwidget to work with arbitrary fonts. -
Enlarge the range of usable glyphs to contain the previous one as well as CJK.
-
Add license file for Roboto.
If this pull request gets merged, documentation will follow in the wiki.