[GRASS5] grass font
Glynn Clements
glynn.clements at virgin.net
Fri Jun 15 11:07:43 EDT 2001
Radim Blazek wrote:
> I thing that the simplest solution for grass5.0.x, which should not bring new
> bugs, would be conversion utility from other font formats (Type1, ..) to
> Hershey Fonts format. Unfortunately I could not find such utility on the Web.
> Anybody knows about such conversion program or why conversion to Hershey
> fonts is impossible?
There are three basic types of fonts: stroked, outline and bitmap.
GRASS fonts are stroked fonts; these correspond to the way in which
you write with a pen on paper.
PostScript and TrueType fonts are (usually) outline fonts; you could
convert these to stroked fonts, but the end result would be "hollow"
characters. Feed the following into ghostscript for an example:
(Helvetica) findfont 72 scalefont setfont
newpath 72 72 moveto
(ABC) false charpath stroke
showpage
BDF fonts are bitmap fonts; you can't reasonably convert these to
either stroked or outline fonts.
> 2. Long term solution
> Let us define requirements first. I'll try to start:
>
> - Labels (texts in map) must be identical (realy identical - the same font
> fonts with the same metrics) in:
> - XDRIVER
> - CELL, PNG, (and similar) drivers
> - Postscript files created by ps.map
> - all new possible clients/viewers: java, windows (not CygWin+Xfree)
> Is it possible to display (effectively) exactly the same fonts on many
> platforms? Probably not. Where could we learn from - Acrobat , Ghostscript?)
You can display a font on any platform, if you can obtain the font
definition; the main issue here is copyright. Otherwise, you have to
limit yourself to fonts which you know will exist on any platform;
unfortunately this probably limits you to Helvetica, Times and
Courier. Users of languages which use encodings other than ISO-8859-1
are out of luck; many systems won't have any fonts for non-European
languages.
> - System fonts in some standard format should be used. Fonts should not be
> distributed in grass package.
>
> - Vector fonts should be used.
>
> Please add new requrements and send your criticism. I am not fonts expert.
>
> Glynn, is it solution for fonts so closely tied to new display architecture
> or may be this task separated?
Font handling will be a major factor in determining any new display
architecture.
At present, potential architectures can be split into two categories:
1. Generate PostScript; all drivers (apart from one for a PostScript
printer) would use ghostscript to do most of the work.
2. Do everything ourselves.
Option 1 saves us a lot of work, but also imposes some restrictions.
Option 2 is much more work (to do it right), but doesn't impose any
restrictions.
One of the advantages of using PostScript is that it provides a lot of
desirable features "for free", e.g. affine transformations and
(decent) text rendering. However, internationalisation issues may
determine whether its text rendering is suitable; if it isn't, and we
have to implement our own text renderer, this eliminates one of the
biggest advantages of using it.
--
Glynn Clements <glynn.clements at virgin.net>
More information about the grass-dev
mailing list