diff options
author | Chun-wei Fan <fanchunwei@src.gnome.org> | 2014-09-18 17:22:23 +0800 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2015-08-20 20:27:20 +0200 |
commit | 8ee48fd38766641d91f5472e922a2602df1a52ef (patch) | |
tree | ced5b4b65208827cf469b23a674a169315fde390 | |
parent | d8824ca6177f7e298743dfacc503077d6b82a039 (diff) |
fontface/fontoption: Check for CAIRO_HAS_FC_FONT
This updates the fontface and fontoptions sources so that they will check
for whether Cairo was built with FontConfig (in addition to FreeType) so
that cairomm would still build when we have Cairo built with FreeType but
without FontConfig, which for example may well be the case on Windows
builds.
https://bugs.freedesktop.org/show_bug.cgi?id=84033
-rw-r--r-- | cairomm/fontface.cc | 2 | ||||
-rw-r--r-- | cairomm/fontface.h | 4 | ||||
-rw-r--r-- | cairomm/fontoptions.cc | 2 | ||||
-rw-r--r-- | cairomm/fontoptions.h | 2 |
4 files changed, 10 insertions, 0 deletions
diff --git a/cairomm/fontface.cc b/cairomm/fontface.cc index bf35719..fc29636 100644 --- a/cairomm/fontface.cc +++ b/cairomm/fontface.cc @@ -390,6 +390,7 @@ FtFontFace::FtFontFace(FT_Face face, int load_flags) : check_status_and_throw_exception(cairo_font_face_status(m_cobject)); } +#ifdef CAIRO_HAS_FC_FONT RefPtr<FtFontFace> FtFontFace::create(FcPattern* pattern) { @@ -402,6 +403,7 @@ FtFontFace::FtFontFace(FcPattern* pattern) : { check_status_and_throw_exception(cairo_font_face_status(m_cobject)); } +#endif // CAIRO_HAS_FC_FONT void FtFontFace::set_synthesize(FtSynthesize synth_flags) { diff --git a/cairomm/fontface.h b/cairomm/fontface.h index 909d6bb..1b5f87f 100644 --- a/cairomm/fontface.h +++ b/cairomm/fontface.h @@ -436,6 +436,7 @@ public: static RefPtr<FtFontFace> create(FT_Face face, int load_flags); //TODO: Add a suitable default value for load_flags? +#ifdef CAIRO_HAS_FC_FONT /** Creates a new font face for the FreeType font backend based on a * fontconfig pattern. This font can then be used with Context::set_font_face() * or FtScaledFont::create(). @@ -465,6 +466,7 @@ public: * @since 1.8 */ static RefPtr<FtFontFace> create(FcPattern* pattern); +#endif // CAIRO_HAS_FC_FONT /** Sets synthesis options to control how FreeType renders the glyphs for a * particular font face. The given options are ORed with the currently active @@ -490,7 +492,9 @@ public: protected: FtFontFace(FT_Face face, int load_flags); +#ifdef CAIRO_HAS_FC_FONT FtFontFace(FcPattern* pattern); +#endif // CAIRO_HAS_FC_FONT }; #endif // CAIRO_HAS_FT_FONT diff --git a/cairomm/fontoptions.cc b/cairomm/fontoptions.cc index 7db5c98..71198cb 100644 --- a/cairomm/fontoptions.cc +++ b/cairomm/fontoptions.cc @@ -156,11 +156,13 @@ HintMetrics FontOptions::get_hint_metrics() const } #ifdef CAIRO_HAS_FT_FONT +#ifdef CAIRO_HAS_FC_FONT void FontOptions::substitute(FcPattern* pattern) { cairo_ft_font_options_substitute(cobj(), pattern); check_object_status_and_throw_exception(*this); } +#endif // CAIRO_HAS_FC_FONT #endif // CAIRO_HAS_FT_FONT } //namespace Cairo diff --git a/cairomm/fontoptions.h b/cairomm/fontoptions.h index a2430db..3059c69 100644 --- a/cairomm/fontoptions.h +++ b/cairomm/fontoptions.h @@ -138,6 +138,7 @@ public: HintMetrics get_hint_metrics() const; #ifdef CAIRO_HAS_FT_FONT +#ifdef CAIRO_HAS_FC_FONT /** Add options to a FcPattern based on a cairo_font_options_t font options * object. Options that are already in the pattern, are not overridden, so you * should call this function after calling FcConfigSubstitute() (the user's @@ -149,6 +150,7 @@ public: * @since 1.8 */ void substitute(FcPattern* pattern); +#endif // CAIRO_HAS_FC_FONT #endif // CAIRO_HAS_FT_FONT typedef cairo_font_options_t cobject; |