Inkscape
Vector Graphics Editor
|
#include <font-factory.h>
Classes | |
struct | Compare |
struct | Hash |
Public Member Functions | |
void | refreshConfig () |
The fontsize used as workaround for hinting. | |
Glib::ustring | ConstructFontSpecification (PangoFontDescription *font) |
Constructs a pango string for use with the fontStringMap (see below) | |
Glib::ustring | ConstructFontSpecification (FontInstance *font) |
std::vector< std::string > | GetAllFontNames () |
Returns a list of all font names available in this font config. | |
Glib::ustring | GetUIFamilyString (PangoFontDescription const *fontDescr) |
Returns strings to be used in the UI for family and face (or "style" as the column is labeled) | |
Glib::ustring | GetUIStyleString (PangoFontDescription const *fontDescr) |
bool | hasFontFamily (std::string const &family) |
std::map< std::string, PangoFontFamily * > | GetUIFamilies () |
std::vector< StyleNames > | GetUIStyles (PangoFontFamily *in) |
std::vector< Glib::RefPtr< Pango::FontFamily > > | get_font_families () |
std::shared_ptr< FontInstance > | FaceFromStyle (SPStyle const *style) |
Retrieve a FontInstance from a style object, first trying to use the font-specification, the CSS information. | |
std::shared_ptr< FontInstance > | FaceFromDescr (char const *family, char const *style) |
std::shared_ptr< FontInstance > | FaceFromUIStrings (char const *uiFamily, char const *uiStyle) |
std::shared_ptr< FontInstance > | FaceFromPangoString (char const *pangoString) |
std::shared_ptr< FontInstance > | FaceFromFontSpecification (char const *fontSpecification) |
std::shared_ptr< FontInstance > | Face (PangoFontDescription *descr, bool canFail=true) |
std::unique_ptr< FontInstance > | create_face (PangoFontDescription *descr) |
void | AddFontFilesWin32 (char const *directory_path) |
void | AddFontsDir (char const *utf8dir) |
Add a directory from which to include additional fonts. | |
void | AddFontFile (char const *utf8file) |
Add a an additional font. | |
PangoContext * | get_font_context () const |
PangoFontDescription * | parsePostscriptName (std::string const &name, bool substitute) |
Use font config to parse the postscript name found in pdf/ps files and return font config family and style information. | |
![]() | |
EnableSingleton (EnableSingleton const &)=delete | |
EnableSingleton & | operator= (EnableSingleton const &)=delete |
Static Public Attributes | |
static constexpr double | fontSize = 512 |
Protected Member Functions | |
FontFactory () | |
~FontFactory () | |
![]() | |
EnableSingleton ()=default | |
Private Attributes | |
PangoFontMap * | fontServer |
PangoContext * | fontContext |
Glib::RefPtr< Pango::FontMap > | _font_map |
Inkscape::Util::cached_map< PangoFontDescription *, FontInstance, Hash, Compare > | loaded |
Additional Inherited Members | |
![]() | |
static FontFactory & | get (Args &&... args) |
static StaticHolder< FontFactory, Depends<> > & | getStaticHolder () |
Definition at line 59 of file font-factory.h.
|
protected |
Definition at line 209 of file font-factory.cpp.
References _font_map, FactorySubstituteFunc(), and fontServer.
|
protected |
Definition at line 222 of file font-factory.cpp.
References fontContext, fontServer, and loaded.
void FontFactory::AddFontFile | ( | char const * | utf8file | ) |
Add a an additional font.
Definition at line 748 of file font-factory.cpp.
References Inkscape::IO::file_test(), and fontServer.
Referenced by end_font_face_cb().
void FontFactory::AddFontFilesWin32 | ( | char const * | directory_path | ) |
Definition at line 691 of file font-factory.cpp.
References Inkscape::IO::Resource::get_filenames_from_path(), and result.
Referenced by AddFontsDir().
void FontFactory::AddFontsDir | ( | char const * | utf8dir | ) |
Add a directory from which to include additional fonts.
Definition at line 713 of file font-factory.cpp.
References AddFontFilesWin32(), Inkscape::IO::file_test(), and fontServer.
Glib::ustring FontFactory::ConstructFontSpecification | ( | FontInstance * | font | ) |
Definition at line 259 of file font-factory.cpp.
References ConstructFontSpecification(), and FontInstance::get_descr().
Glib::ustring FontFactory::ConstructFontSpecification | ( | PangoFontDescription * | font | ) |
Constructs a pango string for use with the fontStringMap (see below)
Definition at line 234 of file font-factory.cpp.
Referenced by ConstructFontSpecification().
std::unique_ptr< FontInstance > FontFactory::create_face | ( | PangoFontDescription * | descr | ) |
Definition at line 618 of file font-factory.cpp.
References fontContext, fontServer, fontSize, and sp_font_description_get_family().
Referenced by Inkscape::get_all_fonts().
std::shared_ptr< FontInstance > FontFactory::Face | ( | PangoFontDescription * | descr, |
bool | canFail = true |
||
) |
Definition at line 630 of file font-factory.cpp.
References Face(), fontContext, fontServer, fontSize, loaded, and sp_font_description_get_family().
Referenced by Face(), FaceFromDescr(), FaceFromPangoString(), FaceFromStyle(), getSubstituteFontName(), Inkscape::Text::Layout::InputStreamTextSource::styleGetFontInstance(), and Inkscape::FontLister::system_fontspec().
std::shared_ptr< FontInstance > FontFactory::FaceFromDescr | ( | char const * | family, |
char const * | style | ||
) |
Definition at line 570 of file font-factory.cpp.
References Face().
std::shared_ptr< FontInstance > FontFactory::FaceFromFontSpecification | ( | char const * | fontSpecification | ) |
Definition at line 602 of file font-factory.cpp.
References FaceFromPangoString().
Referenced by FaceFromStyle(), Inkscape::UI::Dialog::TextEdit::on_page_changed(), Inkscape::UI::Dialog::GlyphsPanel::rebuild(), Inkscape::UI::Widget::FontVariations::update(), and Inkscape::UI::Widget::FontVariants::update_opentype().
std::shared_ptr< FontInstance > FontFactory::FaceFromPangoString | ( | char const * | pangoString | ) |
Definition at line 579 of file font-factory.cpp.
References Face(), and sp_font_description_get_family().
Referenced by FaceFromFontSpecification().
std::shared_ptr< FontInstance > FontFactory::FaceFromStyle | ( | SPStyle const * | style | ) |
Retrieve a FontInstance from a style object, first trying to use the font-specification, the CSS information.
Definition at line 542 of file font-factory.cpp.
References Face(), FaceFromFontSpecification(), SPStyle::font_specification, and ink_font_description_from_style().
Referenced by SPText::_buildLayoutInit(), and SPFlowtext::_buildLayoutInput().
std::shared_ptr< FontInstance > FontFactory::FaceFromUIStrings | ( | char const * | uiFamily, |
char const * | uiStyle | ||
) |
|
inline |
Definition at line 113 of file font-factory.h.
References fontContext.
std::vector< Glib::RefPtr< Pango::FontFamily > > FontFactory::get_font_families | ( | ) |
Definition at line 415 of file font-factory.cpp.
References _font_map, and name.
Referenced by Inkscape::get_all_fonts().
std::vector< std::string > FontFactory::GetAllFontNames | ( | ) |
Returns a list of all font names available in this font config.
Definition at line 365 of file font-factory.cpp.
References fontServer.
std::map< std::string, PangoFontFamily * > FontFactory::GetUIFamilies | ( | ) |
Definition at line 386 of file font-factory.cpp.
References fontServer, and result.
Referenced by Inkscape::FontLister::FontLister().
Glib::ustring FontFactory::GetUIFamilyString | ( | PangoFontDescription const * | fontDescr | ) |
Returns strings to be used in the UI for family and face (or "style" as the column is labeled)
Definition at line 309 of file font-factory.cpp.
References sp_font_description_get_family().
Referenced by GetUIStyles().
std::vector< StyleNames > FontFactory::GetUIStyles | ( | PangoFontFamily * | in | ) |
Definition at line 442 of file font-factory.cpp.
References GetUIFamilyString(), GetUIStyleString(), and result.
Glib::ustring FontFactory::GetUIStyleString | ( | PangoFontDescription const * | fontDescr | ) |
Definition at line 327 of file font-factory.cpp.
Referenced by GetUIStyles().
bool FontFactory::hasFontFamily | ( | std::string const & | family | ) |
Definition at line 381 of file font-factory.cpp.
References getSubstituteFontName().
PangoFontDescription * FontFactory::parsePostscriptName | ( | std::string const & | name, |
bool | substitute | ||
) |
Use font config to parse the postscript name found in pdf/ps files and return font config family and style information.
Definition at line 815 of file font-factory.cpp.
References fontServer, name, and result.
Referenced by FontData::FontData().
void FontFactory::refreshConfig | ( | ) |
The fontsize used as workaround for hinting.
Definition at line 229 of file font-factory.cpp.
References fontServer.
Referenced by Inkscape::FontLister::FontLister().
|
private |
Definition at line 124 of file font-factory.h.
Referenced by FontFactory(), and get_font_families().
|
private |
Definition at line 123 of file font-factory.h.
Referenced by create_face(), Face(), get_font_context(), and ~FontFactory().
|
private |
Definition at line 122 of file font-factory.h.
Referenced by AddFontFile(), AddFontsDir(), create_face(), Face(), FontFactory(), GetAllFontNames(), GetUIFamilies(), parsePostscriptName(), refreshConfig(), and ~FontFactory().
|
staticconstexpr |
Definition at line 72 of file font-factory.h.
Referenced by create_face(), and Face().
|
private |
Definition at line 136 of file font-factory.h.
Referenced by Face(), and ~FontFactory().