diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-11-02 22:47:57 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-11-02 22:47:57 +0000 |
| commit | 9bf2cf3509380663e6943f6b0d22dbec6002c332 (patch) | |
| tree | 86999381629818072353ffb15d78f5815efabf69 /src/lib/font.h | |
| parent | 8a673bcf0cd26268899face63723c0f201fabcce (diff) | |
Fix incorrect preview of italic subtitles (#728).
This requires fonts to be configured with their italic versions so
that the italic font can be given to FontConfig and hence used to
render text. Bold font configuration is also added here although
bold subtitles aren't yet supported.
Diffstat (limited to 'src/lib/font.h')
| -rw-r--r-- | src/lib/font.h | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/lib/font.h b/src/lib/font.h index ca7650cc1..c165fea9f 100644 --- a/src/lib/font.h +++ b/src/lib/font.h @@ -20,6 +20,7 @@ #ifndef DCPOMATIC_FONT_H #define DCPOMATIC_FONT_H +#include "font_files.h" #include <libcxml/cxml.h> #include <boost/optional.hpp> #include <boost/signals2.hpp> @@ -40,12 +41,21 @@ public: return _id; } - boost::optional<boost::filesystem::path> file () const { - return _file; + boost::optional<boost::filesystem::path> file (FontFiles::Variant variant) const { + return _files.get (variant); } - void set_file (boost::filesystem::path file) { - _file = file; + void set_file (FontFiles::Variant variant, boost::filesystem::path file) { + _files.set (variant, file); + Changed (); + } + + FontFiles files () const { + return _files; + } + + void set_files (FontFiles files) { + _files = files; Changed (); } @@ -54,10 +64,10 @@ public: private: /** Font ID, used to describe it in the subtitle content */ std::string _id; - boost::optional<boost::filesystem::path> _file; + FontFiles _files; }; -bool -operator!= (Font const & a, Font const & b); +bool operator!= (Font const & a, Font const & b); +bool operator== (Font const & a, Font const & b); #endif |
