From 509868236b87e04a9367630bf9c441e5d1399698 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Mon, 1 Mar 2004 15:23:15 +0000 Subject: Patch from Dov Grobgeld to add auto-direction to PangoLayout (more of Fri Feb 27 11:23:21 2004 Owen Taylor Patch from Dov Grobgeld to add auto-direction to PangoLayout (more of #70451) * examples/pangofttopgm.c: Add --no-auto-dir argument. * pango-layout.[ch]: Add pango_layout_set_auto_dir() defaulting to TRUE; resolve paragraph direction within a layout by propagating base direction downwards from paragraph to paragraph. * pango-context.[ch]: Add pango_itemize_with_base_dir() which overrides the base direction from the PangoContext. Mon Mar 1 10:01:58 2004 Owen Taylor * docs/tmpl/text-attributes.sgml: Document %PANGO_UNDERLINE_ERROR. * pango/pangofc-fontmap.c: Pango*Fc*FontmapPrivate. Make compile. --- examples/pangoft2topgm.c | 5 +++++ examples/renderdemo.c | 5 +++++ 2 files changed, 10 insertions(+) (limited to 'examples') diff --git a/examples/pangoft2topgm.c b/examples/pangoft2topgm.c index 60f93468..277dec51 100644 --- a/examples/pangoft2topgm.c +++ b/examples/pangoft2topgm.c @@ -54,6 +54,7 @@ static char *opt_output = NULL; static int opt_margin = 10; static int opt_markup = FALSE; static gboolean opt_rtl = FALSE; +static gboolean opt_auto_dir = TRUE; static char *opt_text = NULL; static gboolean opt_waterfall = FALSE; static int opt_width = -1; @@ -106,6 +107,8 @@ make_layout(PangoContext *context, else pango_layout_set_text (layout, text, -1); + pango_layout_set_auto_dir (layout, opt_auto_dir); + font_description = get_font_description (); if (size > 0) pango_font_description_set_size (font_description, size * PANGO_SCALE); @@ -240,6 +243,8 @@ int main(int argc, char *argv[]) gboolean do_convert = FALSE; static const ArgDesc args[] = { + { "no-auto-dir","Don't set layout direction according to contents", + ARG_NOBOOL, &opt_auto_dir }, { "display", "Show output using ImageMagick", ARG_BOOL, &opt_display }, { "dpi", "Set the dpi'", diff --git a/examples/renderdemo.c b/examples/renderdemo.c index 60f93468..277dec51 100644 --- a/examples/renderdemo.c +++ b/examples/renderdemo.c @@ -54,6 +54,7 @@ static char *opt_output = NULL; static int opt_margin = 10; static int opt_markup = FALSE; static gboolean opt_rtl = FALSE; +static gboolean opt_auto_dir = TRUE; static char *opt_text = NULL; static gboolean opt_waterfall = FALSE; static int opt_width = -1; @@ -106,6 +107,8 @@ make_layout(PangoContext *context, else pango_layout_set_text (layout, text, -1); + pango_layout_set_auto_dir (layout, opt_auto_dir); + font_description = get_font_description (); if (size > 0) pango_font_description_set_size (font_description, size * PANGO_SCALE); @@ -240,6 +243,8 @@ int main(int argc, char *argv[]) gboolean do_convert = FALSE; static const ArgDesc args[] = { + { "no-auto-dir","Don't set layout direction according to contents", + ARG_NOBOOL, &opt_auto_dir }, { "display", "Show output using ImageMagick", ARG_BOOL, &opt_display }, { "dpi", "Set the dpi'", -- cgit v1.2.1