[GRASS-dev] Problem with font selection in gis.m on Windows
Paul Kelly
paul-grass at stjohnspoint.co.uk
Sun May 6 00:05:46 EDT 2007
uname will generally be available if Init.sh works, but Init.sh only
runs in Msys on Windows - true native Windows GRASS doesn't require Msys
for running (only compiling) and won't have Unix commands like uname
available at run-time. We have an alternative Windows batch file,
init.bat, that can be used to start native Windows GRASS and avoids the
need to have a shell interpreter and run Init.sh.
Usually I did platform checking in Tcl by looking for environment
variables that were platform-specific, e.g. something like:
if {[info exists env(OS)] && $env(OS) == "Windows_NT"}
but I see in the new d.rast.edit Glynn has used some kind of Tcl variable
which looks like an even neater way of doing it:
if {$tcl_platform(platform) == "windows"}
But I agree it's best to wait to see how the font support settles down
before we decide how best to fix this.
On Sat, 5 May 2007, Michael Barton wrote:
> I lifted this from Init.sh, where it checks for things like Mingw and
> Cygwin, so I thought it would work with windows. If it doesn't, I guess it's
> pointless to have it in Init.sh too.
>
> As the current font selection is done, I need to know if a Mac, Windows, or
> other system is running to know where to look for fonts. If uname doesn't
> work on Windows, I don't know how to find this out.
>
> If there is no other solution, I'll try to implement an alternate kind of
> dialog, using a listbox and the new and improved freetypecap file, like I've
> done for the wxPython GUI.
>
> Michael
>
>
> On 5/4/07 9:06 AM, "Paul Kelly" <paul-grass at stjohnspoint.co.uk> wrote:
>
>> The recent talk of fonts on this list brought me to try out some stuff on
>> Windows. I discovered there's a font selector control in gis.m (Config
>> Menu-->Set default display font) but if I click the button to try and
>> change it to anything other than Romans I get the following error:
>>
>> couldn't execute "uname": no such file or directory
>> couldn't execute "uname": no such file or directory
>> while executing
>> "exec uname -s"
>> (procedure "Gm::SelectFont" line 7)
>> invoked from within
>> "Gm::SelectFont"
>> ("uplevel" body line 1)
>> invoked from within
>> "uplevel \#0 $cmd"
>> (procedure "Button::_release" line 18)
>> invoked from within
>> "Button::_release .dispfont.fontopt2.b"
>> (command bound to event)
>>
>> Obviously trying to use the "uname" command (not available on native
>> Windows) is the bug, but looking closer at the code (line 537 onwards in
>> gui/tcltk/gis.m/gm.tcl) it seems the relevant part is trying to put
>> together directories to search for Freetype fonts in? Which
>> (a) shouldn't even be needed here as I have the stroke font radio button
>> in the dialog selected and don't even have GRASS compiled with Freetype
>> support and
>> (b) might possibly be being made redundant by Glynn's new script to
>> populate $GISBASE/etc/freetypecap?
>>
>> Not sure what's the best way to fix this, taking into account those
>> points.
>>
>> Paul
>>
>>
>
> __________________________________________
> Michael Barton, Professor of Anthropology
> School of Human Evolution & Social Change
> Center for Social Dynamics & Complexity
> Arizona State University
>
> phone: 480-965-6213
> fax: 480-965-7671
> www: http://www.public.asu.edu/~cmbarton
>
>
>
More information about the grass-dev
mailing list