[GRASS-dev] [GRASS GIS] #908: v.label.sa - No Font Definition File, windows xp

#908: v.label.sa - No Font Definition File, windows xp
-------------------------+--------------------------------------------------
Reporter: voncasec | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.0
Component: default | Version: svn-releasebranch64
Keywords: v.label.sa | Platform: MSWindows XP
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
C:/Program Files/GRASS-64-SVN/etc/fontcap: No font definition file

The installed version includes a file called fontcap.tmpl under the
appropriate directory however the v.labels.sa program does not recognize
it.

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

#908: No Font Definition File, windows xp
---------------------------+------------------------------------------------
  Reporter: voncasec | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: critical | Milestone: 6.4.0
Component: Installation | Version: svn-releasebranch64
Resolution: | Keywords: v.label.sa, g.mkfontcap, wingrass
  Platform: MSWindows XP | Cpu: Unspecified
---------------------------+------------------------------------------------
Changes (by hamish):

  * keywords: v.label.sa => v.label.sa, g.mkfontcap, wingrass
  * priority: normal => critical
  * component: default => Installation
  * summary: v.label.sa - No Font Definition File, windows xp => No Font
              Definition File, windows xp

Comment:

'd.font -l' and 'd.font -L' also fail.

-> g.mkfontcap needs to be run as part of the WinGrass installer, or upon
the first time you run grass.

Init.sh:
{{{
   if [ ! -e "$GISBASE/etc/fontcap" ] ; do
       g.mkfontcap
   fi
}}}

??

Hamish

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

#908: No Font Definition File, windows xp
---------------------------+------------------------------------------------
  Reporter: voncasec | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: critical | Milestone: 6.4.0
Component: Installation | Version: svn-releasebranch64
Resolution: | Keywords: v.label.sa, g.mkfontcap, wingrass
  Platform: MSWindows XP | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by hamish):

... but for be benefit of users without admin rights on the system it
should probably happen as part of the installer.

maybe for GRASS 7 we should first check for it in ~/.grass7/fontcap, and
if not found there look for it in $(ETC)/fontcap?

Hamish

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

#908: No Font Definition File, windows xp
---------------------------+------------------------------------------------
  Reporter: voncasec | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: critical | Milestone: 6.4.0
Component: Installation | Version: svn-releasebranch64
Resolution: | Keywords: v.label.sa, g.mkfontcap, wingrass
  Platform: MSWindows XP | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by glynn):

Replying to [comment:2 hamish]:

> maybe for GRASS 7 we should first check for it in ~/.grass7/fontcap, and
if not found there look for it in $(ETC)/fontcap?

The code which reads the file uses $GRASS_FONT_CAP if it is set and the
file can be read, otherwise $GISBASE/etc/fontcap.

If g.mkfontcap is run without the -s flag, the data will be written to
$GRASS_FONT_CAP if it is set, otherwise to $GISBASE/etc/fontcap. If
$GRASS_FONT_CAP is set but the file cannot be written, it fails.

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

#908: No Font Definition File, windows xp
---------------------------+------------------------------------------------
  Reporter: voncasec | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: critical | Milestone: 6.4.0
Component: Installation | Version: svn-releasebranch64
Resolution: | Keywords: v.label.sa, g.mkfontcap, wingrass
  Platform: MSWindows XP | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by hellik):

Replying to [comment:2 hamish]:
> ... but for be benefit of users without admin rights on the system it
should probably happen as part of the installer.
[...]
> Hamish

Replying to [comment:2 hamish]:
> ... but for be benefit of users without admin rights on the system it
should probably happen as part of the installer.
>
> maybe for GRASS 7 we should first check for it in ~/.grass7/fontcap, and
if not found there look for it in $(ETC)/fontcap?
>
>
> Hamish

the NSIS-installer is able to run g.mkfontcap
(http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.1.2)

{{{
Exec '"$INSTDIR\someprogram.exe"'
Exec '"$INSTDIR\someprogram.exe" some parameters'
}}}

