# fontoptions.h

Go to the documentation of this file.

    00001 /* Copyright (C) 2005 The cairomm Development Team
    00002  *
    00003  * This library is free software; you can redistribute it and/or
    00004  * modify it under the terms of the GNU Library General Public
    00005  * License as published by the Free Software Foundation; either
    00006  * version 2 of the License, or (at your option) any later version.
    00007  *
    00008  * This library is distributed in the hope that it will be useful,
    00009  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    00010  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00011  * Library General Public License for more details.
    00012  *
    00013  * You should have received a copy of the GNU Library General Public
    00014  * License along with this library; if not, write to the Free Software
    00015  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    00016  * 02110-1301, USA.
    00017  */
    00018
    00019 #ifndef __CAIROMM_FONTOPTIONS_H
    00020 #define __CAIROMM_FONTOPTIONS_H
    00021
    00022 #include <cairomm/enums.h>
    00023 #include <string>
    00024 //#include <cairo.h>
    00025 #ifdef CAIRO_HAS_FT_FONT
    00026 #include <cairo-ft.h>
    00027 #endif // CAIRO_HAS_FT_FONT
    00028
    00029 namespace Cairo
    00030 {
    00031
    00034 class FontOptions
    00035 {
    00036 public:
    00037   FontOptions();
    00038   explicit FontOptions(cairo_font_options_t* cobject, bool take_ownership = false);
    00039   FontOptions(const FontOptions& src);
    00040
    00041   virtual ~FontOptions();
    00042
    00043   FontOptions& operator=(const FontOptions& src);
    00044
    00045   bool operator ==(const FontOptions& src) const;
    00046   //bool operator !=(const FontOptions& src) const;
    00047
    00055   void merge(const FontOptions& other);
    00056
    00064   unsigned long hash() const;
    00065
    00072   void set_antialias(Antialias antialias);
    00073
    00079   Antialias get_antialias() const;
    00080
    00089   void set_subpixel_order(SubpixelOrder subpixel_order);
    00090
    00097   SubpixelOrder get_subpixel_order() const;
    00098
    00107   void set_hint_style(HintStyle hint_style);
    00108
    00115   HintStyle get_hint_style() const;
    00116
    00125   void set_hint_metrics(HintMetrics hint_metrics);
    00126
    00133   HintMetrics get_hint_metrics() const;
    00134
    00135 #ifdef CAIRO_HAS_FT_FONT
    00136
    00146   void substitute(FcPattern* pattern);
    00147 #endif // CAIRO_HAS_FT_FONT
    00148
    00149   typedef cairo_font_options_t cobject;
    00150   inline cobject* cobj() { return m_cobject; }
    00151   inline const cobject* cobj() const { return m_cobject; }
    00152
    00153   #ifndef DOXYGEN_IGNORE_THIS
    00155   inline ErrorStatus get_status() const
    00156   { return cairo_font_options_status(const_cast<cairo_font_options_t*>(cobj())); }
    00157   #endif //DOXYGEN_IGNORE_THIS
    00158
    00159 protected:
    00160
    00161   cobject* m_cobject;
    00162 };
    00163
    00164 } // namespace Cairo
    00165
    00166 #endif //__CAIROMM_FONTOPTIONS_H
    00167
    00168 // vim: ts=2 sw=2 et