summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2006-01-23 16:27:21 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2006-01-23 16:27:21 +0000
commit8b728035f9cfe490ba109494eb8564d11552e374 (patch)
tree2cc04257fd0293666366d066fc5edac2fa382474 /examples
parentce22d934fce30c8fce9b660221419f8a0055d565 (diff)
downloadpango-8b728035f9cfe490ba109494eb8564d11552e374.tar.gz
Make tests/examples do use generated pango.modules. (bug #328291)
2006-01-23 Behdad Esfahbod <behdad@gnome.org> Make tests/examples do use generated pango.modules. (bug #328291) * examples/pangorc, tests/pangorc: Removed. Moved to modules/. * examples/pangox.aliases: Removed. Moved to pango/. * examples/Makefile.am, tests/Makefile.am: Remove pango.modules creation stuff, copy pangorc from $(srcdir)/../modules/pangorc insteadd. * examples/renderdemo.c: Add --pangorc option, default to ./pangorc. Setenv PANGO_RC_FILE to whatever pangorc file decided. * tests/*.c: Setenv PANGO_RC_FILE to ./pangorc. * pango/pangox.aliases: Added. * pango/Makefile.am: Install pangox.aliases. * modules/pangorc: Added. * modules/Makefile.am: Create pango.modules. Added pangorc. * modules/.cvsignore, examples/.cvsignore, tests/.cvsignore: Updated.
Diffstat (limited to 'examples')
-rw-r--r--examples/.cvsignore2
-rw-r--r--examples/Makefile.am50
-rw-r--r--examples/cairoview.c2
-rw-r--r--examples/pangorc10
-rw-r--r--examples/pangox.aliases220
-rw-r--r--examples/renderdemo.c23
-rw-r--r--examples/renderdemo.h7
-rw-r--r--examples/xftview.c2
8 files changed, 38 insertions, 278 deletions
diff --git a/examples/.cvsignore b/examples/.cvsignore
index d08e01f3..2e292278 100644
--- a/examples/.cvsignore
+++ b/examples/.cvsignore
@@ -1,7 +1,7 @@
Makefile.in
Makefile
makefile.mingw
-pango.modules
+pangorc
cairosimple
pango-cairoview
pango-xftview
diff --git a/examples/Makefile.am b/examples/Makefile.am
index f41174f0..d884f122 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -1,6 +1,16 @@
## Process this file with automake to create Makefile.in.
-aliasdir = $(sysconfdir)/pango
+EXTRA_DIST= \
+ viewer-win32.c \
+ makefile.msc \
+ HELLO.utf8 \
+ GLASS.utf8 \
+ dev-example.utf \
+ muru.utf \
+ syriac.utf \
+ tibetan.utf
+
+CLEANFILES = pangorc
INCLUDES = \
-DG_DISABLE_DEPRECATED \
@@ -13,11 +23,6 @@ INCLUDES = \
$(FREETYPE_CFLAGS) \
$(X_CFLAGS)
-###################################################
-
-CLEANFILES = pango.modules
-###################################################
-
noinst_PROGRAMS =
###################################################
@@ -94,34 +99,7 @@ cairosimple_LDADD = \
$(CAIRO_LIBS)
###################################################
-if CROSS_COMPILING
-else
-all-local: pango.modules
-endif
-
-pango.modules: $(top_builddir)/pango/pango-querymodules
- if find ../modules -name '*.so' | grep 'so' > /dev/null ; then \
- echo "Writing a pango.modules file to use when running examples before installing Pango."; \
- (cd ../modules && \
- $(top_builddir)/pango/pango-querymodules `find . -name '*.la' | grep -v \.libs | grep -v libpango` > ../examples/pango.modules ) ;\
- else \
- echo "No dynamic modules found; will use only static modules for not-installed example programs."; \
- touch pango.modules; \
- fi
+pangorc: $(srcdir)/../modules/pangorc
+ cp $< $@
-EXTRA_DIST= \
- viewer-win32.c \
- pangoft2topgm.c \
- makefile.msc \
- HELLO.utf8 \
- GLASS.utf8 \
- dev-example.utf \
- muru.utf \
- syriac.utf \
- tibetan.utf \
- pangorc \
- pangox.aliases
-
-if HAVE_X
-alias_DATA = pangox.aliases
-endif
+$(noinst_PROGRAMS): pangorc
diff --git a/examples/cairoview.c b/examples/cairoview.c
index 6a532da8..b58a74ed 100644
--- a/examples/cairoview.c
+++ b/examples/cairoview.c
@@ -181,7 +181,7 @@ update (void)
update_region = NULL;
}
-void
+static void
expose (XExposeEvent *xev)
{
XRectangle r;
diff --git a/examples/pangorc b/examples/pangorc
deleted file mode 100644
index bfbecbd6..00000000
--- a/examples/pangorc
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# pangorc file for uninstalled operation. If pango-viewer is run with
-# this file in the current directory it will set it as PANGO_RC_FILE
-#
-
-[Pango]
-ModuleFiles = ./pango.modules
-
-[PangoX]
-AliasFiles = ./pangox.aliases \ No newline at end of file
diff --git a/examples/pangox.aliases b/examples/pangox.aliases
deleted file mode 100644
index 9b41aa75..00000000
--- a/examples/pangox.aliases
+++ /dev/null
@@ -1,220 +0,0 @@
-# File defining aliases of PangoFontDescription to X font set
-#
-# family style variant weight stretch XLFD
-
-sans normal normal normal normal \
- "-*-helvetica-medium-r-normal--*-*-*-*-*-*-*-*,\
- -*-gulim-medium-r-normal--*-*-*-*-*-*-ksc5601.1987-0,\
- -*-clearlyu-medium-r-normal--*-*-*-*-*-*-iso10646-1,\
- -*-fixed-medium-r-normal--*-*-*-*-*-*-*-*,\
- -kaist-iyagi-bold-r-normal--*-*-*-*-*-*-johab-1,\
- -*-song ti-medium-r-normal--*-*-*-*-*-*-*-*,\
- -freetype-unitamil-medium-r-normal--*-*-*-*-*-*-iso10646-tam,\
- -*-devanagari-medium-r-normal--*-*-*-*-*-*-iso10646-dev,\
- -*-gujarati-medium-r-normal--*-*-*-*-*-*-iso10646-guj,\
- -*-gurmukhi-medium-r-normal--*-*-*-*-*-*-iso10646-gur,\
- -*-bengali-medium-r-normal--*-*-*-*-*-*-iso10646-bng,\
- -*-kannada-medium-r-normal--*-*-*-*-*-*-iso10646-kan,\
- -*-burmese-medium-r-normal--*-*-*-*-*-*-iso10646-brm,\
- -*-buginese-medium-r-normal--*-*-*-*-*-*-iso10646-bgn,\
- -*-oriya-medium-r-normal--*-*-*-*-*-*-iso10646-ori,\
- -daewoo-mincho-medium-r-normal--*-*-*-*-*-*-ksc5601.1987-0"
-
-sans italic normal normal normal \
- "-*-helvetica-medium-o-normal--*-*-*-*-*-*-*-*,\
- -*-gulim-medium-o-normal--*-*-*-*-*-*-ksc5601.1987-0,\
- -*-clearlyu-medium-r-normal--*-*-*-*-*-*-iso10646-1,\
- -*-fixed-medium-r-normal--*-*-*-*-*-*-*-*,\
- -kaist-iyagi-bold-r-normal--*-*-*-*-*-*-johab-1,\
- -*-song ti-medium-r-normal--*-*-*-*-*-*-*-*,\
- -freetype-unitamil-medium-r-normal--*-*-*-*-*-*-iso10646-tam,\
- -*-devanagari-medium-r-normal--*-*-*-*-*-*-iso10646-dev,\
- -*-gujarati-medium-r-normal--*-*-*-*-*-*-iso10646-guj,\
- -*-gurmukhi-medium-r-normal--*-*-*-*-*-*-iso10646-gur,\
- -*-bengali-medium-r-normal--*-*-*-*-*-*-iso10646-bng,\
- -*-kannada-medium-r-normal--*-*-*-*-*-*-iso10646-kan,\
- -*-burmese-medium-r-normal--*-*-*-*-*-*-iso10646-brm,\
- -*-buginese-medium-r-normal--*-*-*-*-*-*-iso10646-bgn,\
- -*-oriya-medium-r-normal--*-*-*-*-*-*-iso10646-ori,\
- -daewoo-mincho-medium-r-normal--*-*-*-*-*-*-ksc5601.1987-0"
-
-sans normal normal bold normal \
- "-*-helvetica-bold-r-normal--*-*-*-*-*-*-*-*,\
- -*-gulim-bold-r-normal--*-*-*-*-*-*-ksc5601.1987-0,\
- -*-clearlyu-medium-r-normal--*-*-*-*-*-*-iso10646-1,\
- -*-fixed-medium-r-normal--*-*-*-*-*-*-*-*,\
- -kaist-iyagi-bold-r-normal--*-*-*-*-*-*-johab-1,\
- -*-song ti-medium-r-normal--*-*-*-*-*-*-*-*,\
- -freetype-unitamil-medium-r-normal--*-*-*-*-*-*-iso10646-tam,\
- -*-devanagari-medium-r-normal--*-*-*-*-*-*-iso10646-dev,\
- -*-gujarati-medium-r-normal--*-*-*-*-*-*-iso10646-guj,\
- -*-gurmukhi-medium-r-normal--*-*-*-*-*-*-iso10646-gur,\
- -*-bengali-medium-r-normal--*-*-*-*-*-*-iso10646-bng,\
- -*-kannada-medium-r-normal--*-*-*-*-*-*-iso10646-kan,\
- -*-burmese-medium-r-normal--*-*-*-*-*-*-iso10646-brm,\
- -*-buginese-medium-r-normal--*-*-*-*-*-*-iso10646-bgn,\
- -*-oriya-medium-r-normal--*-*-*-*-*-*-iso10646-ori,\
- -daewoo-mincho-medium-r-normal--*-*-*-*-*-*-ksc5601.1987-0"
-
-sans italic normal bold normal \
- "-*-helvetica-bold-o-normal--*-*-*-*-*-*-*-*,\
- -*-gulim-bold-o-normal--*-*-*-*-*-*-ksc5601.1987-0,\
- -*-clearlyu-medium-r-normal--*-*-*-*-*-*-iso10646-1,\
- -*-fixed-medium-r-normal--*-*-*-*-*-*-*-*,\
- -kaist-iyagi-bold-r-normal--*-*-*-*-*-*-johab-1,\
- -*-song ti-medium-r-normal--*-*-*-*-*-*-*-*,\
- -freetype-unitamil-medium-r-normal--*-*-*-*-*-*-iso10646-tam,\
- -*-devanagari-medium-r-normal--*-*-*-*-*-*-iso10646-dev,\
- -*-gujarati-medium-r-normal--*-*-*-*-*-*-iso10646-guj,\
- -*-gurmukhi-medium-r-normal--*-*-*-*-*-*-iso10646-gur,\
- -*-bengali-medium-r-normal--*-*-*-*-*-*-iso10646-bng,\
- -*-kannada-medium-r-normal--*-*-*-*-*-*-iso10646-kan,\
- -*-burmese-medium-r-normal--*-*-*-*-*-*-iso10646-brm,\
- -*-buginese-medium-r-normal--*-*-*-*-*-*-iso10646-bgn,\
- -*-oriya-medium-r-normal--*-*-*-*-*-*-iso10646-ori,\
- -daewoo-mincho-medium-r-normal--*-*-*-*-*-*-ksc5601.1987-0"
-
-
-serif normal normal normal normal \
- "-*-times-medium-r-normal--*-*-*-*-*-*-*-*,\
- -*-batang-medium-r-normal--*-*-*-*-*-*-ksc5601.1987-0,\
- -*-clearlyu-medium-r-normal--*-*-*-*-*-*-iso10646-1,\
- -*-fixed-medium-r-normal--*-*-*-*-*-*-*-*,\
- -kaist-iyagi-bold-r-normal--*-*-*-*-*-*-johab-1,\
- -*-song ti-medium-r-normal--*-*-*-*-*-*-*-*,\
- -freetype-unitamil-medium-r-normal--*-*-*-*-*-*-iso10646-tam,\
- -*-devanagari-medium-r-normal--*-*-*-*-*-*-iso10646-dev,\
- -*-gujarati-medium-r-normal--*-*-*-*-*-*-iso10646-guj,\
- -*-gurmukhi-medium-r-normal--*-*-*-*-*-*-iso10646-gur,\
- -*-bengali-medium-r-normal--*-*-*-*-*-*-iso10646-bng,\
- -*-kannada-medium-r-normal--*-*-*-*-*-*-iso10646-kan,\
- -*-burmese-medium-r-normal--*-*-*-*-*-*-iso10646-brm,\
- -*-buginese-medium-r-normal--*-*-*-*-*-*-iso10646-bgn,\
- -*-oriya-medium-r-normal--*-*-*-*-*-*-iso10646-ori,\
- -daewoo-mincho-medium-r-normal--*-*-*-*-*-*-ksc5601.1987-0"
-
-serif italic normal normal normal \
- "-*-times-medium-i-normal--*-*-*-*-*-*-*-*,\
- -*-batang-medium-r-normal--*-*-*-*-*-*-ksc5601.1987-0,\
- -*-clearlyu-medium-r-normal--*-*-*-*-*-*-iso10646-1,\
- -*-fixed-medium-r-normal--*-*-*-*-*-*-*-*,\
- -kaist-iyagi-bold-r-normal--*-*-*-*-*-*-johab-1,\
- -*-song ti-medium-r-normal--*-*-*-*-*-*-*-*,\
- -freetype-unitamil-medium-r-normal--*-*-*-*-*-*-iso10646-tam,\
- -*-devanagari-medium-r-normal--*-*-*-*-*-*-iso10646-dev,\
- -*-gujarati-medium-r-normal--*-*-*-*-*-*-iso10646-guj,\
- -*-gurmukhi-medium-r-normal--*-*-*-*-*-*-iso10646-gur,\
- -*-bengali-medium-r-normal--*-*-*-*-*-*-iso10646-bng,\
- -*-kannada-medium-r-normal--*-*-*-*-*-*-iso10646-kan,\
- -*-burmese-medium-r-normal--*-*-*-*-*-*-iso10646-brm,\
- -*-buginese-medium-r-normal--*-*-*-*-*-*-iso10646-bgn,\
- -*-oriya-medium-r-normal--*-*-*-*-*-*-iso10646-ori,\
- -daewoo-mincho-medium-r-normal--*-*-*-*-*-*-ksc5601.1987-0"
-
-serif normal normal bold normal \
- "-*-times-bold-r-normal--*-*-*-*-*-*-*-*,\
- -*-batang-bold-r-normal--*-*-*-*-*-*-ksc5601.1987-0,\
- -*-clearlyu-medium-r-normal--*-*-*-*-*-*-iso10646-1,\
- -*-fixed-medium-r-normal--*-*-*-*-*-*-*-*,\
- -kaist-iyagi-bold-r-normal--*-*-*-*-*-*-johab-1,\
- -*-song ti-medium-r-normal--*-*-*-*-*-*-*-*,\
- -freetype-unitamil-medium-r-normal--*-*-*-*-*-*-iso10646-tam,\
- -*-devanagari-medium-r-normal--*-*-*-*-*-*-iso10646-dev,\
- -*-gujarati-medium-r-normal--*-*-*-*-*-*-iso10646-guj,\
- -*-gurmukhi-medium-r-normal--*-*-*-*-*-*-iso10646-gur,\
- -*-bengali-medium-r-normal--*-*-*-*-*-*-iso10646-bng,\
- -*-kannada-medium-r-normal--*-*-*-*-*-*-iso10646-kan,\
- -*-burmese-medium-r-normal--*-*-*-*-*-*-iso10646-brm,\
- -*-buginese-medium-r-normal--*-*-*-*-*-*-iso10646-bgn,\
- -*-oriya-medium-r-normal--*-*-*-*-*-*-iso10646-ori,\
- -daewoo-mincho-medium-r-normal--*-*-*-*-*-*-ksc5601.1987-0"
-
-serif italic normal bold normal \
- "-*-times-bold-i-normal--*-*-*-*-*-*-*-*,\
- -*-batang-bold-r-normal--*-*-*-*-*-*-ksc5601.1987-0,\
- -*-clearlyu-medium-r-normal--*-*-*-*-*-*-iso10646-1,\
- -*-fixed-medium-r-normal--*-*-*-*-*-*-*-*,\
- -kaist-iyagi-bold-r-normal--*-*-*-*-*-*-johab-1,\
- -*-song ti-medium-r-normal--*-*-*-*-*-*-*-*,\
- -freetype-unitamil-medium-r-normal--*-*-*-*-*-*-iso10646-tam,\
- -*-devanagari-medium-r-normal--*-*-*-*-*-*-iso10646-dev,\
- -*-gujarati-medium-r-normal--*-*-*-*-*-*-iso10646-guj,\
- -*-gurmukhi-medium-r-normal--*-*-*-*-*-*-iso10646-gur,\
- -*-bengali-medium-r-normal--*-*-*-*-*-*-iso10646-bng,\
- -*-kannada-medium-r-normal--*-*-*-*-*-*-iso10646-kan,\
- -*-burmese-medium-r-normal--*-*-*-*-*-*-iso10646-brm,\
- -*-buginese-medium-r-normal--*-*-*-*-*-*-iso10646-bgn,\
- -*-oriya-medium-r-normal--*-*-*-*-*-*-iso10646-ori,\
- -daewoo-mincho-medium-r-normal--*-*-*-*-*-*-ksc5601.1987-0"
-
-monospace normal normal normal normal \
- "-*-fixed-medium-r-normal--*-*-*-*-*-*-*-*,\
- -*-dotum-medium-r-normal--*-*-*-*-*-*-ksc5601.1987-0,\
- -*-clearlyu-medium-r-normal--*-*-*-*-*-*-iso10646-1,\
- -*-fixed-medium-r-normal--*-*-*-*-*-*-*-*,\
- -kaist-iyagi-bold-r-normal--*-*-*-*-*-*-johab-1,\
- -*-song ti-medium-r-normal--*-*-*-*-*-*-*-*,\
- -freetype-unitamil-medium-r-normal--*-*-*-*-*-*-iso10646-tam,\
- -*-devanagari-medium-r-normal--*-*-*-*-*-*-iso10646-dev,\
- -*-gujarati-medium-r-normal--*-*-*-*-*-*-iso10646-guj,\
- -*-gurmukhi-medium-r-normal--*-*-*-*-*-*-iso10646-gur,\
- -*-bengali-medium-r-normal--*-*-*-*-*-*-iso10646-bng,\
- -*-kannada-medium-r-normal--*-*-*-*-*-*-iso10646-kan,\
- -*-burmese-medium-r-normal--*-*-*-*-*-*-iso10646-brm,\
- -*-buginese-medium-r-normal--*-*-*-*-*-*-iso10646-bgn,\
- -*-oriya-medium-r-normal--*-*-*-*-*-*-iso10646-ori,\
- -daewoo-mincho-medium-r-normal--*-*-*-*-*-*-ksc5601.1987-0"
-
-monospace italic normal normal normal \
- "-*-fixed-medium-i-normal--*-*-*-*-*-*-*-*,\
- -*-dotum-medium-r-normal--*-*-*-*-*-*-ksc5601.1987-0,\
- -*-clearlyu-medium-r-normal--*-*-*-*-*-*-iso10646-1,\
- -*-fixed-medium-r-normal--*-*-*-*-*-*-*-*,\
- -kaist-iyagi-bold-r-normal--*-*-*-*-*-*-johab-1,\
- -*-song ti-medium-r-normal--*-*-*-*-*-*-*-*,\
- -freetype-unitamil-medium-r-normal--*-*-*-*-*-*-iso10646-tam,\
- -*-devanagari-medium-r-normal--*-*-*-*-*-*-iso10646-dev,\
- -*-gujarati-medium-r-normal--*-*-*-*-*-*-iso10646-guj,\
- -*-gurmukhi-medium-r-normal--*-*-*-*-*-*-iso10646-gur,\
- -*-bengali-medium-r-normal--*-*-*-*-*-*-iso10646-bng,\
- -*-kannada-medium-r-normal--*-*-*-*-*-*-iso10646-kan,\
- -*-burmese-medium-r-normal--*-*-*-*-*-*-iso10646-brm,\
- -*-buginese-medium-r-normal--*-*-*-*-*-*-iso10646-bgn,\
- -*-oriya-medium-r-normal--*-*-*-*-*-*-iso10646-ori,\
- -daewoo-mincho-medium-r-normal--*-*-*-*-*-*-ksc5601.1987-0"
-
-monospace normal normal bold normal \
- "-*-fixed-bold-r-normal--*-*-*-*-*-*-*-*,\
- -*-dotum-bold-r-normal--*-*-*-*-*-*-ksc5601.1987-0,\
- -*-clearlyu-medium-r-normal--*-*-*-*-*-*-iso10646-1,\
- -*-fixed-medium-r-normal--*-*-*-*-*-*-*-*,\
- -kaist-iyagi-bold-r-normal--*-*-*-*-*-*-johab-1,\
- -*-song ti-medium-r-normal--*-*-*-*-*-*-*-*,\
- -freetype-unitamil-medium-r-normal--*-*-*-*-*-*-iso10646-tam,\
- -*-devanagari-medium-r-normal--*-*-*-*-*-*-iso10646-dev,\
- -*-gujarati-medium-r-normal--*-*-*-*-*-*-iso10646-guj,\
- -*-gurmukhi-medium-r-normal--*-*-*-*-*-*-iso10646-gur,\
- -*-bengali-medium-r-normal--*-*-*-*-*-*-iso10646-bng,\
- -*-kannada-medium-r-normal--*-*-*-*-*-*-iso10646-kan,\
- -*-burmese-medium-r-normal--*-*-*-*-*-*-iso10646-brm,\
- -*-buginese-medium-r-normal--*-*-*-*-*-*-iso10646-bgn,\
- -*-oriya-medium-r-normal--*-*-*-*-*-*-iso10646-ori,\
- -daewoo-mincho-medium-r-normal--*-*-*-*-*-*-ksc5601.1987-0"
-
-monospace italic normal bold normal \
- "-*-fixed-bold-i-normal--*-*-*-*-*-*-*-*,\
- -*-dotum-bold-r-normal--*-*-*-*-*-*-ksc5601.1987-0,\
- -*-clearlyu-medium-r-normal--*-*-*-*-*-*-iso10646-1,\
- -*-fixed-medium-r-normal--*-*-*-*-*-*-*-*,\
- -kaist-iyagi-bold-r-normal--*-*-*-*-*-*-johab-1,\
- -*-song ti-medium-r-normal--*-*-*-*-*-*-*-*,\
- -freetype-unitamil-medium-r-normal--*-*-*-*-*-*-iso10646-tam,\
- -*-devanagari-medium-r-normal--*-*-*-*-*-*-iso10646-dev,\
- -*-gujarati-medium-r-normal--*-*-*-*-*-*-iso10646-guj,\
- -*-gurmukhi-medium-r-normal--*-*-*-*-*-*-iso10646-gur,\
- -*-bengali-medium-r-normal--*-*-*-*-*-*-iso10646-bng,\
- -*-kannada-medium-r-normal--*-*-*-*-*-*-iso10646-kan,\
- -*-burmese-medium-r-normal--*-*-*-*-*-*-iso10646-brm,\
- -*-buginese-medium-r-normal--*-*-*-*-*-*-iso10646-bgn,\
- -*-oriya-medium-r-normal--*-*-*-*-*-*-iso10646-ori,\
- -daewoo-mincho-medium-r-normal--*-*-*-*-*-*-ksc5601.1987-0"
diff --git a/examples/renderdemo.c b/examples/renderdemo.c
index a956e3c6..e225fe7e 100644
--- a/examples/renderdemo.c
+++ b/examples/renderdemo.c
@@ -38,28 +38,29 @@
#define _MAKE_FONT_NAME(family, size) family " " #size
#define MAKE_FONT_NAME(family, size) _MAKE_FONT_NAME(family, size)
-char *prog_name;
+const char *prog_name;
gboolean opt_display = FALSE;
int opt_dpi = 96;
const char *opt_font = MAKE_FONT_NAME (DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE);
gboolean opt_header = FALSE;
-char *opt_output = NULL;
+const char *opt_output = NULL;
int opt_margin = 10;
int opt_markup = FALSE;
gboolean opt_rtl = FALSE;
int opt_rotate = 0;
gboolean opt_auto_dir = TRUE;
-char *opt_text = NULL;
+const char *opt_text = NULL;
gboolean opt_waterfall = FALSE;
int opt_width = -1;
int opt_indent = 0;
int opt_runs = 1;
PangoEllipsizeMode opt_ellipsize = PANGO_ELLIPSIZE_NONE;
HintMode opt_hinting = HINT_DEFAULT;
+const char *opt_pangorc = NULL;
/* Text (or markup) to render */
-char *text;
+static char *text;
void
fail (const char *format, ...)
@@ -343,7 +344,7 @@ fc_substitute_func (FcPattern *pattern, gpointer data)
}
}
-void
+static void
parse_ellipsis (ArgContext *arg_context,
const char *name,
const char *arg,
@@ -362,7 +363,7 @@ parse_ellipsis (ArgContext *arg_context,
opt_ellipsize = value->value;
}
-void
+static void
parse_hinting (ArgContext *arg_context,
const char *name,
const char *arg,
@@ -423,6 +424,8 @@ parse_options (int argc, char *argv[])
ARG_INT, &opt_indent, NULL },
{ "runs", "Render text this many times",
ARG_INT, &opt_runs, NULL },
+ { "pangorc", "pangorc file to use (default is ./pangorc if available)",
+ ARG_STRING, &opt_pangorc, NULL },
{ NULL, NULL, 0, NULL, NULL }
};
@@ -488,6 +491,14 @@ parse_options (int argc, char *argv[])
if (opt_markup &&
!pango_parse_markup (text, -1, 0, NULL, NULL, NULL, &error))
fail ("Cannot parse input as markup: %s", error->message);
+
+ /* Setup PANGO_RC_FILE
+ */
+ if (!opt_pangorc)
+ if (g_file_test ("./pangorc", G_FILE_TEST_IS_REGULAR))
+ opt_pangorc = "./pangorc";
+ if (opt_pangorc)
+ g_setenv ("PANGO_RC_FILE", opt_pangorc, TRUE);
}
void
diff --git a/examples/renderdemo.h b/examples/renderdemo.h
index bd283349..d79df1a6 100644
--- a/examples/renderdemo.h
+++ b/examples/renderdemo.h
@@ -53,22 +53,23 @@ void fc_substitute_func (FcPattern *pattern,
gpointer data);
gchar *get_options_string (void);
-extern char *prog_name;
+extern const char *prog_name;
extern gboolean opt_display;
extern int opt_dpi;
extern const char *opt_font;
extern gboolean opt_header;
-extern char *opt_output;
+extern const char *opt_output;
extern int opt_margin;
extern int opt_markup;
extern gboolean opt_rtl;
extern int opt_rotate;
extern gboolean opt_auto_dir;
-extern char *opt_text;
+extern const char *opt_text;
extern gboolean opt_waterfall;
extern int opt_width;
extern int opt_indent;
extern int opt_runs;
extern PangoEllipsizeMode opt_ellipsize;
extern HintMode opt_hinting;
+extern const char *opt_pangorc;
diff --git a/examples/xftview.c b/examples/xftview.c
index ba0a6215..c050b6a3 100644
--- a/examples/xftview.c
+++ b/examples/xftview.c
@@ -72,7 +72,7 @@ update (void)
do_output (context, xft_render, NULL, draw, NULL, NULL);
}
-void
+static void
expose (XExposeEvent *xev)
{
XRectangle area;