[GRASS-dev] [GRASS GIS] #2448: Fontconfig error with cairo on Windows

#2448: Fontconfig error with cairo on Windows
-------------------------+--------------------------------------------------
Reporter: annakrat | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Display | Version: svn-trunk
Keywords: font | Platform: MSWindows 8
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
With selected cairo driver, d.* commands don't render any labels and you
get an error:

Fontconfig error: Cannot load default config file

GRASS installation seems to be fine. This error appears only on some
Windows 7/8 computers. After switching to png driver, text labels are
visible again. I hoped that the recent fix in installer (r62107) could
help this and indeed, one user stopped having this problem, but on a
different computer with fresh version, the problem persists.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2448&gt;
GRASS GIS <http://grass.osgeo.org>

#2448: Fontconfig error with cairo on Windows
-------------------------+--------------------------------------------------
Reporter: annakrat | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Display | Version: svn-trunk
Keywords: font | Platform: MSWindows 8
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by neteler):

Not sure if related but I checked my script which runs "configure" for me
with all switches I need and found therein

{{{
sh configure \
... \
--with-cairo --with-cairo-ldflags=-lfontconfig \
...
}}}

Maybe worth trying? Don't remember why I put it there, perhaps due to this
hint:

http://lists.osgeo.org/pipermail/grass-dev/2010-August/051801.html

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2448#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#2448: Fontconfig error with cairo on Windows
-------------------------+--------------------------------------------------
Reporter: annakrat | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Display | Version: svn-trunk
Keywords: font | Platform: MSWindows 8
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by hellik):

Replying to [ticket:2448 annakrat]:
> With selected cairo driver, d.* commands don't render any labels and you
get an error:
>
> Fontconfig error: Cannot load default config file
>

tested with

{{{
System Info
GRASS Version: 7.1.svn
GRASS SVN Revision: 62255
Erstellungsdatum: 2014-10-15
Build Platform: i686-pc-mingw32
GDAL/OGR: 1.11.0
PROJ.4: 4.8.0
GEOS: 3.4.2
SQLite: 3.7.17
Python: 2.7.4
wxPython: 2.8.12.1
Platform: Windows-7-6.1.7601-SP1 (OSGeo4W)
}}}

I can not confirm the error ''Fontconfig error: Cannot load default config
file'', but the labels aren't displayed with cairo; it is with the png
display driver.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2448#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#2448: Fontconfig error with cairo on Windows
-------------------------+--------------------------------------------------
Reporter: annakrat | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Display | Version: svn-trunk
Keywords: font | Platform: MSWindows 8
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by hellik):

Replying to [ticket:2448 annakrat]:
> With selected cairo driver, d.* commands don't render any labels and you
get an error:
>
> Fontconfig error: Cannot load default config file
>

some further tests:

- cairo enabled: vector labels are displayed only when d.vect map=myvect
'''and''' font=myfont (a font name) is given in the command

- png enabled: vector labels are displayed by the command d.vect
map=myvect , no font option is needed

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2448#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#2448: Fontconfig error with cairo on Windows
-------------------------+--------------------------------------------------
Reporter: annakrat | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Display | Version: svn-trunk
Keywords: font | Platform: MSWindows 8
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by annakrat):

Does anyone know where this config file should be located and where does
it come from?

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2448#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#2448: Fontconfig error with cairo on Windows
-------------------------+--------------------------------------------------
Reporter: annakrat | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Display | Version: svn-trunk
Keywords: font | Platform: MSWindows 8
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by hellik):

Replying to [comment:4 annakrat]:
> Does anyone know where this config file should be located and where does
it come from?

he related data lives in
''C:\OSGeo4W\apps\grass\grass-7.1.svn\etc\fontcap'' and AFAIK it is
generated during compilation by g.mkfontcap [1].

for the wingrass standalone installer years ago I've implemented a new
g.mkfontcap run during installation as the fonts list differs between the
compilation computer (Martin's compiling server) and your computer.

[1] http://grass.osgeo.org/grass71/manuals/g.mkfontcap.html

[2] http://trac.osgeo.org/grass/browser/grass/trunk/mswindows/GRASS-
Installer.nsi.tmpl#L538

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2448#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#2448: Fontconfig error with cairo on Windows
-------------------------+--------------------------------------------------
Reporter: annakrat | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Display | Version: svn-trunk
Keywords: font | Platform: MSWindows 8
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by hellik):

