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

Markus Neteler neteler at itc.it
Thu Jul 26 17:48:56 EDT 2007


On Thu, Jul 26, 2007 at 10:14:08PM +0100, Glynn Clements wrote:
> Markus Neteler wrote:
...
> > Ah, found it through re-debugging!
> > 
> > static void read_freetype_fonts(int verbose)
> > {
> >         char **list;
> >         int count;
> >         int i;
> >     
> >         R__open_quiet();
> >         if (R_open_driver() != 0)
> >                 return;
> > 
> > If the GRASS monitor isn't open, it silently exits at R_open_driver().
> > Maybe it should say that a monitor must be open (would be nice of course
> > to get it working also without monitor, but probably not possible?).
> 
> Not possible.
> 
> As part of the recent font changes (merging the handling of stroke and
> freetype fonts), listing of fonts was moved from the client to the
> driver. This means that you don't need fontcap-parsing code in both
> the client and the driver; it also allows for the possibility of
> driver-specific handling (e.g. the PS driver allowing the use of
> PostScript fonts).
> 
> The use of R__open_quiet() is presumably a remnant of the time when
> d.font parsed the freetypecap file itself. It should just be removed,
> so that R_open_driver() generates warnings if no monitor is selected
> or running.

OK, I have removed the R__open_quiet() call in CVS, now it works as
expected from your explanations:

GRASS 6.3.cvs (nc_spm_05):~ > d.font -l
WARNING: No socket to connect to for monitor <x0>.

GRASS 6.3.cvs (nc_spm_05):~ > d.font -L
WARNING: No socket to connect to for monitor <x0>.

GRASS 6.3.cvs (nc_spm_05):~ > d.mon x0
using default visual which is TrueColor
ncolors: 16777216
Graphics driver [x0] started

GRASS 6.3.cvs (nc_spm_05):~ > d.font -l
cyrilc
gothgbt
...
umeplus-p-gothic
b018015l
...
z003034l
z003034l
a010013l
a010013l
a010033l
...


GRASS 6.3.cvs (nc_spm_05):~> d.font -L
cyrilc|cyrilc|0|/home/neteler/grass63/dist.x86_64-unknown-linux-gnu/fonts/cyrilc.hmp|0|utf-8|
gothgbt|gothgbt|0|/home/neteler/grass63/dist.x86_64-unknown-linux-gnu/fonts/gothgbt.hmp|0|utf-8|
...
a_d_mono|A.D. MONO Regular|1|/usr/share/fonts/ttf/western/a_d_mono.ttf|0|utf-8|
actionis|ActionIs Regular|1|/usr/share/fonts/ttf/decoratives/actionis.ttf|0|utf-8|
Adventure|Adventure Normal|1|/usr/share/fonts/ttf/western/Adventure.ttf|0|utf-8|
uming|AR PL ShanHeiSun Uni Regular|1|/usr/share/fonts/TTF/chinese/uming.ttf|0|utf-8|
ukai|AR PL ZenKai Uni Medium|1|/usr/share/fonts/TTF/chinese/ukai.ttf|0|utf-8|


This should include the updates from Paul today.

Ehm, would it be possible to sort the output (sorry for bothering)?
Generally, it is really nice to have this improved font infrastructure!

Now some tests:

# randomly grab a font
d.font actionis
echo "GRASS is green" | d.text

# PNG
d.out.file map form=png res=4
display map.png
# ... works nicely

# EPS
d.out.file map form=eps res=4
gv map.eps
 ERROR: /unknownerror in --imagemask--ESP Ghostscript 815.03: Unrecoverable error, exit code 1
 Operand stack:
 Execution stack:
    %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1   3   %oparray_pop   1   3   %oparray_pop   --nostringval--   1   3   %oparray_pop   1   3   %oparray_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   5   3   %oparray_pop
 Dictionary stack:
   --dict:1123/1686(ro)(G)--   --dict:0/20(G)--   --dict:132/200(L)--
 Current allocation mode is local
 Last OS error: 2
 Current file position is 4341

# PS
d.out.file map form=ps res=4
gv map.ps
# ... works, but it's an image, not vector (you will know that)

I tried the latter since you mentioned "the PS driver allowing the use of
PostScript fonts" - maybe that's yet future, I am not fully up to date
here.


Markus




More information about the grass-dev mailing list