summaryrefslogtreecommitdiff
path: root/pango/pangoft2-fontmap.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2000-11-01 06:46:29 +0000
committerHavoc Pennington <hp@src.gnome.org>2000-11-01 06:46:29 +0000
commitb00a32cc4f7b8783d673f31502b4ef3555486995 (patch)
tree2a035c680e76bdfa121585577de26a4796e46345 /pango/pangoft2-fontmap.c
parent717a0b958c4616753798250985558cab328a6837 (diff)
downloadpango-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/pangoft2-fontmap.c')
-rw-r--r--pango/pangoft2-fontmap.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/pango/pangoft2-fontmap.c b/pango/pangoft2-fontmap.c
index cd1f2124..692fb1e3 100644
--- a/pango/pangoft2-fontmap.c
+++ b/pango/pangoft2-fontmap.c
@@ -639,25 +639,25 @@ pango_ft2_font_map_read_alias_file (PangoFT2FontMap *ft2fontmap,
if (!pango_scan_string (&p, tmp_buf))
goto error;
- if (!pango_parse_style (tmp_buf, &font_entry->description, TRUE))
+ if (!pango_parse_style (tmp_buf->str, &font_entry->description, TRUE))
goto error;
if (!pango_scan_string (&p, tmp_buf))
goto error;
- if (!pango_parse_variant (tmp_buf, &font_entry->description, TRUE))
+ if (!pango_parse_variant (tmp_buf->str, &font_entry->description, TRUE))
goto error;
if (!pango_scan_string (&p, tmp_buf))
goto error;
- if (!pango_parse_weight (tmp_buf, &font_entry->description, TRUE))
+ if (!pango_parse_weight (tmp_buf->str, &font_entry->description, TRUE))
goto error;
if (!pango_scan_string (&p, tmp_buf))
goto error;
- if (!pango_parse_stretch (tmp_buf, &font_entry->description, TRUE))
+ if (!pango_parse_stretch (tmp_buf->str, &font_entry->description, TRUE))
goto error;
if (!pango_scan_string (&p, tmp_buf))
@@ -854,12 +854,10 @@ pango_ft2_insert_face (PangoFT2FontMap *ft2fontmap,
while (styles[i])
{
- GString *s = g_string_new (styles[i]);
- (void) (pango_parse_style (s, description, FALSE) ||
- pango_parse_variant (s, description, FALSE) ||
- pango_parse_weight (s, description, FALSE) ||
- pango_parse_stretch (s, description, FALSE));
- g_string_free (s, TRUE);
+ (void) (pango_parse_style (styles[i], description, FALSE) ||
+ pango_parse_variant (styles[i], description, FALSE) ||
+ pango_parse_weight (styles[i], description, FALSE) ||
+ pango_parse_stretch (styles[i], description, FALSE));
i++;
}
g_strfreev (styles);