is there any other information needed by g.mkfontcap (beside the ouput
destination GRASS_FONT_CAP)?

Helmut

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

#908: No Font Definition File, windows xp
---------------------------+------------------------------------------------
  Reporter: voncasec | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: critical | Milestone: 6.4.0
Component: Installation | Version: svn-releasebranch64
Resolution: | Keywords: v.label.sa, g.mkfontcap, wingrass
  Platform: MSWindows XP | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by glynn):

Replying to [comment:4 hellik]:

> is there any other information needed by g.mkfontcap (beside the ouput
destination GRASS_FONT_CAP)?

No. Running it without arguments should be fine in this case. It
automatically scans `${WINDIR}/Fonts`.

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

#908: No Font Definition File, windows xp
---------------------------+------------------------------------------------
  Reporter: voncasec | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: critical | Milestone: 6.4.0
Component: Installation | Version: svn-releasebranch64
Resolution: | Keywords: v.label.sa, g.mkfontcap, wingrass
  Platform: MSWindows XP | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by hamish):

it uses G_no_gisinit(), but from outside of grass (ie in the installer) it
still needs to have ligbis and the freetype lib found somewhere in the
%PATH%, right?

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

#908: No Font Definition File, windows xp
---------------------------+------------------------------------------------
  Reporter: voncasec | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: critical | Milestone: 6.4.0
Component: Installation | Version: svn-releasebranch64
Resolution: | Keywords: v.label.sa, g.mkfontcap, wingrass
  Platform: MSWindows XP | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by hellik):

Replying to [comment:6 hamish]:
> it uses G_no_gisinit(), but from outside of grass (ie in the installer)
it still needs to have ligbis and the freetype lib found somewhere in the
%PATH%, right?

for testing, I've tried g.mkfontcap.exe in a MS-cmd outside a grass-
session, so there is an error "libfreetype-6.dll couldn't be found".

Helmut

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

#908: No Font Definition File, windows xp
---------------------------+------------------------------------------------
  Reporter: voncasec | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: critical | Milestone: 6.4.0
Component: Installation | Version: svn-releasebranch64
Resolution: | Keywords: v.label.sa, g.mkfontcap, wingrass
  Platform: MSWindows XP | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by glynn):

Replying to [comment:6 hamish]:
> it uses G_no_gisinit(), but from outside of grass (ie in the installer)
it still needs to have ligbis and the freetype lib found somewhere in the
%PATH%, right?
Right.

It also needs $GISBASE to be set so that it can find the stroke fonts in
$GISBASE/fonts.

And it needs $GISRC to be set (and valid) because `G_parser()` uses
`G__getenv("OVERWRITE")` as well as `getenv("GRASS_OVERWRITE")`. It checks
these regardless of whether there are any options with "new" in the
gisprompt field (the overwrite field in the GModule structure is set
according to whether overwrite is enabled so that modules can perform
their own checks).

AFAICT, the simplest fix is to add:
{{{
     G_set_gisrc_mode(G_GISRC_MODE_MEMORY);
}}}
to `G_no_gisinit()`.

Fixed in r40854 (6.5) and r40855 (7.0). Suggest back-port to 6.4 after
testing.

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

#908: No Font Definition File, windows xp
---------------------------+------------------------------------------------
  Reporter: voncasec | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: critical | Milestone: 6.4.0
Component: Installation | Version: svn-releasebranch64
Resolution: | Keywords: v.label.sa, g.mkfontcap, wingrass
  Platform: MSWindows XP | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by glynn):

Replying to [comment:8 glynn]:

> AFAICT, the simplest fix is to add:
{{{
     G_set_gisrc_mode(G_GISRC_MODE_MEMORY);
}}}
> to `G_no_gisinit()`.

Oops. It took me all of two minutes to realise that isn't going to work
(it breaks g.proj and g.gisenv). I've moved the code into g.mkfontcap and
g.dirseps in r40856 (7.0) and r40857 (6.5).

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

