pango-attributes.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598
  1. /* Pango
  2. * pango-attributes.h: Attributed text
  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_ATTRIBUTES_H__
  22. #define __PANGO_ATTRIBUTES_H__
  23. #include <pango/pango-font.h>
  24. #include <glib-object.h>
  25. G_BEGIN_DECLS
  26. /* PangoColor */
  27. typedef struct _PangoColor PangoColor;
  28. /**
  29. * PangoColor:
  30. * @red: value of red component
  31. * @green: value of green component
  32. * @blue: value of blue component
  33. *
  34. * The #PangoColor structure is used to
  35. * represent a color in an uncalibrated RGB color-space.
  36. */
  37. struct _PangoColor
  38. {
  39. guint16 red;
  40. guint16 green;
  41. guint16 blue;
  42. };
  43. /**
  44. * PANGO_TYPE_COLOR:
  45. *
  46. * The #GObject type for #PangoColor.
  47. */
  48. #define PANGO_TYPE_COLOR pango_color_get_type ()
  49. PANGO_AVAILABLE_IN_ALL
  50. GType pango_color_get_type (void) G_GNUC_CONST;
  51. PANGO_AVAILABLE_IN_ALL
  52. PangoColor *pango_color_copy (const PangoColor *src);
  53. PANGO_AVAILABLE_IN_ALL
  54. void pango_color_free (PangoColor *color);
  55. PANGO_AVAILABLE_IN_ALL
  56. gboolean pango_color_parse (PangoColor *color,
  57. const char *spec);
  58. PANGO_AVAILABLE_IN_1_16
  59. gchar *pango_color_to_string(const PangoColor *color);
  60. /* Attributes */
  61. typedef struct _PangoAttribute PangoAttribute;
  62. typedef struct _PangoAttrClass PangoAttrClass;
  63. typedef struct _PangoAttrString PangoAttrString;
  64. typedef struct _PangoAttrLanguage PangoAttrLanguage;
  65. typedef struct _PangoAttrInt PangoAttrInt;
  66. typedef struct _PangoAttrSize PangoAttrSize;
  67. typedef struct _PangoAttrFloat PangoAttrFloat;
  68. typedef struct _PangoAttrColor PangoAttrColor;
  69. typedef struct _PangoAttrFontDesc PangoAttrFontDesc;
  70. typedef struct _PangoAttrShape PangoAttrShape;
  71. typedef struct _PangoAttrFontFeatures PangoAttrFontFeatures;
  72. /**
  73. * PANGO_TYPE_ATTR_LIST:
  74. *
  75. * The #GObject type for #PangoAttrList.
  76. */
  77. #define PANGO_TYPE_ATTR_LIST pango_attr_list_get_type ()
  78. /**
  79. * PangoAttrIterator:
  80. *
  81. * The #PangoAttrIterator structure is used to represent an
  82. * iterator through a #PangoAttrList. A new iterator is created
  83. * with pango_attr_list_get_iterator(). Once the iterator
  84. * is created, it can be advanced through the style changes
  85. * in the text using pango_attr_iterator_next(). At each
  86. * style change, the range of the current style segment and the
  87. * attributes currently in effect can be queried.
  88. */
  89. /**
  90. * PangoAttrList:
  91. *
  92. * The #PangoAttrList structure represents a list of attributes
  93. * that apply to a section of text. The attributes are, in general,
  94. * allowed to overlap in an arbitrary fashion, however, if the
  95. * attributes are manipulated only through pango_attr_list_change(),
  96. * the overlap between properties will meet stricter criteria.
  97. *
  98. * Since the #PangoAttrList structure is stored as a linear list,
  99. * it is not suitable for storing attributes for large amounts
  100. * of text. In general, you should not use a single #PangoAttrList
  101. * for more than one paragraph of text.
  102. */
  103. typedef struct _PangoAttrList PangoAttrList;
  104. typedef struct _PangoAttrIterator PangoAttrIterator;
  105. /**
  106. * PangoAttrType:
  107. * @PANGO_ATTR_INVALID: does not happen
  108. * @PANGO_ATTR_LANGUAGE: language (#PangoAttrLanguage)
  109. * @PANGO_ATTR_FAMILY: font family name list (#PangoAttrString)
  110. * @PANGO_ATTR_STYLE: font slant style (#PangoAttrInt)
  111. * @PANGO_ATTR_WEIGHT: font weight (#PangoAttrInt)
  112. * @PANGO_ATTR_VARIANT: font variant (normal or small caps) (#PangoAttrInt)
  113. * @PANGO_ATTR_STRETCH: font stretch (#PangoAttrInt)
  114. * @PANGO_ATTR_SIZE: font size in points scaled by %PANGO_SCALE (#PangoAttrInt)
  115. * @PANGO_ATTR_FONT_DESC: font description (#PangoAttrFontDesc)
  116. * @PANGO_ATTR_FOREGROUND: foreground color (#PangoAttrColor)
  117. * @PANGO_ATTR_BACKGROUND: background color (#PangoAttrColor)
  118. * @PANGO_ATTR_UNDERLINE: whether the text has an underline (#PangoAttrInt)
  119. * @PANGO_ATTR_STRIKETHROUGH: whether the text is struck-through (#PangoAttrInt)
  120. * @PANGO_ATTR_RISE: baseline displacement (#PangoAttrInt)
  121. * @PANGO_ATTR_SHAPE: shape (#PangoAttrShape)
  122. * @PANGO_ATTR_SCALE: font size scale factor (#PangoAttrFloat)
  123. * @PANGO_ATTR_FALLBACK: whether fallback is enabled (#PangoAttrInt)
  124. * @PANGO_ATTR_LETTER_SPACING: letter spacing (#PangoAttrInt)
  125. * @PANGO_ATTR_UNDERLINE_COLOR: underline color (#PangoAttrColor)
  126. * @PANGO_ATTR_STRIKETHROUGH_COLOR: strikethrough color (#PangoAttrColor)
  127. * @PANGO_ATTR_ABSOLUTE_SIZE: font size in pixels scaled by %PANGO_SCALE (#PangoAttrInt)
  128. * @PANGO_ATTR_GRAVITY: base text gravity (#PangoAttrInt)
  129. * @PANGO_ATTR_GRAVITY_HINT: gravity hint (#PangoAttrInt)
  130. * @PANGO_ATTR_FONT_FEATURES: OpenType font features (#PangoAttrString). Since 1.38
  131. * @PANGO_ATTR_FOREGROUND_ALPHA: foreground alpha (#PangoAttrInt). Since 1.38
  132. * @PANGO_ATTR_BACKGROUND_ALPHA: background alpha (#PangoAttrInt). Since 1.38
  133. *
  134. * The #PangoAttrType
  135. * distinguishes between different types of attributes. Along with the
  136. * predefined values, it is possible to allocate additional values
  137. * for custom attributes using pango_attr_type_register(). The predefined
  138. * values are given below. The type of structure used to store the
  139. * attribute is listed in parentheses after the description.
  140. */
  141. typedef enum
  142. {
  143. PANGO_ATTR_INVALID, /* 0 is an invalid attribute type */
  144. PANGO_ATTR_LANGUAGE, /* PangoAttrLanguage */
  145. PANGO_ATTR_FAMILY, /* PangoAttrString */
  146. PANGO_ATTR_STYLE, /* PangoAttrInt */
  147. PANGO_ATTR_WEIGHT, /* PangoAttrInt */
  148. PANGO_ATTR_VARIANT, /* PangoAttrInt */
  149. PANGO_ATTR_STRETCH, /* PangoAttrInt */
  150. PANGO_ATTR_SIZE, /* PangoAttrSize */
  151. PANGO_ATTR_FONT_DESC, /* PangoAttrFontDesc */
  152. PANGO_ATTR_FOREGROUND, /* PangoAttrColor */
  153. PANGO_ATTR_BACKGROUND, /* PangoAttrColor */
  154. PANGO_ATTR_UNDERLINE, /* PangoAttrInt */
  155. PANGO_ATTR_STRIKETHROUGH, /* PangoAttrInt */
  156. PANGO_ATTR_RISE, /* PangoAttrInt */
  157. PANGO_ATTR_SHAPE, /* PangoAttrShape */
  158. PANGO_ATTR_SCALE, /* PangoAttrFloat */
  159. PANGO_ATTR_FALLBACK, /* PangoAttrInt */
  160. PANGO_ATTR_LETTER_SPACING, /* PangoAttrInt */
  161. PANGO_ATTR_UNDERLINE_COLOR, /* PangoAttrColor */
  162. PANGO_ATTR_STRIKETHROUGH_COLOR,/* PangoAttrColor */
  163. PANGO_ATTR_ABSOLUTE_SIZE, /* PangoAttrSize */
  164. PANGO_ATTR_GRAVITY, /* PangoAttrInt */
  165. PANGO_ATTR_GRAVITY_HINT, /* PangoAttrInt */
  166. PANGO_ATTR_FONT_FEATURES, /* PangoAttrString */
  167. PANGO_ATTR_FOREGROUND_ALPHA, /* PangoAttrInt */
  168. PANGO_ATTR_BACKGROUND_ALPHA /* PangoAttrInt */
  169. } PangoAttrType;
  170. /**
  171. * PangoUnderline:
  172. * @PANGO_UNDERLINE_NONE: no underline should be drawn
  173. * @PANGO_UNDERLINE_SINGLE: a single underline should be drawn
  174. * @PANGO_UNDERLINE_DOUBLE: a double underline should be drawn
  175. * @PANGO_UNDERLINE_LOW: a single underline should be drawn at a position
  176. * beneath the ink extents of the text being
  177. * underlined. This should be used only for underlining
  178. * single characters, such as for keyboard
  179. * accelerators. %PANGO_UNDERLINE_SINGLE should
  180. * be used for extended portions of text.
  181. * @PANGO_UNDERLINE_ERROR: a wavy underline should be drawn below.
  182. * This underline is typically used to indicate
  183. * an error such as a possilble mispelling; in some
  184. * cases a contrasting color may automatically
  185. * be used. This type of underlining is available since Pango 1.4.
  186. *
  187. * The #PangoUnderline enumeration is used to specify
  188. * whether text should be underlined, and if so, the type
  189. * of underlining.
  190. */
  191. typedef enum {
  192. PANGO_UNDERLINE_NONE,
  193. PANGO_UNDERLINE_SINGLE,
  194. PANGO_UNDERLINE_DOUBLE,
  195. PANGO_UNDERLINE_LOW,
  196. PANGO_UNDERLINE_ERROR
  197. } PangoUnderline;
  198. /**
  199. * PANGO_ATTR_INDEX_FROM_TEXT_BEGINNING:
  200. *
  201. * This value can be used to set the start_index member of a #PangoAttribute
  202. * such that the attribute covers from the beginning of the text.
  203. *
  204. * Since: 1.24
  205. */
  206. /**
  207. * PANGO_ATTR_INDEX_TO_TEXT_END:
  208. *
  209. * This value can be used to set the end_index member of a #PangoAttribute
  210. * such that the attribute covers to the end of the text.
  211. *
  212. * Since: 1.24
  213. */
  214. #define PANGO_ATTR_INDEX_FROM_TEXT_BEGINNING 0
  215. #define PANGO_ATTR_INDEX_TO_TEXT_END G_MAXUINT
  216. /**
  217. * PangoAttribute:
  218. * @klass: the class structure holding information about the type of the attribute
  219. * @start_index: the start index of the range (in bytes).
  220. * @end_index: end index of the range (in bytes). The character at this index
  221. * is not included in the range.
  222. *
  223. * The #PangoAttribute structure represents the common portions of all
  224. * attributes. Particular types of attributes include this structure
  225. * as their initial portion. The common portion of the attribute holds
  226. * the range to which the value in the type-specific part of the attribute
  227. * applies and should be initialized using pango_attribute_init().
  228. * By default an attribute will have an all-inclusive range of [0,%G_MAXUINT].
  229. */
  230. struct _PangoAttribute
  231. {
  232. const PangoAttrClass *klass;
  233. guint start_index; /* in bytes */
  234. guint end_index; /* in bytes. The character at this index is not included */
  235. };
  236. /**
  237. * PangoAttrFilterFunc:
  238. * @attribute: a Pango attribute
  239. * @user_data: user data passed to the function
  240. *
  241. * Type of a function filtering a list of attributes.
  242. *
  243. * Return value: %TRUE if the attribute should be selected for
  244. * filtering, %FALSE otherwise.
  245. **/
  246. typedef gboolean (*PangoAttrFilterFunc) (PangoAttribute *attribute,
  247. gpointer user_data);
  248. /**
  249. * PangoAttrDataCopyFunc:
  250. * @user_data: user data to copy
  251. *
  252. * Type of a function that can duplicate user data for an attribute.
  253. *
  254. * Return value: new copy of @user_data.
  255. **/
  256. typedef gpointer (*PangoAttrDataCopyFunc) (gconstpointer user_data);
  257. /**
  258. * PangoAttrClass:
  259. * @type: the type ID for this attribute
  260. * @copy: function to duplicate an attribute of this type (see pango_attribute_copy())
  261. * @destroy: function to free an attribute of this type (see pango_attribute_destroy())
  262. * @equal: function to check two attributes of this type for equality (see pango_attribute_equal())
  263. *
  264. * The #PangoAttrClass structure stores the type and operations for
  265. * a particular type of attribute. The functions in this structure should
  266. * not be called directly. Instead, one should use the wrapper functions
  267. * provided for #PangoAttribute.
  268. */
  269. struct _PangoAttrClass
  270. {
  271. /*< public >*/
  272. PangoAttrType type;
  273. PangoAttribute * (*copy) (const PangoAttribute *attr);
  274. void (*destroy) (PangoAttribute *attr);
  275. gboolean (*equal) (const PangoAttribute *attr1, const PangoAttribute *attr2);
  276. };
  277. /**
  278. * PangoAttrString:
  279. * @attr: the common portion of the attribute
  280. * @value: the string which is the value of the attribute
  281. *
  282. * The #PangoAttrString structure is used to represent attributes with
  283. * a string value.
  284. */
  285. struct _PangoAttrString
  286. {
  287. PangoAttribute attr;
  288. char *value;
  289. };
  290. /**
  291. * PangoAttrLanguage:
  292. * @attr: the common portion of the attribute
  293. * @value: the #PangoLanguage which is the value of the attribute
  294. *
  295. * The #PangoAttrLanguage structure is used to represent attributes that
  296. * are languages.
  297. */
  298. struct _PangoAttrLanguage
  299. {
  300. PangoAttribute attr;
  301. PangoLanguage *value;
  302. };
  303. /**
  304. * PangoAttrInt:
  305. * @attr: the common portion of the attribute
  306. * @value: the value of the attribute
  307. *
  308. * The #PangoAttrInt structure is used to represent attributes with
  309. * an integer or enumeration value.
  310. */
  311. struct _PangoAttrInt
  312. {
  313. PangoAttribute attr;
  314. int value;
  315. };
  316. /**
  317. * PangoAttrFloat:
  318. * @attr: the common portion of the attribute
  319. * @value: the value of the attribute
  320. *
  321. * The #PangoAttrFloat structure is used to represent attributes with
  322. * a float or double value.
  323. */
  324. struct _PangoAttrFloat
  325. {
  326. PangoAttribute attr;
  327. double value;
  328. };
  329. /**
  330. * PangoAttrColor:
  331. * @attr: the common portion of the attribute
  332. * @color: the #PangoColor which is the value of the attribute
  333. *
  334. * The #PangoAttrColor structure is used to represent attributes that
  335. * are colors.
  336. */
  337. struct _PangoAttrColor
  338. {
  339. PangoAttribute attr;
  340. PangoColor color;
  341. };
  342. /**
  343. * PangoAttrSize:
  344. * @attr: the common portion of the attribute
  345. * @size: size of font, in units of 1/%PANGO_SCALE of a point (for
  346. * %PANGO_ATTR_SIZE) or of a device uni (for %PANGO_ATTR_ABSOLUTE_SIZE)
  347. * @absolute: whether the font size is in device units or points.
  348. * This field is only present for compatibility with Pango-1.8.0
  349. * (%PANGO_ATTR_ABSOLUTE_SIZE was added in 1.8.1); and always will
  350. * be %FALSE for %PANGO_ATTR_SIZE and %TRUE for %PANGO_ATTR_ABSOLUTE_SIZE.
  351. *
  352. * The #PangoAttrSize structure is used to represent attributes which
  353. * set font size.
  354. */
  355. struct _PangoAttrSize
  356. {
  357. PangoAttribute attr;
  358. int size;
  359. guint absolute : 1;
  360. };
  361. /**
  362. * PangoAttrShape:
  363. * @attr: the common portion of the attribute
  364. * @ink_rect: the ink rectangle to restrict to
  365. * @logical_rect: the logical rectangle to restrict to
  366. * @data: user data set (see pango_attr_shape_new_with_data())
  367. * @copy_func: copy function for the user data
  368. * @destroy_func: destroy function for the user data
  369. *
  370. * The #PangoAttrShape structure is used to represent attributes which
  371. * impose shape restrictions.
  372. */
  373. struct _PangoAttrShape
  374. {
  375. PangoAttribute attr;
  376. PangoRectangle ink_rect;
  377. PangoRectangle logical_rect;
  378. gpointer data;
  379. PangoAttrDataCopyFunc copy_func;
  380. GDestroyNotify destroy_func;
  381. };
  382. /**
  383. * PangoAttrFontDesc:
  384. * @attr: the common portion of the attribute
  385. * @desc: the font description which is the value of this attribute
  386. *
  387. * The #PangoAttrFontDesc structure is used to store an attribute that
  388. * sets all aspects of the font description at once.
  389. */
  390. struct _PangoAttrFontDesc
  391. {
  392. PangoAttribute attr;
  393. PangoFontDescription *desc;
  394. };
  395. /**
  396. * PangoAttrFontFeatures:
  397. * @attr: the common portion of the attribute
  398. * @features: the featues, as a string in CSS syntax
  399. *
  400. * The #PangoAttrFontFeatures structure is used to represent OpenType
  401. * font features as an attribute.
  402. *
  403. * Since: 1.38
  404. */
  405. struct _PangoAttrFontFeatures
  406. {
  407. PangoAttribute attr;
  408. gchar *features;
  409. };
  410. PANGO_AVAILABLE_IN_ALL
  411. PangoAttrType pango_attr_type_register (const gchar *name);
  412. PANGO_AVAILABLE_IN_1_22
  413. const char * pango_attr_type_get_name (PangoAttrType type) G_GNUC_CONST;
  414. PANGO_AVAILABLE_IN_1_20
  415. void pango_attribute_init (PangoAttribute *attr,
  416. const PangoAttrClass *klass);
  417. PANGO_AVAILABLE_IN_ALL
  418. PangoAttribute * pango_attribute_copy (const PangoAttribute *attr);
  419. PANGO_AVAILABLE_IN_ALL
  420. void pango_attribute_destroy (PangoAttribute *attr);
  421. PANGO_AVAILABLE_IN_ALL
  422. gboolean pango_attribute_equal (const PangoAttribute *attr1,
  423. const PangoAttribute *attr2) G_GNUC_PURE;
  424. PANGO_AVAILABLE_IN_ALL
  425. PangoAttribute *pango_attr_language_new (PangoLanguage *language);
  426. PANGO_AVAILABLE_IN_ALL
  427. PangoAttribute *pango_attr_family_new (const char *family);
  428. PANGO_AVAILABLE_IN_ALL
  429. PangoAttribute *pango_attr_foreground_new (guint16 red,
  430. guint16 green,
  431. guint16 blue);
  432. PANGO_AVAILABLE_IN_ALL
  433. PangoAttribute *pango_attr_background_new (guint16 red,
  434. guint16 green,
  435. guint16 blue);
  436. PANGO_AVAILABLE_IN_ALL
  437. PangoAttribute *pango_attr_size_new (int size);
  438. PANGO_AVAILABLE_IN_1_8
  439. PangoAttribute *pango_attr_size_new_absolute (int size);
  440. PANGO_AVAILABLE_IN_ALL
  441. PangoAttribute *pango_attr_style_new (PangoStyle style);
  442. PANGO_AVAILABLE_IN_ALL
  443. PangoAttribute *pango_attr_weight_new (PangoWeight weight);
  444. PANGO_AVAILABLE_IN_ALL
  445. PangoAttribute *pango_attr_variant_new (PangoVariant variant);
  446. PANGO_AVAILABLE_IN_ALL
  447. PangoAttribute *pango_attr_stretch_new (PangoStretch stretch);
  448. PANGO_AVAILABLE_IN_ALL
  449. PangoAttribute *pango_attr_font_desc_new (const PangoFontDescription *desc);
  450. PANGO_AVAILABLE_IN_ALL
  451. PangoAttribute *pango_attr_underline_new (PangoUnderline underline);
  452. PANGO_AVAILABLE_IN_1_8
  453. PangoAttribute *pango_attr_underline_color_new (guint16 red,
  454. guint16 green,
  455. guint16 blue);
  456. PANGO_AVAILABLE_IN_ALL
  457. PangoAttribute *pango_attr_strikethrough_new (gboolean strikethrough);
  458. PANGO_AVAILABLE_IN_1_8
  459. PangoAttribute *pango_attr_strikethrough_color_new (guint16 red,
  460. guint16 green,
  461. guint16 blue);
  462. PANGO_AVAILABLE_IN_ALL
  463. PangoAttribute *pango_attr_rise_new (int rise);
  464. PANGO_AVAILABLE_IN_ALL
  465. PangoAttribute *pango_attr_scale_new (double scale_factor);
  466. PANGO_AVAILABLE_IN_1_4
  467. PangoAttribute *pango_attr_fallback_new (gboolean enable_fallback);
  468. PANGO_AVAILABLE_IN_1_6
  469. PangoAttribute *pango_attr_letter_spacing_new (int letter_spacing);
  470. PANGO_AVAILABLE_IN_ALL
  471. PangoAttribute *pango_attr_shape_new (const PangoRectangle *ink_rect,
  472. const PangoRectangle *logical_rect);
  473. PANGO_AVAILABLE_IN_1_8
  474. PangoAttribute *pango_attr_shape_new_with_data (const PangoRectangle *ink_rect,
  475. const PangoRectangle *logical_rect,
  476. gpointer data,
  477. PangoAttrDataCopyFunc copy_func,
  478. GDestroyNotify destroy_func);
  479. PANGO_AVAILABLE_IN_1_16
  480. PangoAttribute *pango_attr_gravity_new (PangoGravity gravity);
  481. PANGO_AVAILABLE_IN_1_16
  482. PangoAttribute *pango_attr_gravity_hint_new (PangoGravityHint hint);
  483. PANGO_AVAILABLE_IN_1_38
  484. PangoAttribute *pango_attr_font_features_new (const gchar *features);
  485. PANGO_AVAILABLE_IN_1_38
  486. PangoAttribute *pango_attr_foreground_alpha_new (guint16 alpha);
  487. PANGO_AVAILABLE_IN_1_38
  488. PangoAttribute *pango_attr_background_alpha_new (guint16 alpha);
  489. PANGO_AVAILABLE_IN_ALL
  490. GType pango_attr_list_get_type (void) G_GNUC_CONST;
  491. PANGO_AVAILABLE_IN_ALL
  492. PangoAttrList * pango_attr_list_new (void);
  493. PANGO_AVAILABLE_IN_1_10
  494. PangoAttrList * pango_attr_list_ref (PangoAttrList *list);
  495. PANGO_AVAILABLE_IN_ALL
  496. void pango_attr_list_unref (PangoAttrList *list);
  497. PANGO_AVAILABLE_IN_ALL
  498. PangoAttrList * pango_attr_list_copy (PangoAttrList *list);
  499. PANGO_AVAILABLE_IN_ALL
  500. void pango_attr_list_insert (PangoAttrList *list,
  501. PangoAttribute *attr);
  502. PANGO_AVAILABLE_IN_ALL
  503. void pango_attr_list_insert_before (PangoAttrList *list,
  504. PangoAttribute *attr);
  505. PANGO_AVAILABLE_IN_ALL
  506. void pango_attr_list_change (PangoAttrList *list,
  507. PangoAttribute *attr);
  508. PANGO_AVAILABLE_IN_ALL
  509. void pango_attr_list_splice (PangoAttrList *list,
  510. PangoAttrList *other,
  511. gint pos,
  512. gint len);
  513. PANGO_AVAILABLE_IN_1_2
  514. PangoAttrList *pango_attr_list_filter (PangoAttrList *list,
  515. PangoAttrFilterFunc func,
  516. gpointer data);
  517. PANGO_AVAILABLE_IN_ALL
  518. PangoAttrIterator *pango_attr_list_get_iterator (PangoAttrList *list);
  519. PANGO_AVAILABLE_IN_ALL
  520. void pango_attr_iterator_range (PangoAttrIterator *iterator,
  521. gint *start,
  522. gint *end);
  523. PANGO_AVAILABLE_IN_ALL
  524. gboolean pango_attr_iterator_next (PangoAttrIterator *iterator);
  525. PANGO_AVAILABLE_IN_ALL
  526. PangoAttrIterator *pango_attr_iterator_copy (PangoAttrIterator *iterator);
  527. PANGO_AVAILABLE_IN_ALL
  528. void pango_attr_iterator_destroy (PangoAttrIterator *iterator);
  529. PANGO_AVAILABLE_IN_ALL
  530. PangoAttribute * pango_attr_iterator_get (PangoAttrIterator *iterator,
  531. PangoAttrType type);
  532. PANGO_AVAILABLE_IN_ALL
  533. void pango_attr_iterator_get_font (PangoAttrIterator *iterator,
  534. PangoFontDescription *desc,
  535. PangoLanguage **language,
  536. GSList **extra_attrs);
  537. PANGO_AVAILABLE_IN_1_2
  538. GSList * pango_attr_iterator_get_attrs (PangoAttrIterator *iterator);
  539. PANGO_AVAILABLE_IN_ALL
  540. gboolean pango_parse_markup (const char *markup_text,
  541. int length,
  542. gunichar accel_marker,
  543. PangoAttrList **attr_list,
  544. char **text,
  545. gunichar *accel_char,
  546. GError **error);
  547. PANGO_AVAILABLE_IN_1_32
  548. GMarkupParseContext * pango_markup_parser_new (gunichar accel_marker);
  549. PANGO_AVAILABLE_IN_1_32
  550. gboolean pango_markup_parser_finish (GMarkupParseContext *context,
  551. PangoAttrList **attr_list,
  552. char **text,
  553. gunichar *accel_char,
  554. GError **error);
  555. G_END_DECLS
  556. #endif /* __PANGO_ATTRIBUTES_H__ */