gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Printing glyphs (Was: GNUstep 0.8.5 pre-release)


From: Alexander Malmberg
Subject: Re: Printing glyphs (Was: GNUstep 0.8.5 pre-release)
Date: Sat, 08 Feb 2003 21:51:11 +0100

Adam Fedor wrote:
> 
> On Friday, February 7, 2003, at 07:21 PM, Alexander Malmberg wrote:
[snip]
> > Just a quick note about this: I've looked a bit at it, and it seems to
> > me that the backend supplying the fonts (eg. -xlib or -art) and the
> > printing "backend" (GSStreamContext) are going to have to talk a lot
> > with each other while printing. 'glyphshow' should be able to handle
> > this, and I know I can get back-art to provide postscript font and
> > glyph
> > names (for printable fonts, anyway).
> 
> Yes. The part I'm stuck on is how to get glyph names. Can you tell me
> how to do that in back-art at least?

back-art adds a few extensions to NSFont.

[NSFont -(NSString *) nameOfGlyph: (NSGlyph)g] will return the
postscript name of a glyph (most of the time). However, I've just
committed a method better suited for printing:

[GSFontInfo -(const char *) nameOfGlyph: (NSGlyph)g] will return the
postscript name of a glyph, or ".notdef". The returned name is in a
static buffer that will be overwritten on the next call.

I've attached a simple patch for GSStreamContext. It tracks the latest
font set and uses -nameOfGlyph: to implement GSShowGlyphs. Seems to work
fairly well:

http://w1.423.telia.com/~u42308495/alex/TextSystem12.ps
(http://w1.423.telia.com/~u42308495/alex/TextSystem12.png)

However, it is inefficient, and the code to track the most recent font
won't work if states are saved and restored.

> glyphshow is a good start, although it will probably be more efficient
> eventually to just make a new encoding vector for the font.

- Alexander Malmberg




reply via email to

[Prev in Thread] Current Thread [Next in Thread]