Hamish,
Many government organizations that use Windows are going to LUA, ``[http://technet.microsoft.com/en-us/library/cc700846.aspx](http://technet.microsoft.com/en-us/library/cc700846.aspx)`` Least-privileged User Account environments for most users. Having a normal user need to do anything as an administrator to run a program is almost a show-stopper for deployment in these environments.

So, I wholeheartedly applaud anything that can be done to make GRASS run well under Windows without any administrative access.

Doug
``
Doug Newcomb
USFWS
Raleigh, NC
919-856-4520 ext. 14 doug_newcomb@fws.gov
---------------------------------------------------------------------------------------------------------
The opinions I express are my own and are not representative of the official policy of the U.S.Fish and Wildlife Service or Dept. of the Interior. Life is too short for undocumented, proprietary data formats.

-----grass-dev-bounces@lists.osgeo.org wrote: -----

To: undisclosed-recipients:;
From: "GRASS GIS"
Sent by: grass-dev-bounces@lists.osgeo.org
Date: 02/05/2010 03:41AM
Subject: [GRASS-dev] Re: [GRASS GIS] #908: No Font Definition File, windows xp

#908: No Font Definition File, windows xp
---------------------------+------------------------------------------------
Reporter: voncasec | Owner: grass-dev@lists.osgeo.org
Type: defect | Status: new
Priority: critical | Milestone: 6.4.0
Component: Installation | Version: svn-releasebranch64
Resolution: | Keywords: v.label.sa, g.mkfontcap, wingrass
Platform: MSWindows XP | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by hamish):

... but for be benefit of users without admin rights on the system it
should probably happen as part of the installer.

maybe for GRASS 7 we should first check for it in ~/.grass7/fontcap, and
if not found there look for it in $(ETC)/fontcap?

Hamish

--
Ticket URL:
GRASS GIS
_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
[http://lists.osgeo.org/mailman/listinfo/grass-dev](http://lists.osgeo.org/mailman/listinfo/grass-dev)

#908: No Font Definition File, windows xp
---------------------------+------------------------------------------------
  Reporter: voncasec | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: critical | Milestone: 6.4.0
Component: Installation | Version: svn-releasebranch64
Resolution: | Keywords: v.label.sa, g.mkfontcap, wingrass
  Platform: MSWindows XP | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by hellik):

Replying to [comment:9 glynn]:
> Replying to [comment:8 glynn]:
>
> > AFAICT, the simplest fix is to add:
> {{{
> G_set_gisrc_mode(G_GISRC_MODE_MEMORY);
> }}}
> > to `G_no_gisinit()`.
>
> Oops. It took me all of two minutes to realise that isn't going to work
(it breaks >g.proj and g.gisenv). I've moved the code into g.mkfontcap and
g.dirseps in r40856 >(7.0) and r40857 (6.5).

what does this mean for running g.mkfontcap outside a Grass-session (and
accordingly for the NSIS-installer)? which parameters have to be set for
working g.mkfontcap outside a Grass-session?

Helmut

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

#908: No Font Definition File, windows xp
---------------------------+------------------------------------------------
  Reporter: voncasec | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: critical | Milestone: 6.4.0
Component: Installation | Version: svn-releasebranch64
Resolution: | Keywords: v.label.sa, g.mkfontcap, wingrass
  Platform: MSWindows XP | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by glynn):

Replying to [comment:10 hellik]:

> what does this mean for running g.mkfontcap outside a Grass-session (and
accordingly for the NSIS-installer)? which parameters have to be set for
working g.mkfontcap outside a Grass-session?

GISRC should no longer have to be set. GISBASE must still be set (this
eliminates the need for the installer to set GRASS_FONT_CAP, as the
default of $GISBASE/etc/fontcap will work).

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

Doug Newcomb wrote:

