issue-892 (#895)

This commit is contained in:
Matthias Köfferlein 2021-08-24 21:37:02 +02:00 committed by GitHub
parent b303548591
commit 225d3ab32d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 0 deletions

View File

@ -324,6 +324,12 @@ TextGenerator::set_font_paths (const std::vector<std::string> &paths)
s_fonts_loaded = false;
}
std::vector<std::string>
TextGenerator::font_paths ()
{
return s_font_paths;
}
const std::vector<TextGenerator> &
TextGenerator::generators ()
{

View File

@ -201,6 +201,11 @@ public:
*/
static void set_font_paths (const std::vector<std::string> &paths);
/**
* @brief Gets the font search paths
*/
static std::vector<std::string> font_paths ();
/**
* @brief Returns the font with the given name
* If no font with that name exists, 0 is returned.

View File

@ -173,6 +173,20 @@ Class<db::TextGenerator> decl_TextGenerator ("db", "TextGenerator",
method ("default_generator", &db::TextGenerator::default_generator,
"@brief Gets the default text generator (a standard font)\n"
"This method delivers the default generator or nil if no such generator is installed."
) +
method ("set_font_paths", &db::TextGenerator::set_font_paths,
"@brief Sets the paths where to look for font files\n"
"This function sets the paths where to look for font files. After setting such a path, each font found will render a "
"specific generator. The generator can be found under the font file's name. As the text generator is also the basis "
"for the Basic.TEXT PCell, using this function also allows configuring custom fonts for this library cell.\n"
"\n"
"This method has been introduced in version 0.27.4."
) +
method ("font_paths", &db::TextGenerator::font_paths,
"@brief Gets the paths where to look for font files\n"
"See \\set_font_paths for a description of this function.\n"
"\n"
"This method has been introduced in version 0.27.4."
),
"@brief A text generator class\n"
"\n"