Replying to [comment:4 annakrat]:
> Does anyone know where this config file should be located and where does
it come from?

in the d.font-manual:

{{{
font=name
     Name of a font type, from among the font types italicized below.
     Default: romans
     Options: (italized)
     cyrilc Cyrillic
     gothgbt Gothic Great Britain triplex
     gothgrt Gothic German triplex
     gothitt Gothic Italian triplex
     greekc Greek complex
     greekcs Greek complex script
     greekp Greek plain
     greeks Greek simplex
     italicc Italian complex
     italiccs Italian complex small
     italict Italian triplex
     romanc Roman complex
     romancs Roman complex small
     romand Roman duplex
     romanp Roman plain
     romans Roman simplex
     romant Roman triplex
     scriptc Script complex
     scripts Script simplex
}}}

these are the fonts bundled with GRASS GIS livin in
C:\OSGeo4W\apps\grass\grass-7.1.svn\fonts

with Default: romans

a quick look in the fontcap file
C:\OSGeo4W\apps\grass\grass-7.1.svn\etc\fontcap of OSGeo4W-winGRASS

{{{
cyrilc|Cyrillic|0|C:\OSGeo4W\src\grass7_trunk\dist.i686-pc-
mingw32\fonts\cyrilc.hmp|0|utf-8|
gothgbt|Gothic Great Britain
triplex|0|C:\OSGeo4W\src\grass7_trunk\dist.i686-pc-
mingw32\fonts\gothgbt.hmp|0|utf-8|
gothgrt|Gothic German triplex|0|C:\OSGeo4W\src\grass7_trunk\dist.i686-pc-
mingw32\fonts\gothgrt.hmp|0|utf-8|
gothitt|Gothic Italian triplex|0|C:\OSGeo4W\src\grass7_trunk\dist.i686-pc-
mingw32\fonts\gothitt.hmp|0|utf-8|
greekc|Greek complex|0|C:\OSGeo4W\src\grass7_trunk\dist.i686-pc-
mingw32\fonts\greekc.hmp|0|utf-8|
greekcs|Greek complex script|0|C:\OSGeo4W\src\grass7_trunk\dist.i686-pc-
mingw32\fonts\greekcs.hmp|0|utf-8|
greekp|Greek plain|0|C:\OSGeo4W\src\grass7_trunk\dist.i686-pc-
mingw32\fonts\greekp.hmp|0|utf-8|
greeks|Greek simplex|0|C:\OSGeo4W\src\grass7_trunk\dist.i686-pc-
mingw32\fonts\greeks.hmp|0|utf-8|
italicc|Italian complex|0|C:\OSGeo4W\src\grass7_trunk\dist.i686-pc-
mingw32\fonts\italicc.hmp|0|utf-8|
italiccs|Italian complex small|0|C:\OSGeo4W\src\grass7_trunk\dist.i686-pc-
mingw32\fonts\italiccs.hmp|0|utf-8|
italict|Italian triplex|0|C:\OSGeo4W\src\grass7_trunk\dist.i686-pc-
mingw32\fonts\italict.hmp|0|utf-8|
romanc|Roman complex|0|C:\OSGeo4W\src\grass7_trunk\dist.i686-pc-
mingw32\fonts\romanc.hmp|0|utf-8|
romancs|Roman complex small|0|C:\OSGeo4W\src\grass7_trunk\dist.i686-pc-
mingw32\fonts\romancs.hmp|0|utf-8|
romand|Roman duplex|0|C:\OSGeo4W\src\grass7_trunk\dist.i686-pc-
mingw32\fonts\romand.hmp|0|utf-8|
romans|Roman simplex|0|C:\OSGeo4W\src\grass7_trunk\dist.i686-pc-
mingw32\fonts\romans.hmp|0|utf-8|
romant|Roman triplex|0|C:\OSGeo4W\src\grass7_trunk\dist.i686-pc-
mingw32\fonts\romant.hmp|0|utf-8|
scriptc|Script complex|0|C:\OSGeo4W\src\grass7_trunk\dist.i686-pc-
mingw32\fonts\scriptc.hmp|0|utf-8|
scripts|Script simplex|0|C:\OSGeo4W\src\grass7_trunk\dist.i686-pc-
mingw32\fonts\scripts.hmp|0|utf-8|

}}}

