Opened 14 years ago

Closed 14 years ago

#908 closed defect (fixed)

No Font Definition File, windows xp

Reported by: voncasec Owned by: grass-dev@…
Priority: critical Milestone: 6.4.0
Component: Installation Version: svn-releasebranch64
Keywords: v.label.sa, g.mkfontcap, wingrass Cc:
CPU: Unspecified Platform: MSWindows XP

Description

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.

Attachments (2)

install_run_gmkfontcap.g65.patch (1.9 KB ) - added by hellik 14 years ago.
Grass65_WinInstaller_Run_Gmkfontcap.patch (2.9 KB ) - added by hellik 14 years ago.

Download all attachments as: .zip

Change History (25)

comment:1 by hamish, 14 years ago

Component: defaultInstallation
Keywords: g.mkfontcap wingrass added
Priority: normalcritical
Summary: v.label.sa - No Font Definition File, windows xpNo Font Definition File, windows xp

'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

comment:2 by hamish, 14 years ago

... 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

in reply to:  2 comment:3 by glynn, 14 years ago

Replying to 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.

in reply to:  2 ; comment:4 by hellik, 14 years ago

Replying to 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 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

in reply to:  4 comment:5 by glynn, 14 years ago

Replying to 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.

comment:6 by hamish, 14 years ago

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?

in reply to:  6 comment:7 by hellik, 14 years ago

Replying to 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

in reply to:  6 ; comment:8 by glynn, 14 years ago

Replying to 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.

in reply to:  8 ; comment:9 by glynn, 14 years ago

Replying to 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).

in reply to:  9 ; comment:10 by hellik, 14 years ago

Replying to glynn:

Replying to 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

in reply to:  10 ; comment:11 by glynn, 14 years ago

Replying to 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).

in reply to:  11 ; comment:12 by hellik, 14 years ago

Replying to glynn:

Replying to 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

in reply to:  12 ; comment:13 by hellik, 14 years ago

Replying to 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

by hellik, 14 years ago

in reply to:  13 ; comment:14 by hellik, 14 years ago

Replying to hellik:

Replying to 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

in reply to:  14 ; comment:15 by hellik, 14 years ago

Replying to 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?

in reply to:  15 ; comment:16 by glynn, 14 years ago

Replying to 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.

in reply to:  16 ; comment:17 by hellik, 14 years ago

Replying to glynn:

Replying to 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

in reply to:  17 ; comment:18 by hellik, 14 years ago

Replying to hellik:

I couldn't find anything on NSIS-side.

this seems to be the clue: with ExecWait the installer continues after run_gmkfontcap.bat has finished.

ExecWait '"$INSTALL_DIR\etc\run_gmkfontcap.bat"' 

tested locally. patch for submit to Grass65 for testing by the nightly builds?

Helmut

in reply to:  9 comment:19 by hellik, 14 years ago

Replying to glynn:

Replying to 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).

after intensive testing backported to 6.4 by r41333

in reply to:  18 ; comment:20 by hellik, 14 years ago

Replying to hellik:

Replying to hellik:

I couldn't find anything on NSIS-side.

this seems to be the clue: with ExecWait the installer continues after run_gmkfontcap.bat has finished.

ExecWait '"$INSTALL_DIR\etc\run_gmkfontcap.bat"' 

tested locally. patch for submit to Grass65 for testing by the nightly builds?

Helmut

see also https://trac.osgeo.org/grass/ticket/986

submitted to 6.4 r41333 , 6.5 r41321 , 7.0 r41329

in reply to:  20 comment:21 by hellik, 14 years ago

Replying to hellik:

Replying to hellik:

Replying to hellik:

I couldn't find anything on NSIS-side.

this seems to be the clue: with ExecWait the installer continues after run_gmkfontcap.bat has finished.

ExecWait '"$INSTALL_DIR\etc\run_gmkfontcap.bat"' 

tested locally. patch for submit to Grass65 for testing by the nightly builds?

Helmut

see also https://trac.osgeo.org/grass/ticket/986

submitted to 6.4 r41333 , 6.5 r41321 , 7.0 r41329

can this be closed now?

Helmut

comment:22 by hamish, 14 years ago

Helmut:

can this be closed now?

sure.

Config -> Prefs -> Display -> Set Font now gives you a choice of lots and lots of fonts.

Hamish

comment:23 by hamish, 14 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.