SDRPlusPlus icon indicating copy to clipboard operation
SDRPlusPlus copied to clipboard

core/gui/style: support specifying fonts in the config; facilitate CJK languages users

Open aosync opened this issue 3 years ago • 0 comments

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++.

  1. 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.

  1. 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".

  2. Adjust the placement of the comma character in the frequency_select widget to work with arbitrary fonts.

  3. Enlarge the range of usable glyphs to contain the previous one as well as CJK.

  4. Add license file for Roboto.

If this pull request gets merged, documentation will follow in the wiki.

aosync avatar Aug 18 '22 11:08 aosync