Many government organizations that use Windows are
going to LUA, http://technet.microsoft.com/en-us/library/cc700846.aspx Least-privileged
User Account environments for most users. Having a
normal user need to do anything as an administrator to run a
program is almost a show-stopper for deployment in these
environments.
  So, I wholeheartedly applaud anything that
can be done to make GRASS run well under Windows without any
administrative access.

This has certainly been our intention all along. There is some stuff yet
to figure out and work around (like adding v.patch and r.patch to the
package manifest so UAC doesn't choke on the word "patch"), but for the
most part I think we are, or at least will be, in pretty good shape.

It really helps that this has already been the UNIX model since forever,
in fact even if the multi-user stuff isn't used as much anymore, this is
the model GRASS was originally designed for. I think it would be much
harder to go the other way and try and port a large DOS+Windows codebase+
way of doing things into a UNIX ecosystem.

regards,
Hamish

#908: No Font Definition File, windows xp
---------------------------+------------------------------------------------
  Reporter: voncasec | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: critical | Milestone: 6.4.0
Component: Installation | Version: svn-releasebranch64
Resolution: | Keywords: v.label.sa, g.mkfontcap, wingrass
  Platform: MSWindows XP | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by hellik):

Replying to [comment:11 glynn]:
> Replying to [comment:10 hellik]:
>
> > what does this mean for running g.mkfontcap outside a Grass-session
(and accordingly for the NSIS-installer)? which parameters have to be set
for working g.mkfontcap outside a Grass-session?
>
> GISRC should no longer have to be set. GISBASE must still be set (this
eliminates the need for the installer to set GRASS_FONT_CAP, as the
default of $GISBASE/etc/fontcap will work).

i've tested g.mkfontcap with grass65 running outside a grass-session. it's
working, fontcap is built.

I attach a patch for the NSIS-installer script to write a little cmd-file
to set all dependecies and then run g.mkfontcap outside a grass session.

the cmd is working by right click with "run as admin" on
C:\Program Files\GRASS-65-SVN\etc\install_run_gmkfontcap.cmd
but if it's started by the installer itself, there seems that
install_run_gmkfontcap.cmd isn't allowed to write fontcap in C:\Program
Files\GRASS-65-SVN\etc\.

Helmut

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

#908: No Font Definition File, windows xp
---------------------------+------------------------------------------------
  Reporter: voncasec | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: critical | Milestone: 6.4.0
Component: Installation | Version: svn-releasebranch64
Resolution: | Keywords: v.label.sa, g.mkfontcap, wingrass
  Platform: MSWindows XP | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by hellik):

Replying to [comment:12 hellik]:
> I attach a patch for the NSIS-installer script to write a little cmd-
file to set all dependecies and then run g.mkfontcap outside a grass
session.

there was a typo, i change the patch, but it doesn't help to run the
g.mkfontcap by the installer.

Helmut

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

#908: No Font Definition File, windows xp
---------------------------+------------------------------------------------
  Reporter: voncasec | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: critical | Milestone: 6.4.0
Component: Installation | Version: svn-releasebranch64
Resolution: | Keywords: v.label.sa, g.mkfontcap, wingrass
  Platform: MSWindows XP | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by hellik):

Replying to [comment:13 hellik]:
> Replying to [comment:12 hellik]:
> > I attach a patch for the NSIS-installer script to write a little cmd-
file to set all dependecies and then run g.mkfontcap outside a grass
session.
>
> there was a typo, i change the patch, but it doesn't help to run the
g.mkfontcap by the installer.
>
> Helmut