and in a standalone winGRASS

C:\Program Files\GRASS GIS 7.1.svn\etc\fontcap

{{{
cyrilc|Cyrillic|0|C:\Program Files\GRASS GIS
7.1.svn\fonts\cyrilc.hmp|0|utf-8|
gothgbt|Gothic Great Britain triplex|0|C:\Program Files\GRASS GIS
7.1.svn\fonts\gothgbt.hmp|0|utf-8|
gothgrt|Gothic German triplex|0|C:\Program Files\GRASS GIS
7.1.svn\fonts\gothgrt.hmp|0|utf-8|
gothitt|Gothic Italian triplex|0|C:\Program Files\GRASS GIS
7.1.svn\fonts\gothitt.hmp|0|utf-8|
greekc|Greek complex|0|C:\Program Files\GRASS GIS
7.1.svn\fonts\greekc.hmp|0|utf-8|
greekcs|Greek complex script|0|C:\Program Files\GRASS GIS
7.1.svn\fonts\greekcs.hmp|0|utf-8|
greekp|Greek plain|0|C:\Program Files\GRASS GIS
7.1.svn\fonts\greekp.hmp|0|utf-8|
greeks|Greek simplex|0|C:\Program Files\GRASS GIS
7.1.svn\fonts\greeks.hmp|0|utf-8|
italicc|Italian complex|0|C:\Program Files\GRASS GIS
7.1.svn\fonts\italicc.hmp|0|utf-8|
italiccs|Italian complex small|0|C:\Program Files\GRASS GIS
7.1.svn\fonts\italiccs.hmp|0|utf-8|
italict|Italian triplex|0|C:\Program Files\GRASS GIS
7.1.svn\fonts\italict.hmp|0|utf-8|
romanc|Roman complex|0|C:\Program Files\GRASS GIS
7.1.svn\fonts\romanc.hmp|0|utf-8|
romancs|Roman complex small|0|C:\Program Files\GRASS GIS
7.1.svn\fonts\romancs.hmp|0|utf-8|
romand|Roman duplex|0|C:\Program Files\GRASS GIS
7.1.svn\fonts\romand.hmp|0|utf-8|
romans|Roman simplex|0|C:\Program Files\GRASS GIS
7.1.svn\fonts\romans.hmp|0|utf-8|
romant|Roman triplex|0|C:\Program Files\GRASS GIS
7.1.svn\fonts\romant.hmp|0|utf-8|
scriptc|Script complex|0|C:\Program Files\GRASS GIS
7.1.svn\fonts\scriptc.hmp|0|utf-8|
scripts|Script simplex|0|C:\Program Files\GRASS GIS
7.1.svn\fonts\scripts.hmp|0|utf-8|
}}}

so it seems in OSGeo4W-winGRASS there is a compilation computer leftover
in the path.

is your error in OSGeo4W-winGRASS or in standalone winGRASS?

tested here with both:

- standalone winGRASS: vector labelling with cairo driver works as the
path to the bundled fonts is correct
- OSGeo4W-winGRASS: vector labelling with cairo driver fails as the path
to the bundled fonts is incorrect

(1) http://grass.osgeo.org/grass71/manuals/d.font.html

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2448#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>

#2448: Fontconfig error with cairo on Windows
-------------------------+--------------------------------------------------
Reporter: annakrat | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Display | Version: svn-trunk
Keywords: font | Platform: MSWindows 8
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by annakrat):

The problem appears with standalone installer too. Fontcap file has the
osgeo4w absolute path. The problem is that during installation,
run_gmkfontcap fails and the error message (when I run it afterwards
separately) is:

{{{
ERROR: Cannot open C:\Program Files (x86)\GRASS GIS svn/etc/fontcap for
writing: Permission denied
}}}

Running run_gmkfontcap as administrator doesn't help.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2448#comment:7&gt;
GRASS GIS <http://grass.osgeo.org>

