|
Packit Service |
e3b512 |
/* Copyright (C) 2005 The cairomm Development Team
|
|
Packit Service |
e3b512 |
*
|
|
Packit Service |
e3b512 |
* This library is free software; you can redistribute it and/or
|
|
Packit Service |
e3b512 |
* modify it under the terms of the GNU Library General Public
|
|
Packit Service |
e3b512 |
* License as published by the Free Software Foundation; either
|
|
Packit Service |
e3b512 |
* version 2 of the License, or (at your option) any later version.
|
|
Packit Service |
e3b512 |
*
|
|
Packit Service |
e3b512 |
* This library is distributed in the hope that it will be useful,
|
|
Packit Service |
e3b512 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
e3b512 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
e3b512 |
* Library General Public License for more details.
|
|
Packit Service |
e3b512 |
*
|
|
Packit Service |
e3b512 |
* You should have received a copy of the GNU Library General Public
|
|
Packit Service |
e3b512 |
* License along with this library; if not, write to the Free Software
|
|
Packit Service |
e3b512 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
Packit Service |
e3b512 |
* 02110-1301, USA.
|
|
Packit Service |
e3b512 |
*/
|
|
Packit Service |
e3b512 |
|
|
Packit Service |
e3b512 |
#ifndef __CAIROMM_FONTOPTIONS_H
|
|
Packit Service |
e3b512 |
#define __CAIROMM_FONTOPTIONS_H
|
|
Packit Service |
e3b512 |
|
|
Packit Service |
e3b512 |
#include <cairomm/enums.h>
|
|
Packit Service |
e3b512 |
#include <string>
|
|
Packit Service |
e3b512 |
//#include <cairo.h>
|
|
Packit Service |
e3b512 |
#ifdef CAIRO_HAS_FT_FONT
|
|
Packit Service |
e3b512 |
#include <cairo-ft.h>
|
|
Packit Service |
e3b512 |
#endif // CAIRO_HAS_FT_FONT
|
|
Packit Service |
e3b512 |
|
|
Packit Service |
e3b512 |
namespace Cairo
|
|
Packit Service |
e3b512 |
{
|
|
Packit Service |
e3b512 |
|
|
Packit Service |
e3b512 |
/**
|
|
Packit Service |
e3b512 |
* The font options specify how fonts should be rendered. Most of the
|
|
Packit Service |
e3b512 |
* time the font options implied by a surface are just right and do not
|
|
Packit Service |
e3b512 |
* need any changes, but for pixel-based targets tweaking font options
|
|
Packit Service |
e3b512 |
* may result in superior output on a particular display.
|
|
Packit Service |
e3b512 |
*/
|
|
Packit Service |
e3b512 |
class FontOptions
|
|
Packit Service |
e3b512 |
{
|
|
Packit Service |
e3b512 |
public:
|
|
Packit Service |
e3b512 |
FontOptions();
|
|
Packit Service |
e3b512 |
explicit FontOptions(cairo_font_options_t* cobject, bool take_ownership = false);
|
|
Packit Service |
e3b512 |
FontOptions(const FontOptions& src);
|
|
Packit Service |
e3b512 |
|
|
Packit Service |
e3b512 |
virtual ~FontOptions();
|
|
Packit Service |
e3b512 |
|
|
Packit Service |
e3b512 |
FontOptions& operator=(const FontOptions& src);
|
|
Packit Service |
e3b512 |
|
|
Packit Service |
e3b512 |
bool operator ==(const FontOptions& src) const;
|
|
Packit Service |
e3b512 |
//bool operator !=(const FontOptions& src) const;
|
|
Packit Service |
e3b512 |
|
|
Packit Service |
e3b512 |
/**
|
|
Packit Service |
e3b512 |
* Merges non-default options from @a other into this, replacing existing
|
|
Packit Service |
e3b512 |
* values. This operation can be thought of as somewhat similar to compositing
|
|
Packit Service |
e3b512 |
* @a other onto this with the operation of OPERATION_OVER.
|
|
Packit Service |
e3b512 |
*
|
|
Packit Service |
e3b512 |
* @param other another FontOptions
|
|
Packit Service |
e3b512 |
**/
|
|
Packit Service |
e3b512 |
void merge(const FontOptions& other);
|
|
Packit Service |
e3b512 |
|
|
Packit Service |
e3b512 |
/**
|
|
Packit Service |
e3b512 |
* Compute a hash for the font options object; this value will be useful when
|
|
Packit Service |
e3b512 |
* storing an object containing a FontOptions in a hash table.
|
|
Packit Service |
e3b512 |
*
|
|
Packit Service |
e3b512 |
* @return the hash value for the font options object. The return value can
|
|
Packit Service |
e3b512 |
* be cast to a 32-bit type if a 32-bit hash value is needed.
|
|
Packit Service |
e3b512 |
**/
|
|
Packit Service |
e3b512 |
unsigned long hash() const;
|
|
Packit Service |
e3b512 |
|
|
Packit Service |
e3b512 |
/**
|
|
Packit Service |
e3b512 |
* Sets the antialiasing mode for the font options object. This
|
|
Packit Service |
e3b512 |
* specifies the type of antialiasing to do when rendering text.
|
|
Packit Service |
e3b512 |
*
|
|
Packit Service |
e3b512 |
* @param antialias the new antialiasing mode.
|
|
Packit Service |
e3b512 |
**/
|
|
Packit Service |
e3b512 |
void set_antialias(Antialias antialias);
|
|
Packit Service |
e3b512 |
|
|
Packit Service |
e3b512 |
/**
|
|
Packit Service |
e3b512 |
* Gets the antialiasing mode for the font options object.
|
|
Packit Service |
e3b512 |
*
|
|
Packit Service |
e3b512 |
* @return the antialiasing mode
|
|
Packit Service |
e3b512 |
**/
|
|
Packit Service |
e3b512 |
Antialias get_antialias() const;
|
|
Packit Service |
e3b512 |
|
|
Packit Service |
e3b512 |
/**
|
|
Packit Service |
e3b512 |
* Sets the subpixel order for the font options object. The subpixel order
|
|
Packit Service |
e3b512 |
* specifies the order of color elements within each pixel on the display
|
|
Packit Service |
e3b512 |
* device when rendering with an antialiasing mode of
|
|
Packit Service |
e3b512 |
* Cairo::ANTIALIAS_SUBPIXEL. See the documentation for SubpixelOrder for
|
|
Packit Service |
e3b512 |
* full details.
|
|
Packit Service |
e3b512 |
*
|
|
Packit Service |
e3b512 |
* @param subpixel_order the new subpixel order.
|
|
Packit Service |
e3b512 |
**/
|
|
Packit Service |
e3b512 |
void set_subpixel_order(SubpixelOrder subpixel_order);
|
|
Packit Service |
e3b512 |
|
|
Packit Service |
e3b512 |
/**
|
|
Packit Service |
e3b512 |
* Gets the subpixel order for the font options object. See the documentation
|
|
Packit Service |
e3b512 |
* for SubpixelOrder for full details.
|
|
Packit Service |
e3b512 |
*
|
|
Packit Service |
e3b512 |
* @return the subpixel order for the font options object.
|
|
Packit Service |
e3b512 |
**/
|
|
Packit Service |
e3b512 |
SubpixelOrder get_subpixel_order() const;
|
|
Packit Service |
e3b512 |
|
|
Packit Service |
e3b512 |
/**
|
|
Packit Service |
e3b512 |
* Sets the hint style for font outlines for the font options object. This
|
|
Packit Service |
e3b512 |
* controls whether to fit font outlines to the pixel grid, and if so, whether
|
|
Packit Service |
e3b512 |
* to optimize for fidelity or contrast. See the documentation for
|
|
Packit Service |
e3b512 |
* HintStyle for full details.
|
|
Packit Service |
e3b512 |
*
|
|
Packit Service |
e3b512 |
* @param hint_style the new hint style.
|
|
Packit Service |
e3b512 |
**/
|
|
Packit Service |
e3b512 |
void set_hint_style(HintStyle hint_style);
|
|
Packit Service |
e3b512 |
|
|
Packit Service |
e3b512 |
/**
|
|
Packit Service |
e3b512 |
* Gets the hint style for font outlines for the font options object.
|
|
Packit Service |
e3b512 |
* See the documentation for HintStyle for full details.
|
|
Packit Service |
e3b512 |
*
|
|
Packit Service |
e3b512 |
* @return the hint style for the font options object.
|
|
Packit Service |
e3b512 |
**/
|
|
Packit Service |
e3b512 |
HintStyle get_hint_style() const;
|
|
Packit Service |
e3b512 |
|
|
Packit Service |
e3b512 |
/**
|
|
Packit Service |
e3b512 |
* Sets the metrics hinting mode for the font options object. This
|
|
Packit Service |
e3b512 |
* controls whether metrics are quantized to integer values in
|
|
Packit Service |
e3b512 |
* device units.
|
|
Packit Service |
e3b512 |
* See the documentation for HintMetrics for full details.
|
|
Packit Service |
e3b512 |
*
|
|
Packit Service |
e3b512 |
* @param hint_metrics the new metrics hinting mode.
|
|
Packit Service |
e3b512 |
**/
|
|
Packit Service |
e3b512 |
void set_hint_metrics(HintMetrics hint_metrics);
|
|
Packit Service |
e3b512 |
|
|
Packit Service |
e3b512 |
/**
|
|
Packit Service |
e3b512 |
* Gets the metrics hinting mode for the font options object. See the
|
|
Packit Service |
e3b512 |
* documentation for HintMetrics for full details.
|
|
Packit Service |
e3b512 |
*
|
|
Packit Service |
e3b512 |
* Return value: the metrics hinting mode for the font options object.
|
|
Packit Service |
e3b512 |
**/
|
|
Packit Service |
e3b512 |
HintMetrics get_hint_metrics() const;
|
|
Packit Service |
e3b512 |
|
|
Packit Service |
e3b512 |
#ifdef CAIRO_HAS_FT_FONT
|
|
Packit Service |
e3b512 |
#ifdef CAIRO_HAS_FC_FONT
|
|
Packit Service |
e3b512 |
/** Add options to a FcPattern based on a cairo_font_options_t font options
|
|
Packit Service |
e3b512 |
* object. Options that are already in the pattern, are not overridden, so you
|
|
Packit Service |
e3b512 |
* should call this function after calling FcConfigSubstitute() (the user's
|
|
Packit Service |
e3b512 |
* settings should override options based on the surface type), but before
|
|
Packit Service |
e3b512 |
* calling FcDefaultSubstitute().
|
|
Packit Service |
e3b512 |
*
|
|
Packit Service |
e3b512 |
* @param pattern an existing FcPattern.
|
|
Packit Service |
e3b512 |
*
|
|
Packit Service |
e3b512 |
* @since 1.8
|
|
Packit Service |
e3b512 |
*/
|
|
Packit Service |
e3b512 |
void substitute(FcPattern* pattern);
|
|
Packit Service |
e3b512 |
#endif // CAIRO_HAS_FC_FONT
|
|
Packit Service |
e3b512 |
#endif // CAIRO_HAS_FT_FONT
|
|
Packit Service |
e3b512 |
|
|
Packit Service |
e3b512 |
typedef cairo_font_options_t cobject;
|
|
Packit Service |
e3b512 |
inline cobject* cobj() { return m_cobject; }
|
|
Packit Service |
e3b512 |
inline const cobject* cobj() const { return m_cobject; }
|
|
Packit Service |
e3b512 |
|
|
Packit Service |
e3b512 |
#ifndef DOXYGEN_IGNORE_THIS
|
|
Packit Service |
e3b512 |
///For use only by the cairomm implementation.
|
|
Packit Service |
e3b512 |
inline ErrorStatus get_status() const
|
|
Packit Service |
e3b512 |
{ return cairo_font_options_status(const_cast<cairo_font_options_t*>(cobj())); }
|
|
Packit Service |
e3b512 |
#endif //DOXYGEN_IGNORE_THIS
|
|
Packit Service |
e3b512 |
|
|
Packit Service |
e3b512 |
protected:
|
|
Packit Service |
e3b512 |
|
|
Packit Service |
e3b512 |
cobject* m_cobject;
|
|
Packit Service |
e3b512 |
};
|
|
Packit Service |
e3b512 |
|
|
Packit Service |
e3b512 |
} // namespace Cairo
|
|
Packit Service |
e3b512 |
|
|
Packit Service |
e3b512 |
#endif //__CAIROMM_FONTOPTIONS_H
|
|
Packit Service |
e3b512 |
|
|
Packit Service |
e3b512 |
// vim: ts=2 sw=2 et
|