[GRASS-dev] GRASS/KerGIS fonts: hershey revival

Hello,

This is a subject I think both GRASS GPL and KerGIS could share.

Indeed, actually I need (and I play) with the concept of a library
of symbols to show graphically what some (vector) geometrical point
nature is---to display a symbol on a geometrical point (say an
electrical symbol if the site is electricity related, a lamppost and so
on).

The classical (and logical) way to do it is using a library of
individual graphical groups. That is a font with special glyphs. Since
the DRAWLIB (is RASTERLIB in GRASS GPL) already knows how to color,
rotate and scale glyphes everything is potentially here.

As an example, I work on generating a "font" (library of symbols) when
importing DXF (the BLOCKS) and assigning a group (KerGIS name; is/was
cat in GRASS) to the point where the BLOCK is placed.

So I needed to understand how fontes were handled.

Since the hershey's fonts are _vectorial_ (this is great by itself).
Since vectorial is straightforward to translate in postscript, a way to
describe the elements, to compile the font from a description (the
current one will be extended to a pseudo Vectorial Font Description---
there is BDF for bitmap from Adobe/X Consortium so you get the idea)
and to be able to handle it was needed.

This will indeed replace the old icons stuff in KerGIS.

I have studied the fonts handling and I have (already) fix some errors
(in spacing [see the image on the kergis website], in the sparse index
etc.), extended the binary format
(that was lacking some informations), suppressed the ad hoc ASCII
shifts so that the used fonts have glyphes corresponding to latin1
code (no, there are no accented letters; but should not be difficult
to generate à la TeX virtual font) and I have already resurrected
or modified programs to see what's going on.

The good news: I have put all the representations of the glyphs in a
directory on the http://www.kergis.com/ server---the two thousands less
or more! I have used a program found in the sources and that display
them on the... console (and I like to know the original author; the
only mention, in a file in the same directory, is "jim_stuff"; I think
this is James Westervelt, but I'm unsure, and I'd like to give proper
credit to the original author; if someone knows, please tell!).

But since I'm already able to select, compile and extract, I have put
an X image (generated in KerGIS with the xdriver and DRAWLIB commands)
on some glyphs that are there (just go to http://www.kergis.com/ the
image is in the news section, at the beginning).

And wow! This is great.

I think that GRASS GPL would benefit too from having a standalone set
of fonts with Kanji, Hiragana and Katakana and more, not depending
upon external sets (and there is the possibility to have something
really good: everything is potentially here including ligatures,
mathematical symbols [could do TeX in part]).

What has to be done, is to map the glyph number in the occidental and
oriental sets to some well-known encoding. That's where the GPL GRASS
user base, specially for the oriental set, could help.

This means visualizing the glyphes images (found in
http://www.kergis.com/fonts/hershey/\{oc,or\}/\) and mapping them.

The two files:

http://www.kergis.com/fonts/hershey/oc/hershey_oc.txt
http://www.kergis.com/fonts/hershey/or/hershey_or.txt

give the ranges of the glyph (meaning that the consecutive ranges are
a distinct subset: start by identifying a subset. First what language,
mapping to a standard encoding, and finding the canonical size and
type of the font).

The two vertical bars are the left margin and the right margin (there
can be some glyphs that extend outside the margins): there are not
part of the glyph drawing by itself but give its position relative to
the previous and the next.

I have already modified the binary format of the fonts (and the KerGIS
DRAWLIB) and will extend it further. But once this is done, GRASS could
use it (BSD and GPL are compatible). And, since I'm the only developer
on this part, if you really mind about the licence, I could give you
a GPL version...

Am I the only one to feel like a marvelling child discovering treasures
in the CERL code?

Cheers,
--
Thierry Laronde (Alceste) <tlaronde +AT+ polynum +dot+ com>
                 http://www.kergis.com/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89 250D 52B1 AE95 6006 F40C

Hi,

it's not my area (I'm troll), but if I understand correctly - You are refering
to diferent symbols drawn on map (display).
Using fonts to show various symbols is easyest and common used trick (look ar
ArcView), but it has drawbacks - user has to create new font to get own
symbols for displaying and that's not good. In ArcView I also have run into
different problems coming from font usage as symbol.
Having all code already in GRASS is good, but I would better see as GRASS 7
wish SVG vector symbol support. QGIS already to that way - You can draw image
in any vector image manipulation soft (Inkscape, CorelDraw etc.) and just
show in right place. Size, rotation is not a problem.
Pros: Scalable :wink: , color, easy to add own symbols.
Cons: adds another dependency for GRASS.

Just my 0.02,
Maris.

On Tuesday 31 October 2006 03:21, tlaronde@polynum.com wrote:

This is a subject I think both GRASS GPL and KerGIS could share.

