選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 
 
 

198 行
7.9 KiB

  1. /* Pango
  2. * pango-ot.h:
  3. *
  4. * Copyright (C) 2000,2007 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_OT_H__
  22. #define __PANGO_OT_H__
  23. #include <pango/pangofc-font.h>
  24. #include <pango/pango-glyph.h>
  25. #include <pango/pango-font.h>
  26. #include <pango/pango-script.h>
  27. #include <pango/pango-language.h>
  28. G_BEGIN_DECLS
  29. #ifdef PANGO_ENABLE_ENGINE
  30. typedef guint32 PangoOTTag;
  31. #define PANGO_OT_TAG_MAKE(c1,c2,c3,c4) ((PangoOTTag) FT_MAKE_TAG (c1, c2, c3, c4))
  32. #define PANGO_OT_TAG_MAKE_FROM_STRING(s) (PANGO_OT_TAG_MAKE(((const char *) s)[0], \
  33. ((const char *) s)[1], \
  34. ((const char *) s)[2], \
  35. ((const char *) s)[3]))
  36. typedef struct _PangoOTInfo PangoOTInfo;
  37. typedef struct _PangoOTBuffer PangoOTBuffer;
  38. typedef struct _PangoOTGlyph PangoOTGlyph;
  39. typedef struct _PangoOTRuleset PangoOTRuleset;
  40. typedef struct _PangoOTFeatureMap PangoOTFeatureMap;
  41. typedef struct _PangoOTRulesetDescription PangoOTRulesetDescription;
  42. typedef enum
  43. {
  44. PANGO_OT_TABLE_GSUB,
  45. PANGO_OT_TABLE_GPOS
  46. } PangoOTTableType;
  47. #define PANGO_OT_ALL_GLYPHS ((guint) 0xFFFF)
  48. #define PANGO_OT_NO_FEATURE ((guint) 0xFFFF)
  49. #define PANGO_OT_NO_SCRIPT ((guint) 0xFFFF)
  50. #define PANGO_OT_DEFAULT_LANGUAGE ((guint) 0xFFFF)
  51. #define PANGO_OT_TAG_DEFAULT_SCRIPT PANGO_OT_TAG_MAKE ('D', 'F', 'L', 'T')
  52. #define PANGO_OT_TAG_DEFAULT_LANGUAGE PANGO_OT_TAG_MAKE ('d', 'f', 'l', 't')
  53. /* Note that this must match hb_glyph_info_t */
  54. struct _PangoOTGlyph
  55. {
  56. guint32 glyph;
  57. guint properties;
  58. guint cluster;
  59. gushort component;
  60. gushort ligID;
  61. guint internal;
  62. };
  63. struct _PangoOTFeatureMap
  64. {
  65. char feature_name[5];
  66. gulong property_bit;
  67. };
  68. struct _PangoOTRulesetDescription {
  69. PangoScript script;
  70. PangoLanguage *language;
  71. const PangoOTFeatureMap *static_gsub_features;
  72. guint n_static_gsub_features;
  73. const PangoOTFeatureMap *static_gpos_features;
  74. guint n_static_gpos_features;
  75. const PangoOTFeatureMap *other_features;
  76. guint n_other_features;
  77. };
  78. #define PANGO_TYPE_OT_INFO (pango_ot_info_get_type ())
  79. #define PANGO_OT_INFO(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_OT_INFO, PangoOTInfo))
  80. #define PANGO_IS_OT_INFO(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_OT_INFO))
  81. GType pango_ot_info_get_type (void) G_GNUC_CONST;
  82. #define PANGO_TYPE_OT_RULESET (pango_ot_ruleset_get_type ())
  83. #define PANGO_OT_RULESET(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_OT_RULESET, PangoOTRuleset))
  84. #define PANGO_IS_OT_RULESET(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_OT_RULESET))
  85. GType pango_ot_ruleset_get_type (void) G_GNUC_CONST;
  86. PangoOTInfo *pango_ot_info_get (FT_Face face);
  87. gboolean pango_ot_info_find_script (PangoOTInfo *info,
  88. PangoOTTableType table_type,
  89. PangoOTTag script_tag,
  90. guint *script_index);
  91. gboolean pango_ot_info_find_language (PangoOTInfo *info,
  92. PangoOTTableType table_type,
  93. guint script_index,
  94. PangoOTTag language_tag,
  95. guint *language_index,
  96. guint *required_feature_index);
  97. gboolean pango_ot_info_find_feature (PangoOTInfo *info,
  98. PangoOTTableType table_type,
  99. PangoOTTag feature_tag,
  100. guint script_index,
  101. guint language_index,
  102. guint *feature_index);
  103. PangoOTTag *pango_ot_info_list_scripts (PangoOTInfo *info,
  104. PangoOTTableType table_type);
  105. PangoOTTag *pango_ot_info_list_languages (PangoOTInfo *info,
  106. PangoOTTableType table_type,
  107. guint script_index,
  108. PangoOTTag language_tag);
  109. PangoOTTag *pango_ot_info_list_features (PangoOTInfo *info,
  110. PangoOTTableType table_type,
  111. PangoOTTag tag,
  112. guint script_index,
  113. guint language_index);
  114. PangoOTBuffer *pango_ot_buffer_new (PangoFcFont *font);
  115. void pango_ot_buffer_destroy (PangoOTBuffer *buffer);
  116. void pango_ot_buffer_clear (PangoOTBuffer *buffer);
  117. void pango_ot_buffer_set_rtl (PangoOTBuffer *buffer,
  118. gboolean rtl);
  119. void pango_ot_buffer_add_glyph (PangoOTBuffer *buffer,
  120. guint glyph,
  121. guint properties,
  122. guint cluster);
  123. void pango_ot_buffer_get_glyphs (const PangoOTBuffer *buffer,
  124. PangoOTGlyph **glyphs,
  125. int *n_glyphs);
  126. void pango_ot_buffer_output (const PangoOTBuffer *buffer,
  127. PangoGlyphString *glyphs);
  128. void pango_ot_buffer_set_zero_width_marks (PangoOTBuffer *buffer,
  129. gboolean zero_width_marks);
  130. const PangoOTRuleset *pango_ot_ruleset_get_for_description (PangoOTInfo *info,
  131. const PangoOTRulesetDescription *desc);
  132. PangoOTRuleset *pango_ot_ruleset_new (PangoOTInfo *info);
  133. PangoOTRuleset *pango_ot_ruleset_new_for (PangoOTInfo *info,
  134. PangoScript script,
  135. PangoLanguage *language);
  136. PangoOTRuleset *pango_ot_ruleset_new_from_description (PangoOTInfo *info,
  137. const PangoOTRulesetDescription *desc);
  138. void pango_ot_ruleset_add_feature (PangoOTRuleset *ruleset,
  139. PangoOTTableType table_type,
  140. guint feature_index,
  141. gulong property_bit);
  142. gboolean pango_ot_ruleset_maybe_add_feature (PangoOTRuleset *ruleset,
  143. PangoOTTableType table_type,
  144. PangoOTTag feature_tag,
  145. gulong property_bit);
  146. guint pango_ot_ruleset_maybe_add_features (PangoOTRuleset *ruleset,
  147. PangoOTTableType table_type,
  148. const PangoOTFeatureMap *features,
  149. guint n_features);
  150. guint pango_ot_ruleset_get_feature_count (const PangoOTRuleset *ruleset,
  151. guint *n_gsub_features,
  152. guint *n_gpos_features);
  153. void pango_ot_ruleset_substitute (const PangoOTRuleset *ruleset,
  154. PangoOTBuffer *buffer);
  155. void pango_ot_ruleset_position (const PangoOTRuleset *ruleset,
  156. PangoOTBuffer *buffer);
  157. PangoScript pango_ot_tag_to_script (PangoOTTag script_tag) G_GNUC_CONST;
  158. PangoOTTag pango_ot_tag_from_script (PangoScript script) G_GNUC_CONST;
  159. PangoLanguage *pango_ot_tag_to_language (PangoOTTag language_tag) G_GNUC_CONST;
  160. PangoOTTag pango_ot_tag_from_language (PangoLanguage *language) G_GNUC_CONST;
  161. guint pango_ot_ruleset_description_hash (const PangoOTRulesetDescription *desc) G_GNUC_PURE;
  162. gboolean pango_ot_ruleset_description_equal (const PangoOTRulesetDescription *desc1,
  163. const PangoOTRulesetDescription *desc2) G_GNUC_PURE;
  164. PangoOTRulesetDescription *pango_ot_ruleset_description_copy (const PangoOTRulesetDescription *desc);
  165. void pango_ot_ruleset_description_free (PangoOTRulesetDescription *desc);
  166. #endif /* PANGO_ENABLE_ENGINE */
  167. G_END_DECLS
  168. #endif /* __PANGO_OT_H__ */