#2448: Fontconfig error with cairo on Windows
-------------------------+--------------------------------------------------
Reporter: annakrat | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Display | Version: svn-trunk
Keywords: font | Platform: MSWindows 8
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by hellik):

Replying to [comment:7 annakrat]:
> The problem appears with standalone installer too. Fontcap file has the
osgeo4w absolute path. The problem is that during installation,
run_gmkfontcap fails and the error message (when I run it afterwards
separately) is:
>
> {{{
> ERROR: Cannot open C:\Program Files (x86)\GRASS GIS svn/etc/fontcap for
writing: Permission denied
> }}}
>
> Running run_gmkfontcap as administrator doesn't help.
>

mmhh, it seems there is some change in file access permission control in
win8 in comparison to win7 (already poped up in other places).

no win8 available here on my side.

is it possible to open the windows task manager during winGRASS
installation to see if invoking the bat file as a child process of the
installer fails or the access to the existing fontcap file fails?

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2448#comment:8&gt;
GRASS GIS <http://grass.osgeo.org>

#2448: Fontconfig error with cairo on Windows
-------------------------------------------+--------------------------------
Reporter: annakrat | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.1
Component: Display | Version: svn-trunk
Keywords: font, text, legend, scale bar | Platform: MSWindows 8
      Cpu: Unspecified |
-------------------------------------------+--------------------------------
Changes (by wenzeslaus):

  * keywords: font => font, text, legend, scale bar
  * milestone: 7.0.0 => 7.0.1

Comment:

Seems that this happens even on systems where it was working previously.
Now tested on MS Windows 8 with GRASS GIS 7.0.0 (standalone).

Adding workaround to
[http://grasswiki.osgeo.org/wiki/WinGRASS_errors#Legend_or_scale_bar_does_not_show_any_text
GRASS User Wiki]:

If you add legend or scale bar to the Map Display and you see only the
colors or the bar but not text, in the menu go to ''Settings'' >
''Preferences'', then select ''Map Display'' tab. Use ''Set font'' button
to set ''Default font for GRASS displays''. From the list choose `arial`
or another font you wish to use.

''BTW, there is no `7.0.0` Version in Trac. And also, is there some
possibility to remove some `6.4.x` Versions, e.g. turn all *`RCs` into
`releasebranch64`?''.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2448#comment:9&gt;
GRASS GIS <http://grass.osgeo.org>

#2448: Fontconfig error with cairo on Windows
-------------------------------------------+--------------------------------
Reporter: annakrat | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.1
Component: Display | Version: svn-trunk
Keywords: font, text, legend, scale bar | Platform: MSWindows 8
      Cpu: Unspecified |
-------------------------------------------+--------------------------------

Comment(by martinl):

Replying to [comment:9 wenzeslaus]:

> ''BTW, there is no `7.0.0` Version in Trac. And also, is there some
possibility to remove some `6.4.x` Versions, e.g. turn all *`RCs` into
`releasebranch64`?''.

done. Martin

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2448#comment:10&gt;
GRASS GIS <http://grass.osgeo.org>

#2448: Fontconfig error with cairo on Windows
-------------------------------------------+--------------------------------
Reporter: annakrat | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.1
Component: Display | Version: 7.0.0
Keywords: font, text, legend, scale bar | Platform: MSWindows 8
      Cpu: Unspecified |
-------------------------------------------+--------------------------------
Changes (by wenzeslaus):

  * version: svn-trunk => 7.0.0

Comment:

Replying to [comment:10 martinl]:
> Replying to [comment:9 wenzeslaus]:
>
> > ''BTW, there is no `7.0.0` Version in Trac. And also, is there some
possibility to remove some `6.4.x` Versions, e.g. turn all *`RCs` into
`releasebranch64`?''.
>
> done. Martin

Thanks, Martin.

Changing Version of this from trunk to 7.0.0. However, note that it was
true for release branch also before 7.0.0, e.g. 7.0.0beta4. It probably
depends on update of MS Windows.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2448#comment:11&gt;
GRASS GIS <http://grass.osgeo.org>

#2448: Fontconfig error with cairo on Windows
-------------------------------------------+--------------------------------
Reporter: annakrat | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.1
Component: Display | Version: 7.0.0
Keywords: font, text, legend, scale bar | Platform: MSWindows 8
      Cpu: Unspecified |
