[GRASS-dev] d.font -l: please sort alphabetically

Paul Kelly paul-grass at stjohnspoint.co.uk
Tue Jul 24 16:46:30 EDT 2007


Hello Markus,

On Tue, 24 Jul 2007, Markus Neteler wrote:

> d.font -l prints out 190 fonts on my system (happy me) but they aren't
> sorted.

The list *is* sorted (see function compare_fonts() in 
general/g.mkfontcap/main.c), first by type (stroke font or 
freetype-compatible), and then by name. But it sorts case-insensitively on 
the long descriptive name (I thought this would be most logical for 
human-readable viewing), not on the short name. Unfortunately we haven't 
yet added the capability to d.font to also view the more descriptive name 
- Glynn mentioned that adding a d.font -L flag (capital L rather than 
lower-case l) might be a good idea for that. It isn't entirely simple 
though, but just needs some work. Do you think that would be enough? Or 
should we change the search to sort on the short name - case-insensitively 
perhaps? You could try that if you want and see if it gives you good 
results on your system - just change the two references to "longname" in 
that function to "name".

I'm not sure how much info the d.font -L flag should produce though - just 
the short name and long name, or the path to the file, index within the 
file etc.?

And funnily enough, just today I've been working on some tidying and 
improvements to the fontcap generation stuff. Main points being:
1) Add a text file to the lib/fonts/fonts directory to be installed into 
$GISBASE/etc/fonts, to identify a descriptive long name with each stroke 
font (actually copied from d.font man page)
2) Removed the capability from g.mkfontcap to generate an old-style 
freetypecap file, to simplify and reduce confusion
3) Adjusted "make install" to adjust the path to the stroke fonts in the 
fontcap file, when GRASS is installed to a different location on the local 
system
4) Adjusted the binary install script binaryInstall.src to run g.mkfontcap 
during the install process, to find all the fonts on the local system.

After some more local testing I should hopefully get these changes 
committed tomorrow. They don't affect the sorting of the d.font output 
though.

Paul




More information about the grass-dev mailing list