pangofc-font.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /* Pango
  2. * pangofc-font.h: Base fontmap type for fontconfig-based backends
  3. *
  4. * Copyright (C) 2003 Red Hat Software
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Library General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2 of the License, or (at your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Library General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Library General Public
  17. * License along with this library; if not, write to the
  18. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  19. * Boston, MA 02111-1307, USA.
  20. */
  21. #ifndef __PANGO_FC_FONT_H__
  22. #define __PANGO_FC_FONT_H__
  23. #include <pango/pango-glyph.h>
  24. #include <pango/pango-font.h>
  25. #include <pango/pango-glyph.h>
  26. /* FreeType has undefined macros in its header */
  27. #ifdef PANGO_COMPILATION
  28. #pragma GCC diagnostic push
  29. #pragma GCC diagnostic ignored "-Wundef"
  30. #endif
  31. #include <ft2build.h>
  32. #include FT_FREETYPE_H
  33. #include <fontconfig/fontconfig.h>
  34. #ifdef PANGO_COMPILATION
  35. #pragma GCC diagnostic pop
  36. #endif
  37. G_BEGIN_DECLS
  38. #ifdef __GI_SCANNER__
  39. #define PANGO_FC_TYPE_FONT (pango_fc_font_get_type ())
  40. #define PANGO_FC_FONT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_FC_TYPE_FONT, PangoFcFont))
  41. #define PANGO_FC_IS_FONT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_FC_TYPE_FONT))
  42. #else
  43. #define PANGO_TYPE_FC_FONT (pango_fc_font_get_type ())
  44. #define PANGO_FC_FONT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FC_FONT, PangoFcFont))
  45. #define PANGO_IS_FC_FONT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FC_FONT))
  46. #endif
  47. typedef struct _PangoFcFont PangoFcFont;
  48. typedef struct _PangoFcFontClass PangoFcFontClass;
  49. #ifndef PANGO_DISABLE_DEPRECATED
  50. /**
  51. * PangoFcFont:
  52. *
  53. * `PangoFcFont` is a base class for font implementations
  54. * using the Fontconfig and FreeType libraries.
  55. *
  56. * It is used in onjunction with [class@PangoFc.FontMap].
  57. * When deriving from this class, you need to implement all
  58. * of its virtual functions other than shutdown() along with
  59. * the get_glyph_extents() virtual function from `PangoFont`.
  60. */
  61. struct _PangoFcFont
  62. {
  63. PangoFont parent_instance;
  64. FcPattern *font_pattern; /* fully resolved pattern */
  65. PangoFontMap *fontmap; /* associated map (no strong reference is held,
  66. * but a g_object_add_weak_pointer() guards it) */
  67. gpointer priv; /* used internally */
  68. PangoMatrix matrix; /* unused */
  69. PangoFontDescription *description;
  70. GSList *metrics_by_lang;
  71. guint is_hinted : 1;
  72. guint is_transformed : 1;
  73. };
  74. #endif /* PANGO_DISABLE_DEPRECATED */
  75. PANGO_AVAILABLE_IN_ALL
  76. GType pango_fc_font_get_type (void) G_GNUC_CONST;
  77. PANGO_DEPRECATED_IN_1_44
  78. gboolean pango_fc_font_has_char (PangoFcFont *font,
  79. gunichar wc);
  80. PANGO_AVAILABLE_IN_1_4
  81. guint pango_fc_font_get_glyph (PangoFcFont *font,
  82. gunichar wc);
  83. PANGO_DEPRECATED_IN_1_50_FOR(pango_font_get_language)
  84. PangoLanguage **
  85. pango_fc_font_get_languages (PangoFcFont *font);
  86. PANGO_AVAILABLE_IN_1_48
  87. FcPattern *pango_fc_font_get_pattern (PangoFcFont *font);
  88. PANGO_DEPRECATED_FOR(PANGO_GET_UNKNOWN_GLYPH)
  89. PangoGlyph pango_fc_font_get_unknown_glyph (PangoFcFont *font,
  90. gunichar wc);
  91. PANGO_DEPRECATED_IN_1_32
  92. void pango_fc_font_kern_glyphs (PangoFcFont *font,
  93. PangoGlyphString *glyphs);
  94. PANGO_DEPRECATED_IN_1_44_FOR(pango_font_get_hb_font)
  95. FT_Face pango_fc_font_lock_face (PangoFcFont *font);
  96. PANGO_DEPRECATED_IN_1_44_FOR(pango_font_get_hb_font)
  97. void pango_fc_font_unlock_face (PangoFcFont *font);
  98. G_END_DECLS
  99. #endif /* __PANGO_FC_FONT_H__ */