diff options
author | Havoc Pennington <hp@pobox.com> | 2000-11-01 06:46:29 +0000 |
---|---|---|
committer | Havoc Pennington <hp@src.gnome.org> | 2000-11-01 06:46:29 +0000 |
commit | b00a32cc4f7b8783d673f31502b4ef3555486995 (patch) | |
tree | 2a035c680e76bdfa121585577de26a4796e46345 /pango/pango-attributes.h | |
parent | 717a0b958c4616753798250985558cab328a6837 (diff) | |
download | pango-b00a32cc4f7b8783d673f31502b4ef3555486995.tar.gz |
Add a new attribute for scaling a font; also required adding
2000-11-01 Havoc Pennington <hp@pobox.com>
* pango/pango-attributes.c (pango_attr_scale_new): Add a new
attribute for scaling a font; also required adding PangoAttrFloat.
(pango_attr_iterator_get_font): Add PANGO_ATTR_SCALE handling.
* pango/pango-utils.c (pango_parse_stretch): Take a plain string
not a GString
(pango_parse_weight): ditto
(pango_parse_variant): ditto
(pango_parse_style): ditto
* pango/pangox-fontmap.c (pango_x_font_map_read_alias_file): pass
GString::str instead of the GString itself to pango_parse_*
* pango/pangoft2-fontmap.c (pango_ft2_insert_face): ditto
* pango/pangowin32-fontmap.c
(pango_win32_font_map_read_alias_file): ditto
* pango/pango-layout.c (get_tab_pos): adapt to new pango_itemize()
signature
(pango_layout_check_lines): Raise attr list copy/creation out of
the loop over paragraphs. Adapt to pango_itemize() changes.
* pango/pango-context.c (pango_itemize): pass in a starting
index and a cached iterator
(add_engines): Easy optimization, pass in
n_chars instead of recomputing it. Also, pass on the start
index and cached iterator.
* docs/pango-sections.txt: Add new stuff
docs/pango_markup.sgml: Docs on markup format
* pango/pango-layout.c (pango_layout_get_attributes): New function
to retrieve the AttrList from a layout
(pango_layout_set_markup): Set layout from markup
(pango_layout_set_markup_with_accel): Set layout from markup
including accelerator parsing.
* pango/pango-attributes.h (pango_parse_markup): New function to
convert a tag string to an attribute list
* pango/pango-markup.c (pango_parse_markup): implement
* docs/Makefile.am, docs/pango-docs.sgml, docs/pango-sections.txt,
docs/pango_markup.sgml: oooooh, documentation for the above patch!
* docs/tmpl/pango-unused.sgml: Remove from CVS; just causes
problems, and was full of checked-in conflict markers.
Diffstat (limited to 'pango/pango-attributes.h')
-rw-r--r-- | pango/pango-attributes.h | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/pango/pango-attributes.h b/pango/pango-attributes.h index 70474184..fb9e204a 100644 --- a/pango/pango-attributes.h +++ b/pango/pango-attributes.h @@ -33,14 +33,16 @@ typedef struct _PangoAttrClass PangoAttrClass; typedef struct _PangoAttrString PangoAttrString; typedef struct _PangoAttrInt PangoAttrInt; +typedef struct _PangoAttrFloat PangoAttrFloat; typedef struct _PangoAttrColor PangoAttrColor; typedef struct _PangoAttrFontDesc PangoAttrFontDesc; typedef struct _PangoAttrShape PangoAttrShape; - + typedef struct _PangoAttrList PangoAttrList; typedef struct _PangoAttrIterator PangoAttrIterator; -typedef enum { +typedef enum +{ PANGO_ATTR_LANG, /* PangoAttrString */ PANGO_ATTR_FAMILY, /* PangoAttrString */ PANGO_ATTR_STYLE, /* PangoAttrInt */ @@ -54,7 +56,8 @@ typedef enum { PANGO_ATTR_UNDERLINE, /* PangoAttrInt */ PANGO_ATTR_STRIKETHROUGH, /* PangoAttrInt */ PANGO_ATTR_RISE, /* PangoAttrInt */ - PANGO_ATTR_SHAPE /* PangoAttrShape */ + PANGO_ATTR_SHAPE, /* PangoAttrShape */ + PANGO_ATTR_SCALE /* PangoAttrFloat */ } PangoAttrType; typedef enum { @@ -91,6 +94,12 @@ struct _PangoAttrInt int value; }; +struct _PangoAttrFloat +{ + PangoAttribute attr; + double value; +}; + struct _PangoAttrColor { PangoAttribute attr; @@ -138,6 +147,7 @@ PangoAttribute *pango_attr_strikethrough_new (gboolean strike PangoAttribute *pango_attr_rise_new (int rise); PangoAttribute *pango_attr_shape_new (const PangoRectangle *ink_rect, const PangoRectangle *logical_rect); +PangoAttribute *pango_attr_scale_new (double scale_factor); PangoAttrList * pango_attr_list_new (void); void pango_attr_list_ref (PangoAttrList *list); @@ -169,6 +179,13 @@ void pango_attr_iterator_get_font (PangoAttrIterator *iterator GSList **extra_attrs); +gboolean pango_parse_markup (const char *markup_text, + int length, + gunichar accel_marker, + PangoAttrList **attr_list, + char **text, + gunichar *accel_char, + GError **error); #ifdef __cplusplus } |