/* font.h
 * 
 * Copyright (C) 1998-1999 The gtkmm Development Team 
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, see <https://www.gnu.org/licenses/>.
 */

#include <glibmm/object.h>
#include <pangomm/rectangle.h>
#include <pangomm/language.h>
#include <pangomm/glyph.h>
#include <pangomm/fontdescription.h>
#include <pangomm/fontmetrics.h>
#include <pangomm/coverage.h>
#include <pango/pango.h>

_DEFS(pangomm,pango)
_PINCLUDE(glibmm/private/object_p.h)

namespace Pango
{

const int    SCALE          = 1024;
const double SCALE_XX_SMALL = 0.5787037037037;
const double SCALE_X_SMALL  = 0.6444444444444;
const double SCALE_SMALL    = 0.8333333333333;
const double SCALE_MEDIUM   = 1.0;
const double SCALE_LARGE    = 1.2;
const double SCALE_X_LARGE  = 1.4399999999999;
const double SCALE_XX_LARGE = 1.728;

#ifndef DOXYGEN_SHOULD_SKIP_THIS
class PANGOMM_API FontFace;
class PANGOMM_API FontMap;
#endif //DOXYGEN_SHOULD_SKIP_THIS

/** A Pango::Font is used to represent a font in a rendering-system-independent matter.
 */
class PANGOMM_API Font : public Glib::Object
{
  _CLASS_GOBJECT(Font, PangoFont, PANGO_FONT, Glib::Object, GObject, , , PANGOMM_API)
  _IGNORE(pango_font_find_shaper) // Deprecated

public:
  _WRAP_METHOD(FontDescription describe() const, pango_font_describe)
  _WRAP_METHOD(FontDescription describe_with_absolute_size() const, pango_font_describe_with_absolute_size)
  _WRAP_METHOD(Glib::RefPtr<Coverage> get_coverage(const Language& language) const, pango_font_get_coverage)

  /** Gets overall metric information for a font.
   * The metrics may be substantially different for different scripts.
   * However, this function overload returns the metrics for the entire font.
   */
  FontMetrics get_metrics() const;
  _WRAP_METHOD(FontMetrics get_metrics(const Language& language) const, pango_font_get_metrics)

  _WRAP_METHOD(void get_glyph_extents(Glyph glyph, Rectangle& ink_rect, Rectangle& logical_rect) const, pango_font_get_glyph_extents)

  _WRAP_METHOD(Glib::RefPtr<FontMap> get_font_map(), pango_font_get_font_map)
  _WRAP_METHOD(Glib::RefPtr<const FontMap> get_font_map() const, pango_font_get_font_map, constversion)

  _WRAP_METHOD(Glib::RefPtr<FontFace> get_face(), pango_font_get_face, refreturn)
  _WRAP_METHOD(Glib::RefPtr<const FontFace> get_face() const, pango_font_get_face, refreturn, constversion)

  _WRAP_METHOD(bool has_char(gunichar wc) const, pango_font_has_char)

  /** Get the ink extents of a glyph within the font.
   * @param glyph The glyph index.
   * @return The extents of the glyph as drawn.
   */
  Rectangle get_glyph_ink_extents(Glyph glyph) const;

  /** Gets the logical extents of a glyph within the font.
   * @param glyph The glyph index.
   * @return The logical extents of the glyph.
   */
  Rectangle get_glyph_logical_extents(Glyph glyph) const;

// PangoFontClass is hidden when PANGO_DISABLE_DEPRECATED is defined.
// Don't wrap vfuncs.
};

} /* namespace Pango */