Indeed, actually I need (and I play) with the concept of a library
of symbols to show graphically what some (vector) geometrical point
nature is---to display a symbol on a geometrical point (say an
electrical symbol if the site is electricity related, a lamppost and so
on).

The classical (and logical) way to do it is using a library of
individual graphical groups. That is a font with special glyphs. Since
the DRAWLIB (is RASTERLIB in GRASS GPL) already knows how to color,
rotate and scale glyphes everything is potentially here.

Hello,

On Tue, Oct 31, 2006 at 10:49:20AM +0200, M?ris Narti?s wrote:

Using fonts to show various symbols is easyest and common used trick (look ar
ArcView), but it has drawbacks - user has to create new font to get own
symbols for displaying and that's not good. In ArcView I also have run into
different problems coming from font usage as symbol.
Having all code already in GRASS is good, but I would better see as GRASS 7
wish SVG vector symbol support. QGIS already to that way - You can draw image
in any vector image manipulation soft (Inkscape, CorelDraw etc.) and just
show in right place. Size, rotation is not a problem.
Pros: Scalable :wink: , color, easy to add own symbols.
Cons: adds another dependency for GRASS.

But you have already programs in CERL GRASS based GIS to draw "icons"
(legacy and postscript). They can just be changed to generate symbols
in the description format used for the fonts---or, as I'm doing at the
moment, generate them with v.in.* (here v.in.dxf); could have v.in.svg
(v.in.metapost... since I do use it too), etc.

Cheers,
--
Thierry Laronde (Alceste) <tlaronde +AT+ polynum +dot+ com>
                 http://www.kergis.com/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89 250D 52B1 AE95 6006 F40C

M?ris Narti?s wrote:
> Using fonts to show various symbols is easyest and common used trick
> (look ar ArcView), but it has drawbacks - user has to create new
> font to get own symbols for displaying and that's not good. In
> ArcView I also have run into different problems coming from font
> usage as symbol. Having all code already in GRASS is good, but I
> would better see as GRASS 7 wish SVG vector symbol support. QGIS
> already to that way - You can draw image in any vector image
> manipulation soft (Inkscape, CorelDraw etc.) and just show in right
> place. Size, rotation is not a problem. Pros: Scalable :wink: , color,
> easy to add own symbols. Cons: adds another dependency for GRASS.

tlaronde wrote:

But you have already programs in CERL GRASS based GIS to draw "icons"
(legacy and postscript). They can just be changed to generate symbols
in the description format used for the fonts---or, as I'm doing at the
moment, generate them with v.in.* (here v.in.dxf); could have v.in.svg
(v.in.metapost... since I do use it too), etc.

In grass 6.2 check out the d.graph symbol command. There is scale and
rotate infrastructure there, although rotate isn't fully implimented.

d.vect and ps.map can also use these symbols, and ps.map does support
simple .eps icons as well (incl. rotation).

see D_symbol() and http://grass.gdf-hannover.de/wiki/IconSymbols

There is no .eps, .svg -> d.graph or symbol converter, but it would be
really great (and probably not that hard) for someone to write one. It's
been a long standing wish.

regards,
Hamish

On Tue, Oct 31, 2006 at 02:21:32AM +0100, tlaronde@polynum.com wrote:

What has to be done, is to map the glyph number in the occidental and
oriental sets to some well-known encoding. That's where the GPL GRASS
user base, specially for the oriental set, could help.

Never mind. As usual, due to the lack of interest of others, I have
found a way to do the mapping by myself even if I do no nothing about
Kanji etc... Unicode.org has pdf with the glyphes representation and
their unicode.
--
Thierry Laronde (Alceste) <tlaronde +AT+ polynum +dot+ com>
                 http://www.kergis.com/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89 250D 52B1 AE95 6006 F40C

Sorry Thierry. Everyone was working overtime to get GRASS 6.2 out the door.

Michael
__________________________________________
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

From: <tlaronde@polynum.com>
Date: Thu, 2 Nov 2006 14:35:41 +0100
To: grass developers list <grass-dev@grass.itc.it>
Subject: Re: [GRASS-dev] GRASS/KerGIS fonts: hershey revival

On Tue, Oct 31, 2006 at 02:21:32AM +0100, tlaronde@polynum.com wrote:

What has to be done, is to map the glyph number in the occidental and
oriental sets to some well-known encoding. That's where the GPL GRASS
user base, specially for the oriental set, could help.

Never mind. As usual, due to the lack of interest of others, I have
found a way to do the mapping by myself even if I do no nothing about
Kanji etc... Unicode.org has pdf with the glyphes representation and
their unicode.
--
Thierry Laronde (Alceste) <tlaronde +AT+ polynum +dot+ com>
                 http://www.kergis.com/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89 250D 52B1 AE95 6006 F40C