-------------------------------------------+--------------------------------

Comment(by annakrat):

I made a screencast to see what's in the terminal which just flashes
during the installation. I get:

{{{
Setup of WinGRASS-7.0.0
Generating the font configuration file by scanning various directories for
fonts

Please wait. Console window will close automatically ....
ERROR: GISRC - variable not set
}}}

This is the same what happens if you run run_gmkfontcap from windows
command prompt.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2448#comment:12&gt;
GRASS GIS <http://grass.osgeo.org>

#2448: Fontconfig error with cairo on Windows
-------------------------------------------+--------------------------------
Reporter: annakrat | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.1
Component: Display | Version: 7.0.0
Keywords: font, text, legend, scale bar | Platform: MSWindows 8
      Cpu: Unspecified |
-------------------------------------------+--------------------------------

Comment(by hellik):

Replying to [comment:12 annakrat]:
> I made a screencast to see what's in the terminal which just flashes
during the installation. I get:
>
>
> {{{
> Setup of WinGRASS-7.0.0
> Generating the font configuration file by scanning various directories
for fonts
>
> Please wait. Console window will close automatically ....
> ERROR: GISRC - variable not set
> }}}
>
> This is the same what happens if you run run_gmkfontcap from windows
command prompt.

is this a fresh system without any previous winGRASS-installation before?

I've added gmkfontcap.bat (''Run g.mkfontcap outside a grass session
during installation'') years ago.

