[GRASS5] d.text2

Hi developers,

I've added unused/display/d.text2 module to display text using TrueType fonts.
Could anyone test whether this works or not?

FreeType2 library is required and libgiconv or libiconv is optionally
required to support unicode.

Regards,
Huidae Cho

On Thu, Aug 09, 2001 at 10:03:19AM +0900, GRASS wrote:

Hi developers,

I've added unused/display/d.text2 module to display text using TrueType fonts.
Could anyone test whether this works or not?

FreeType2 library is required and libgiconv or libiconv is optionally
required to support unicode.

After making a few changes:

  1. s/<giconv.h>/<iconv.h>
  2. Comment out CHARSET handling [*]
  3. Edit hardcoded default font path to one I have...
  4. Edit Gmakefile, remove -lgiconv
        -- Note, apparently "iconv" is built into GNU libc these days.
     I think this is a recent change.

  Runs to completion, but there's nothing on the monitor ;( Tried with
  color "red" and default, and size=100 and default.

  I uncommented the debugging glyph.width/height printf() call, and see
  it is translating the characters. So, maybe a problem with the color?

  I didn't do a full rebuild of GRASS sources (using that april_...
  tag), so maybe I missed some important change?

* I tried both "en_US" and "8859-1" (not sure what is correct)
   When building, got a warning for wrong pointer type for arg2 to
   iconv.

I think it is a worthy endeavor. I'm not clear on how X4 handles fonts
these days, but I get the impression that it might be possibly to just
use truetype fonts directly without needing explicit linkage to
freetype. I think the monitor code would have to change for this to
work though (it could do the work on it's end for making appropriate X
calls -- then we could ditch those hershey fonts).

--
Eric G. Miller <egm2@jps.net>

From: "Eric G. Miller" <egm2@jps.net>

On Thu, Aug 09, 2001 at 10:03:19AM +0900, GRASS wrote:
> Hi developers,
>
> I've added unused/display/d.text2 module to display text using TrueType fonts.
> Could anyone test whether this works or not?
>
> FreeType2 library is required and libgiconv or libiconv is optionally
> required to support unicode.

After making a few changes:

  1. s/<giconv.h>/<iconv.h>
  2. Comment out CHARSET handling [*]
  3. Edit hardcoded default font path to one I have...
  4. Edit Gmakefile, remove -lgiconv
        -- Note, apparently "iconv" is built into GNU libc these days.
     I think this is a recent change.

  Runs to completion, but there's nothing on the monitor ;( Tried with
  color "red" and default, and size=100 and default.

  I uncommented the debugging glyph.width/height printf() call, and see
  it is translating the characters. So, maybe a problem with the color?

  I didn't do a full rebuild of GRASS sources (using that april_...
  tag), so maybe I missed some important change?

Oops!

Yes, you should rebuild src/display/devices/lib and
src/display/devices/XDRIVER/XDRIVER24. This change helps us selecting color
index.

* I tried both "en_US" and "8859-1" (not sure what is correct)
   When building, got a warning for wrong pointer type for arg2 to
   iconv.

I think it is a worthy endeavor. I'm not clear on how X4 handles fonts
these days, but I get the impression that it might be possibly to just
use truetype fonts directly without needing explicit linkage to
freetype. I think the monitor code would have to change for this to
work though (it could do the work on it's end for making appropriate X
calls -- then we could ditch those hershey fonts).

Hmm, at this time, I'm using XFree86 3.x. :slight_smile:

Yours,
Huidae Cho

Eric G. Miller wrote:

I think it is a worthy endeavor. I'm not clear on how X4 handles fonts
these days, but I get the impression that it might be possibly to just
use truetype fonts directly without needing explicit linkage to
freetype.

I think the monitor code would have to change for this to
work though (it could do the work on it's end for making appropriate X
calls -- then we could ditch those hershey fonts).

Recent versions of XFree86 support TrueType fonts directly. Older
versions can use a font server which supports TrueType fonts (xfstt,
xfsft).

However, this approach would only work for XDRIVER; the CELL and PNG
drivers would still need to link against the freetype library. Also, X
only supports bitmap (1-bpp) fonts, whereas using freetype directly
would allow anti-aliasing.

I certainly wouldn't recommend adding TrueType support to the monitors
for 5.0; better to have a separate application which uses the
monitor's existing raster operations.

--
Glynn Clements <glynn.clements@virgin.net>