pango-coverage.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /* Pango
  2. * pango-coverage.h: Coverage sets for fonts
  3. *
  4. * Copyright (C) 2000 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_COVERAGE_H__
  22. #define __PANGO_COVERAGE_H__
  23. #include <glib-object.h>
  24. #include <pango/pango-version-macros.h>
  25. #include <hb.h>
  26. G_BEGIN_DECLS
  27. /**
  28. * PangoCoverage:
  29. *
  30. * A `PangoCoverage` structure is a map from Unicode characters
  31. * to [enum@Pango.CoverageLevel] values.
  32. *
  33. * It is often necessary in Pango to determine if a particular
  34. * font can represent a particular character, and also how well
  35. * it can represent that character. The `PangoCoverage` is a data
  36. * structure that is used to represent that information. It is an
  37. * opaque structure with no public fields.
  38. */
  39. typedef struct _PangoCoverage PangoCoverage;
  40. /**
  41. * PangoCoverageLevel:
  42. * @PANGO_COVERAGE_NONE: The character is not representable with
  43. * the font.
  44. * @PANGO_COVERAGE_FALLBACK: The character is represented in a
  45. * way that may be comprehensible but is not the correct
  46. * graphical form. For instance, a Hangul character represented
  47. * as a a sequence of Jamos, or a Latin transliteration of a
  48. * Cyrillic word.
  49. * @PANGO_COVERAGE_APPROXIMATE: The character is represented as
  50. * basically the correct graphical form, but with a stylistic
  51. * variant inappropriate for the current script.
  52. * @PANGO_COVERAGE_EXACT: The character is represented as the
  53. * correct graphical form.
  54. *
  55. * `PangoCoverageLevel` is used to indicate how well a font can
  56. * represent a particular Unicode character for a particular script.
  57. *
  58. * Since 1.44, only %PANGO_COVERAGE_NONE and %PANGO_COVERAGE_EXACT
  59. * will be returned.
  60. */
  61. typedef enum {
  62. PANGO_COVERAGE_NONE,
  63. PANGO_COVERAGE_FALLBACK,
  64. PANGO_COVERAGE_APPROXIMATE,
  65. PANGO_COVERAGE_EXACT
  66. } PangoCoverageLevel;
  67. PANGO_AVAILABLE_IN_ALL
  68. GType pango_coverage_get_type (void) G_GNUC_CONST;
  69. PANGO_AVAILABLE_IN_ALL
  70. PangoCoverage * pango_coverage_new (void);
  71. PANGO_DEPRECATED_IN_1_52_FOR(g_object_ref)
  72. PangoCoverage * pango_coverage_ref (PangoCoverage *coverage);
  73. PANGO_DEPRECATED_IN_1_52_FOR(g_object_unref)
  74. void pango_coverage_unref (PangoCoverage *coverage);
  75. PANGO_AVAILABLE_IN_ALL
  76. PangoCoverage * pango_coverage_copy (PangoCoverage *coverage);
  77. PANGO_AVAILABLE_IN_ALL
  78. PangoCoverageLevel pango_coverage_get (PangoCoverage *coverage,
  79. int index_);
  80. PANGO_AVAILABLE_IN_ALL
  81. void pango_coverage_set (PangoCoverage *coverage,
  82. int index_,
  83. PangoCoverageLevel level);
  84. PANGO_DEPRECATED_IN_1_44
  85. void pango_coverage_max (PangoCoverage *coverage,
  86. PangoCoverage *other);
  87. PANGO_DEPRECATED_IN_1_44
  88. void pango_coverage_to_bytes (PangoCoverage *coverage,
  89. guchar **bytes,
  90. int *n_bytes);
  91. PANGO_DEPRECATED_IN_1_44
  92. PangoCoverage *pango_coverage_from_bytes (guchar *bytes,
  93. int n_bytes);
  94. G_DEFINE_AUTOPTR_CLEANUP_FUNC(PangoCoverage, g_object_unref)
  95. G_END_DECLS
  96. #endif /* __PANGO_COVERAGE_H__ */