the little helper script ''install_run_gmkfontcap.cmd'' itself included in
the NSIS-script (Line 418 - 441 in
https://trac.osgeo.org/grass/attachment/ticket/908/install_run_gmkfontcap.g65.patch)
is working, that means g.mkfontcap (grass65-version) is working (thanks to
Glynn's fixes in r40857 ) outside a Grass-session.

but I'm lost at the moment by invoking ''install_run_gmkfontcap.cmd'' by
the NSIS-installer (Line 443 - 444 in
https://trac.osgeo.org/grass/attachment/ticket/908/install_run_gmkfontcap.g65.patch)
and getting writing permission in c:\Program Files\.

any suggestions?

Helmut

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

#908: No Font Definition File, windows xp
---------------------------+------------------------------------------------
  Reporter: voncasec | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: critical | Milestone: 6.4.0
Component: Installation | Version: svn-releasebranch64
Resolution: | Keywords: v.label.sa, g.mkfontcap, wingrass
  Platform: MSWindows XP | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by hellik):

Replying to [comment:14 hellik]:
> but I'm lost at the moment by invoking ''install_run_gmkfontcap.cmd'' by
the NSIS-installer (Line 443 - 444 in
https://trac.osgeo.org/grass/attachment/ticket/908/install_run_gmkfontcap.g65.patch)
and getting writing permission in c:\Program Files\.
>
> any suggestions?
>
> Helmut

the added patch for the NSIS-installer-script is now working, that means
g.mkfontcap is now invoked by the WinGrass-installer and writes
succesfully the fontcap-file in c:\Program Files\Grass65-SVN\etc.

the only thing at the moment is, g.mkfontcap works longer (searching for
fonts) than the WinGrass-installer installs WinGrass, so after closing the
WinGrass-installer the Windows-command-box is still opened.

maybe is there a possibility to run the ''run_gmkfontcap.cmd''-script in
the background without opening Windows-command-box?

Helmut

p.s. how can I delete an old attachment in track?

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

#908: No Font Definition File, windows xp
---------------------------+------------------------------------------------
  Reporter: voncasec | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: critical | Milestone: 6.4.0
Component: Installation | Version: svn-releasebranch64
Resolution: | Keywords: v.label.sa, g.mkfontcap, wingrass
  Platform: MSWindows XP | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by glynn):

Replying to [comment:15 hellik]:

> the only thing at the moment is, g.mkfontcap works longer (searching for
fonts) than the WinGrass-installer installs WinGrass, so after closing the
WinGrass-installer the Windows-command-box is still opened.
>
> maybe is there a possibility to run the ''run_gmkfontcap.cmd''-script in
the background without opening Windows-command-box?

It depends upon what's opening the console Window. If it's NSIS, there
might be an option within NSIS to do it. Otherwise, "`start /b ...`" might
work.

> p.s. how can I delete an old attachment in track?

I don't think that you can, although you can replace an attachment with an
updated version.

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

#908: No Font Definition File, windows xp
---------------------------+------------------------------------------------
  Reporter: voncasec | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: critical | Milestone: 6.4.0
Component: Installation | Version: svn-releasebranch64
Resolution: | Keywords: v.label.sa, g.mkfontcap, wingrass
  Platform: MSWindows XP | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by hellik):

Replying to [comment:16 glynn]:
> Replying to [comment:15 hellik]:
>
> > the only thing at the moment is, g.mkfontcap works longer (searching
for fonts) than the WinGrass-installer installs WinGrass, so after closing
the WinGrass-installer the Windows-command-box is still opened.
> >
> > maybe is there a possibility to run the ''run_gmkfontcap.cmd''-script
in the background without opening Windows-command-box?
>
> It depends upon what's opening the console Window. If it's NSIS, there
might be an option within NSIS to do it. Otherwise, "`start /b ...`" might
work.
>

there would be an option with a second bat starting run_gmkfontcap.bat
minimized:

{{{
@echo off
rem
#########################################################################
rem #run run_gmkfontcap.bat minimized
rem
#########################################################################
start /MIN "C:\Program Files\GRASS-65-SVN\etc\run_gmkfontcap.bat"
exit
}}}

I've tried this by invoking the above script by the installer, a minimized
console is started, but ''run_gmkfontcap.bat'' isn't running/started.

''run_gmkfontcap.bat'' itself invoked by the installer is working.

I couldn't find anything on NSIS-side.

Helmut

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