relevant lines of codes
[http://trac.osgeo.org/grass/browser/grass/trunk/mswindows/GRASS-
Installer.nsi.tmpl#L531 g.mkfontcap] and following.

{{{
534 IfErrors done_create_run_gmkfontcap.bat
535 FileWrite $0 '@echo off$\r$\n'
536 FileWrite $0 'rem
#########################################################################$\r$\n'
537 FileWrite $0 'rem #$\r$\n'
538 FileWrite $0 'rem # Run g.mkfontcap outside a grass
session during installation$\r$\n'
539 FileWrite $0 'rem #$\r$\n'
540 FileWrite $0 'rem
#########################################################################$\r$\n'
541 FileWrite $0 'echo Setup of
WinGRASS-${VERSION_NUMBER}$\r$\n'
542 FileWrite $0 'echo Generating the font configuration file
by scanning various directories for fonts.$\r$\n'
543 FileWrite $0 'echo Please wait. Console window will close
automatically ....$\r$\n'
544 FileWrite $0 '$\r$\n'
545 FileWrite $0 'rem set gisbase$\r$\n'
546 FileWrite $0 'set GISBASE=$INSTALL_DIR$\r$\n'
547 FileWrite $0 '$\r$\n'
548 FileWrite $0 'rem set path to freetype dll$\r$\n'
549 FileWrite $0 'set
FREETYPEBASE=$INSTALL_DIR\extrabin;$INSTALL_DIR\msys\bin;$INSTALL_DIR\lib$\r$\n'
550 FileWrite $0 '$\r$\n'
551 FileWrite $0 'rem set dependecies path$\r$\n'
552 FileWrite $0 'set PATH=%FREETYPEBASE%;%PATH%$\r$\n'
553 FileWrite $0 '$\r$\n'
554 FileWrite $0 'rem run g.mkfontcap outside a grass
session$\r$\n'
555 FileWrite $0 '"%GISBASE%\bin\g.mkfontcap.exe" -o$\r$\n'
556 FileWrite $0 'exit$\r$\n'
557 FileClose $0
}}}

any idea which variable isn't set?

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2448#comment:13&gt;
GRASS GIS <http://grass.osgeo.org>

#2448: Fontconfig error with cairo on Windows
-------------------------------------------+--------------------------------
Reporter: annakrat | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.1
Component: Display | Version: 7.0.0
Keywords: font, text, legend, scale bar | Platform: MSWindows 8
      Cpu: Unspecified |
-------------------------------------------+--------------------------------

Comment(by wenzeslaus):

Replying to [comment:13 hellik]:
> Replying to [comment:12 annakrat]:
> > I made a screencast to see what's in the terminal which just flashes
during the installation. I get:
> >
> >
{{{
...
ERROR: GISRC - variable not set
}}}
> >
> > This is the same what happens if you run run_gmkfontcap from windows
command prompt.
>
>
> relevant lines of codes
[http://trac.osgeo.org/grass/browser/grass/trunk/mswindows/GRASS-
Installer.nsi.tmpl#L531 g.mkfontcap] and following.
>
{{{
...
546 FileWrite $0 'set GISBASE=$INSTALL_DIR$\r$\n'
547 FileWrite $0 '$\r$\n'
548 FileWrite $0 'rem set path to freetype dll$\r$\n'
549 FileWrite $0 'set
FREETYPEBASE=$INSTALL_DIR\extrabin;$INSTALL_DIR\msys\bin;$INSTALL_DIR\lib$\r$\n'
550 FileWrite $0 '$\r$\n'
551 FileWrite $0 'rem set dependecies path$\r$\n'
552 FileWrite $0 'set PATH=%FREETYPEBASE%;%PATH%$\r$\n'
...
}}}
>
> any idea which variable isn't set?

It is the [http://grass.osgeo.org/grass70/manuals/variables.html#list-of-
selected-%28grass-related%29-shell-environment-variables GISRC] variable
which is not set.

The issue is that you have to set it and probably also create a valid
file. It rcfile and `GISRC` variable handling seems nontrivial and I don't
understand what is the actual goal here but perhaps you will be more
successful.

  * source:grass/trunk/lib/init/grass.py#L1335
  * source:grass/trunk/lib/init/grass.py#L273

We could perhaps avoid this problem altogether if we would just tell GRASS
GIS what to run (#2579), although this might have its own problems during
installation.

One other thing is that it is not clear to me what changed that now GISRC
variable is required but it was not before.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2448#comment:14&gt;
GRASS GIS <http://grass.osgeo.org>

#2448: Fontconfig error with cairo on Windows
-------------------------------------------+--------------------------------
Reporter: annakrat | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.1
Component: Display | Version: 7.0.0
Keywords: font, text, legend, scale bar | Platform: MSWindows 8
      Cpu: Unspecified |
-------------------------------------------+--------------------------------

Comment(by hellik):

Replying to [comment:14 wenzeslaus]:
>
> One other thing is that it is not clear to me what changed that now
GISRC variable is required but it was not before.

the same here ...

> It is the GISRC variable which is not set.

within a OSGeo4W-winGRASS7.1-session:

{{{
C:\>echo %GISRC%
C:\Users\xxxx\AppData\Local\Temp\grass7-xxxx-6188\gisrc
}}}

the content of gisrc:

{{{
DEBUG: 0
MAPSET: srtmbgld
GISDBASE: C:\grassdata
LOCATION_NAME: srtm
GUI: wxpython
}}}

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2448#comment:15&gt;
GRASS GIS <http://grass.osgeo.org>

#2448: Fontconfig error with cairo on Windows
--------------------------+-------------------------------------------
  Reporter: annakrat | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.1
Component: Display | Version: 7.0.0
Resolution: | Keywords: font, text, legend, scale bar
       CPU: Unspecified | Platform: MSWindows 8
--------------------------+-------------------------------------------

Comment (by wenzeslaus):

Replying to [comment:14 wenzeslaus]:
> Replying to [comment:13 hellik]:
> > Replying to [comment:12 annakrat]:
> > > I made a screencast to see what's in the terminal which just flashes
during the installation. I get:
> > >
> > >
> {{{
> ...
> ERROR: GISRC - variable not set
> }}}
> > >
> > > This is the same what happens if you run run_gmkfontcap from windows
command prompt.
> >
> >
> > relevant lines of codes
[http://trac.osgeo.org/grass/browser/grass/trunk/mswindows/GRASS-
Installer.nsi.tmpl#L531 g.mkfontcap] and following.
> >
> {{{
> ...
> 546 FileWrite $0 'set GISBASE=$INSTALL_DIR$\r$\n'
> 547 FileWrite $0 '$\r$\n'
> 548 FileWrite $0 'rem set path to freetype dll$\r$\n'
> 549 FileWrite $0 'set
FREETYPEBASE=$INSTALL_DIR\extrabin;$INSTALL_DIR\msys\bin;$INSTALL_DIR\lib$\r$\n'
> 550 FileWrite $0 '$\r$\n'
> 551 FileWrite $0 'rem set dependecies path$\r$\n'
> 552 FileWrite $0 'set PATH=%FREETYPEBASE%;%PATH%$\r$\n'
> ...
> }}}
> >
> > any idea which variable isn't set?
>
> It is the [http://grass.osgeo.org/grass70/manuals/variables.html#list-
of-selected-%28grass-related%29-shell-environment-variables GISRC]
variable which is not set.
> [...]
> We could perhaps avoid this problem altogether if we would just tell
GRASS GIS what to run (#2579),

After r65252 and r65294 (see #2579) you can use (in trunk, upcoming 7.1
release):

{{{
C:\path\to\grass C:\path\to\demomapset --exec g.mkfontcap
}}}

This should run `g.mkfontcap` in a regular GRASS session but without
touching user's GRASS rc file in home directory (if it does, it's a bug),
so the last used Mapset will be still whatever user or installer sets.

> although this might have its own problems during installation.

GRASS is installed, right? So this should work in theory.

> One other thing is that it is not clear to me what changed that now
GISRC variable is required but it was not before.

Let's say that we don't need to deal with this because it is expected that
GRASS module requires `GISRC` to be set. I'm just not sure why it is
expected by `​g.mkfontcap` (probably it calls some GRASS library
functions).

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2448#comment:16&gt;
GRASS GIS <http://grass.osgeo.org>

#2448: Fontconfig error with cairo on Windows
--------------------------+-------------------------------------------
  Reporter: annakrat | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.1
Component: Display | Version: 7.0.0
Resolution: | Keywords: font, text, legend, scale bar
       CPU: Unspecified | Platform: MSWindows 8
--------------------------+-------------------------------------------

Comment (by hellik):

Replying to [comment:16 wenzeslaus]:
> Replying to [comment:14 wenzeslaus]:
> > Replying to [comment:13 hellik]:
> > > Replying to [comment:12 annakrat]:
> > > > I made a screencast to see what's in the terminal which just
flashes during the installation. I get:
> > > >
> > > >
> > {{{
> > ...
> > ERROR: GISRC - variable not set
> > }}}
> > > >
> > > > This is the same what happens if you run run_gmkfontcap from
windows command prompt.
> > >
> > >
> > > relevant lines of codes
[http://trac.osgeo.org/grass/browser/grass/trunk/mswindows/GRASS-
Installer.nsi.tmpl#L531 g.mkfontcap] and following.
> > >
> > {{{
> > ...
> > 546 FileWrite $0 'set GISBASE=$INSTALL_DIR$\r$\n'
> > 547 FileWrite $0 '$\r$\n'
> > 548 FileWrite $0 'rem set path to freetype dll$\r$\n'
> > 549 FileWrite $0 'set
FREETYPEBASE=$INSTALL_DIR\extrabin;$INSTALL_DIR\msys\bin;$INSTALL_DIR\lib$\r$\n'
> > 550 FileWrite $0 '$\r$\n'
> > 551 FileWrite $0 'rem set dependecies path$\r$\n'
> > 552 FileWrite $0 'set PATH=%FREETYPEBASE%;%PATH%$\r$\n'
> > ...
> > }}}
> > >
> > > any idea which variable isn't set?
> >
> > It is the [http://grass.osgeo.org/grass70/manuals/variables.html#list-
of-selected-%28grass-related%29-shell-environment-variables GISRC]
variable which is not set.
> > [...]
> > We could perhaps avoid this problem altogether if we would just tell
GRASS GIS what to run (#2579),
>
> After r65252 and r65294 (see #2579) you can use (in trunk, upcoming 7.1
release):
>
> {{{
> C:\path\to\grass C:\path\to\demomapset --exec g.mkfontcap
> }}}
>
> This should run `g.mkfontcap` in a regular GRASS session but without
touching user's GRASS rc file in home directory (if it does, it's a bug),
so the last used Mapset will be still whatever user or installer sets.
>
> > although this might have its own problems during installation.
>
> GRASS is installed, right? So this should work in theory.
>
> > One other thing is that it is not clear to me what changed that now
GISRC variable is required but it was not before.
>
> Let's say that we don't need to deal with this because it is expected
that GRASS module requires `GISRC` to be set. I'm just not sure why it is
expected by `​g.mkfontcap` (probably it calls some GRASS library
functions).

the discussion about a g.mkfontcap outside a winGRASS session dates back
to 2010.

I've found following in this long discussion:

http://lists.osgeo.org/pipermail/grass-dev/2010-March/049491.html

{{{
On Sat, 6 Mar 2010, Helmut Kudrnovsky wrote:

> from the grass-windows-point-of-view:
>
> I've tested in the last days a lot the issues in
> http://trac.osgeo.org/grass/ticket/908
>
> r40857 (see http://trac.osgeo.org/grass/ticket/908#comment:9) should be
> backported to grass64. g.mkfontcap with this fixes is working outside a
> grass-session.

Just to note, the Linux install script (binaryInstall.src) runs
g.mkfontcap outside of a GRASS session by simply setting GISRC to a junk
value:

GISBASE="$DESTDIR" GISRC=junk
LD_LIBRARY_PATH_VAR="${DESTDIR}/lib:$LD_LIBRARY_PATH_VAR"
"${DESTDIR}/bin/g.mkfontcap" -o

(In Windows the equivalent would be to run the command
set GISRC=junk
before running g.mkfontcap)
Not 100% sure if that's relevant here, but thought it might be worth
mentioning to give some context.

Paul
}}}

should we try this solution in winGRASS7.x-series?

Helmut

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2448#comment:17&gt;
GRASS GIS <http://grass.osgeo.org>

#2448: Fontconfig error with cairo on Windows
--------------------------+-------------------------------------------
  Reporter: annakrat | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.1
Component: Display | Version: 7.0.0
Resolution: | Keywords: font, text, legend, scale bar
       CPU: Unspecified | Platform: MSWindows 8
--------------------------+-------------------------------------------

Comment (by hellik):

Replying to [comment:17 hellik]:

>
> GISBASE="$DESTDIR" GISRC=junk
LD_LIBRARY_PATH_VAR="${DESTDIR}/lib:$LD_LIBRARY_PATH_VAR"
"${DESTDIR}/bin/g.mkfontcap" -o
>

it's here:

https://trac.osgeo.org/grass/browser/grass/trunk/binaryInstall.src#L343

{{{
341 echo "Generating display font configuration file..."
342
343 GISBASE="$DESTDIR" GISRC=junk
LD_LIBRARY_PATH_VAR="${DESTDIR}/lib:$LD_LIBRARY_PATH_VAR"
"${DESTDIR}/bin/g.mkfontcap" -o
344
345 echo""
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2448#comment:18&gt;
GRASS GIS <http://grass.osgeo.org>

#2448: Fontconfig error with cairo on Windows
--------------------------+-------------------------------------------
  Reporter: annakrat | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.1
Component: Display | Version: 7.0.0
Resolution: | Keywords: font, text, legend, scale bar
       CPU: Unspecified | Platform: MSWindows 8
--------------------------+-------------------------------------------

Comment (by hellik):

Replying to [comment:18 hellik]:
> Replying to [comment:17 hellik]:
>
> >
> > GISBASE="$DESTDIR" GISRC=junk
LD_LIBRARY_PATH_VAR="${DESTDIR}/lib:$LD_LIBRARY_PATH_VAR"
"${DESTDIR}/bin/g.mkfontcap" -o
> >
>
> it's here:
>
> https://trac.osgeo.org/grass/browser/grass/trunk/binaryInstall.src#L343
>
>
> {{{
> 341 echo "Generating display font configuration file..."
> 342
> 343 GISBASE="$DESTDIR" GISRC=junk
LD_LIBRARY_PATH_VAR="${DESTDIR}/lib:$LD_LIBRARY_PATH_VAR"
"${DESTDIR}/bin/g.mkfontcap" -o
> 344
> 345 echo""
> }}}
>

see also here https://trac.osgeo.org/grass/ticket/908

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2448#comment:19&gt;
GRASS GIS <http://grass.osgeo.org>