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.
+
+2006-01-23 Behdad Esfahbod <behdad@gnome.org>
+
* modules/basic/basic-fc.c: Set cluster only on base chars, like the
Arabic module does.
Makefile.in
Makefile
makefile.mingw
-pango.modules
+pangorc
cairosimple
pango-cairoview
pango-xftview
## 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 \
$(FREETYPE_CFLAGS) \
$(X_CFLAGS)
-###################################################
-
-CLEANFILES = pango.modules
-###################################################
-
noinst_PROGRAMS =
###################################################
$(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
update_region = NULL;
}
-void
+static void
expose (XExposeEvent *xev)
{
XRectangle r;
+++ /dev/null
-#
-# 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
#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, ...)
}
}
-void
+static void
parse_ellipsis (ArgContext *arg_context,
const char *name,
const char *arg,
opt_ellipsize = value->value;
}
-void
+static void
parse_hinting (ArgContext *arg_context,
const char *name,
const char *arg,
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 }
};
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
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;
do_output (context, xft_render, NULL, draw, NULL, NULL);
}
-void
+static void
expose (XExposeEvent *xev)
{
XRectangle area;
Makefile
Makefile.in
makefile.mingw
+pango.modules
.deps
.libs
*.lo
tibetan
EXTRA_DIST = \
- module.def
+ module.def \
+ pangorc
+
+CLEANFILES = \
+ pango.modules
if CROSS_COMPILING
-RUN_QUERY_IMMODULES_TEST=false
+RUN_QUERY_MODULES_TEST=false
else
-RUN_QUERY_IMMODULES_TEST=test -z "$(DESTDIR)"
+RUN_QUERY_MODULES_TEST=test -z "$(DESTDIR)"
+all-local: pango.modules
endif
-install-data-local:
- @if $(RUN_QUERY_IMMODULES_TEST) ; then \
+install-data-local: $(top_builddir)/pango/pango-querymodules
+ @if $(RUN_QUERY_MODULES_TEST) ; then \
echo $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/pango \&\& \
$(top_builddir)/pango/pango-querymodules \
\> $(DESTDIR)$(sysconfdir)/pango/pango.modules ; \
> $(DESTDIR)$(sysconfdir)/pango/pango.modules ; \
else \
echo "***" ; \
- echo "*** Warning: pango.modules not created" ; \
- echo "***" ; \
+ echo "*** Warning: $(sysconfdir)/pango/pango.modules" ; \
+ echo "*** not created" ; \
echo "*** Generate this file on the target system" ; \
- echo "*** system using pango-querymodules" ; \
+ echo "*** using pango-querymodules" ; \
echo "***" ; \
fi
+pango.modules: $(top_builddir)/pango/pango-querymodules $(SUBDIRS)
+ @if find . -name '*.so' | grep 'so' > /dev/null ; then \
+ echo "Writing a pango.modules file to use with tests/examples."; \
+ $(top_builddir)/pango/pango-querymodules `find . -name '*.la' | grep -v '\.libs' | grep -v libpango` > $@ ;\
+ else \
+ echo "No dynamic modules found; will use only static modules for tests/examples."; \
+ touch $@; \
+ fi
+
included-modules:
@for d in $(SUBDIRS) ; do \
( cd $$d && $(MAKE) $(AM_MAKEFLAGS) included-modules ) ; \
done
.PHONY: included-modules dynamic-modules
-
--- /dev/null
+#
+# pangorc file for uninstalled operation.
+# We set the path as ../modules, such that it works from any of
+# top level build subdirs.
+#
+
+[Pango]
+ModuleFiles = ../modules/pango.modules
if HAVE_X
pangoinclude_HEADERS += pangox.h
lib_LTLIBRARIES += libpangox-1.0.la
+aliasdir = $(sysconfdir)/pango
+alias_DATA = pangox.aliases
endif
libpangox_1_0_la_LDFLAGS = $(LIBRARY_LIBTOOL_OPTIONS)
makefile.msc \
pango.rc \
pango.rc.in \
+ pangox.aliases \
pangoft2.rc \
pangoft2.rc.in \
pangowin32.rc \
testcolor
Makefile.in
Makefile
-pango.modules
+pangorc
## Process this file with automake to create Makefile.in.
+EXTRA_DIST = \
+ all-unicode.txt \
+ boundaries.utf8 \
+ runtests.sh
+
+CLEANFILES = pangorc
+DISTCLEANFILES = all-unicode.txt runtests.log
+
INCLUDES = \
-DG_DISABLE_DEPRECATED \
-I$(top_srcdir) \
endif
cxx_test_SOURCES = cxx-test.C
-if CROSS_COMPILING
-all-local:
-else
-all-local: all-unicode.txt pango.modules
-endif
-
-pango.modules:
- if find ../modules -name '*.so' | grep 'so' > /dev/null ; then \
- echo "Writing a pango.modules file to use when running tests before installing Pango."; \
- (cd ../modules && \
- ../pango/pango-querymodules `find . -name '*.la' | grep -v \.libs` > ../tests/pango.modules ) ;\
- else \
- echo "No dynamic modules found; will use only static modules for uninstalled test programs."; \
- touch pango.modules; \
- fi
-
-EXTRA_DIST = \
- all-unicode.txt \
- boundaries.utf8 \
- runtests.sh
-
all-unicode.txt: gen-all-unicode
./gen-all-unicode > all-unicode.txt
-CLEANFILES = pango.modules
-DISTCLEANFILES = all-unicode.txt runtests.log
+pangorc: $(srcdir)/../modules/pangorc
+ cp $< $@
+
+$(noinst_PROGRAMS) $(check_PROGRAMS): pangorc
{
gchar *text;
+ g_setenv ("PANGO_RC_FILE", "./pangorc", TRUE);
+
if (argc < 2)
fail ("must give a filename on the command line");
+++ /dev/null
-#
-# pangorc file for uninstalled operation.
-#
-
-[Pango]
-ModuleFiles = ./pango.modules
-
const gchar *srcdir;
const gchar *filename;
+ g_setenv ("PANGO_RC_FILE", "./pangorc", TRUE);
+
srcdir = getenv ("srcdir");
if (!srcdir)
srcdir = ".";
gboolean success;
ColorSpec *spec;
+ g_setenv ("PANGO_RC_FILE", "./pangorc", TRUE);
+
success = TRUE;
for (spec = specs; spec->spec; spec++)
success &= test_color (spec);
PangoContext *context;
PangoLayout *layout;
+ g_setenv ("PANGO_RC_FILE", "./pangorc", TRUE);
+
fontmap = pango_cairo_font_map_get_default ();
context = pango_cairo_font_map_create_context (PANGO_CAIRO_FONT_MAP (fontmap));
int
main (int argc, char **argv)
{
+ g_setenv ("PANGO_RC_FILE", "./pangorc", TRUE);
+
test_script_lookup ();
test_script_iter ();