Hi,
I am trying to render PDFs from screen output (6.5, for 7 see below) and ran
into this error:
# minimalistic example
d.erase
echo "Ciao" | d.text at=15,92 -b size=4 font=Vera
d.out.file output format=pdf
Using the Cairo driver.
Saving display from Monitor: [x0] to <output.pdf>.
Image size [1276 x 966]
ERROR: Cairo_draw_bitmap: Failed to create source
ERROR eof from graphics driver.
WARNING: Socket is already in use or not accepting connections.
WARNING: Use d.mon to select a monitor
ERROR: No graphics device selected
WARNING: Error - Monitor 'cairo' was not running
Screen export complete. (writing the file may take a small amount of time)
Image crop [1276 x 759]
Done.
If I don't define a Freetype font it works. Would it be possible to
get Freetype supported in CAIRO output ()? Eventually I'd need PDF
output with vectors ideally remaining vectors...
GRASS 7 - no success at all:
export GRASS_RENDER_IMMEDIATE=CAIRO
export GRASS_PNGFILE=map.pdf
d.rast map=elevation.10m
100%
ERROR: write_image: unknown file type: .pdf
I have installed:
rpm -qa | grep cairo
lib64cairomm1.0_1-1.8.0-1mdv2009.1
lib64cairo2-1.8.6-3mdv2009.1
python-cairo-1.8.2-1mdv2009.1
lib64cairo-devel-1.8.6-3mdv2009.1
libcairo2-1.8.6-3mdv2009.1
I see also:
rpm -qil lib64cairo-devel-1.8.6-3mdv2009.1
...
/usr/include/cairo/cairo-ft.h
/usr/include/cairo/cairo-pdf.h
/usr/include/cairo/cairo-ps.h
/usr/include/cairo/cairo-svg.h
...
/usr/lib64/libcairo.la
/usr/lib64/libcairo.so
Not sure what I am missing here.
Markus
Markus Neteler wrote:
I am trying to render PDFs from screen output (6.5, for 7 see below) and ran
into this error:
# minimalistic example
d.erase
echo "Ciao" | d.text at=15,92 -b size=4 font=Vera
d.out.file output format=pdf
Using the Cairo driver.
Saving display from Monitor: [x0] to <output.pdf>.
Image size [1276 x 966]
ERROR: Cairo_draw_bitmap: Failed to create source
Can you run "nm -D" on libgrass_cairodriver.so and report whether the
symbol cairo_format_stride_for_width appears in the output?
That function requires cairo 1.5.8 or later. On earlier versions, the
stride is forced to be a multiple of 4; it may be that it needs to be
a multiple of 8 on a 64-bit platform.
GRASS 7 - no success at all:
export GRASS_RENDER_IMMEDIATE=CAIRO
export GRASS_PNGFILE=map.pdf
d.rast map=elevation.10m
100%
ERROR: write_image: unknown file type: .pdf
That error message is from the PNG driver, which implies that GRASS
was built without cairo support.
--
Glynn Clements <glynn@gclements.plus.com>
On Sun, Aug 16, 2009 at 7:01 AM, Glynn Clements<glynn@gclements.plus.com> wrote:
Markus Neteler wrote:
I am trying to render PDFs from screen output (6.5, for 7 see below) and ran
into this error:
# minimalistic example
d.erase
echo "Ciao" | d.text at=15,92 -b size=4 font=Vera
d.out.file output format=pdf
Using the Cairo driver.
Saving display from Monitor: [x0] to <output.pdf>.
Image size [1276 x 966]
ERROR: Cairo_draw_bitmap: Failed to create source
Can you run "nm -D" on libgrass_cairodriver.so and report whether the
symbol cairo_format_stride_for_width appears in the output?
[neteler@localhost ~]$ nm -D
/home/neteler/grass64/dist.x86_64-unknown-linux-gnu/lib/libgrass_cairodriver.so
| grep cairo_format_stride_for_width
[neteler@localhost ~]$ nm -D
/home/neteler/grass65/dist.x86_64-unknown-linux-gnu/lib/libgrass_cairodriver.so
| grep cairo_format_stride_for_width
[neteler@localhost ~]$ nm -D
/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/lib/libgrass_cairodriver.so
| grep cairo_format_stride_for_width
U cairo_format_stride_for_width
[neteler@localhost ~]$ grep cairo_format_stride_for_width
grass64/lib/cairodriver/*
[neteler@localhost ~]$ grep cairo_format_stride_for_width
grass65/lib/cairodriver/*
[neteler@localhost ~]$ grep cairo_format_stride_for_width
grass70/lib/cairodriver/*
grass70/lib/cairodriver/Draw_bitmap.c: stride =
cairo_format_stride_for_width(CAIRO_FORMAT_A8, ncols);
So, only in 7.
That function requires cairo 1.5.8 or later.
I have (64bit)
rpm -qa | grep cairo
lib64cairomm1.0_1-1.8.0-1mdv2009.1
lib64cairo2-1.8.6-3mdv2009.1
python-cairo-1.8.2-1mdv2009.1
lib64cairo-devel-1.8.6-3mdv2009.1
libcairo2-1.8.6-3mdv2009.1
On earlier versions, the
stride is forced to be a multiple of 4; it may be that it needs to be
a multiple of 8 on a 64-bit platform.
GRASS 7 - no success at all:
export GRASS_RENDER_IMMEDIATE=CAIRO
export GRASS_PNGFILE=map.pdf
d.rast map=elevation.10m
100%
ERROR: write_image: unknown file type: .pdf
That error message is from the PNG driver, which implies that GRASS
was built without cairo support.
Actually, I compiled with cairo support:
grep cairo grass70/conf_grass70_64bit_pentium.sh
--with-cairo \
grep cairo grass70/include/Make/*
grass70/include/Make/Grass.make:CAIRODRIVER_LIBNAME = grass_cairodriver
grass70/include/Make/Platform.make:#cairo
grass70/include/Make/Platform.make:CAIROINC =
-I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2
-I/usr/include/libpng12
grass70/include/Make/Platform.make:CAIROLIB = -lcairo
-lfreetype -lfontconfig
grass70/include/Make/Platform.make.in:#cairo
Markus
Markus Neteler wrote:
[neteler@localhost ~]$ grep cairo_format_stride_for_width
grass64/lib/cairodriver/*
[neteler@localhost ~]$ grep cairo_format_stride_for_width
grass65/lib/cairodriver/*
[neteler@localhost ~]$ grep cairo_format_stride_for_width
grass70/lib/cairodriver/*
grass70/lib/cairodriver/Draw_bitmap.c: stride =
cairo_format_stride_for_width(CAIRO_FORMAT_A8, ncols);
So, only in 7.
Ah; you might try backporting r34923, r35242 and r35255.
>> ERROR: write_image: unknown file type: .pdf
>
> That error message is from the PNG driver, which implies that GRASS
> was built without cairo support.
Actually, I compiled with cairo support:
grep cairo grass70/conf_grass70_64bit_pentium.sh
--with-cairo \
AFAICT, the problem is due to the merge of lib/raster into
lib/display. lib/display/Makefile needs the following patch to enable
cairo:
--- lib/display/Makefile (revision 38759)
+++ lib/display/Makefile (working copy)
@@ -4,6 +4,8 @@
$(HTMLDRIVERLIB) $(RASTERLIB)
EXTRA_INC = -I../driver
+include $(MODULE_TOPDIR)/include/Make/Vars.make
+
ifneq ($(USE_CAIRO),)
EXTRA_LIBS += $(CAIRODRIVERLIB)
EXTRA_CFLAGS += -DUSE_CAIRO
--
Glynn Clements <glynn@gclements.plus.com>
On Mon, Aug 17, 2009 at 8:17 AM, Glynn Clements<glynn@gclements.plus.com> wrote:
Markus Neteler wrote:
cairo_format_stride_for_width(CAIRO_FORMAT_A8, ncols);
So, only in 7.
Ah; you might try backporting r34923, r35242 and r35255.
This looks like too complicated for me.
> That error message is from the PNG driver, which implies that GRASS
> was built without cairo support.
Actually, I compiled with cairo support:
grep cairo grass70/conf_grass70_64bit_pentium.sh
--with-cairo \
AFAICT, the problem is due to the merge of lib/raster into
lib/display. lib/display/Makefile needs the following patch to enable
cairo:
--- lib/display/Makefile (revision 38759)
+++ lib/display/Makefile (working copy)
@@ -4,6 +4,8 @@
$(HTMLDRIVERLIB) $(RASTERLIB)
EXTRA_INC = -I../driver
+include $(MODULE_TOPDIR)/include/Make/Vars.make
+
ifneq ($(USE_CAIRO),)
EXTRA_LIBS += $(CAIRODRIVERLIB)
EXTRA_CFLAGS += -DUSE_CAIRO
That helps - submitted.
Markus