[comp.windows.x] Vector Fonts

dple@bruker.COM (david levine) (11/27/90)

To whom it may concern,

I'm interested to find out if anyone has contributed a library of
vector fonts and vector font utilities that could easily be 
incorporated into existing applications that simply make use
of Xt and X11 (not GKS). If there are such packages for sale
by any vendors that you know about, I'd be interested in hearing
about that as well.

My main interest in this area is rooted in the need to rotate text
strings. Maybe I don't need vector fonts because there is a way
to rotate bitmap fonts? (I don't know the answer)

In any event I'm looking forward for a response.

Thanks for all your valuable contributions!!!!

Dave

-- 
==================================================================

	
     ...         ...
    .    .     .    .	David Levine
    .     *   .     .	Software Engineer
     .      .      .
      .   .   .   .	Bruker Instruments Inc. USA
       . BRUKER .	Billerica, MA. 01821
      .   .   .  .
     .      .     .	
    .     *  .     .	dple@bii.bruker.com		Internet
     ...        ...     ...!{uunet,ulowell}!bii!dple	UUCP

=================================================================

etaylor@wilkins.iaims.bcm.tmc.edu (Eric Taylor) (11/28/90)

Here is a simplistic method for rotating text by
an arbitrary angle:

	First, create a bitmap B and write your
	text to it.

	Second, create an XYBitmap image I from B
	(via XGetImage).

	Third, create another XYBitmap Image I2.

	Fourth, for each x,y in I2:

	I2(x,y) = I(a,b)
		where
		a = x * cos(theta) - y * sin(theta)
		and
		b = x * sin(theta) + y * cos(theta)

	Finally, send your image to the screen.

	The dimensions of I2 should be big enough to
	handle the transformation. 
--
					Eric Taylor
					Baylor College of Medicine
					etaylor@wilkins.bmc.tmc.edu
					(713) 798-3776

lee@sq.sq.com (Liam R. E. Quin) (12/05/90)

etaylor@wilkins.iaims.bcm.tmc.edu (Eric Taylor) writes:
>Here is a simplistic method for rotating text by an arbitrary angle:
> [...]
>	I2(x,y) = I(a,b)
>		where
>		a = x * cos(theta) - y * sin(theta)
>		and
>		b = x * sin(theta) + y * cos(theta)

You will lose bits if you do this, or you will get holes in the result,
depending on how you implement it.

Instead, it is usually better (and much faster!) to use shear transformations.
See any graphics text book -- I won't try and explain, since graphics isn't
my field (moo).

Rob Pike's paper on Bitblt also explains how to use bit-blit() to rotate
an image, but I consider this to be a trifle arcane, and I am not sure that
it will work for angles other than multiples of 90 degrees.

Lee

-- 
Liam R. E. Quin,  lee@sq.com, SoftQuad Inc., Toronto, +1 (416) 963-8337

sfleming@cs.hw.ac.uk (Stewart T. Fleming) (12/08/90)

In article <1990Dec4.233145.6208@sq.sq.com>, lee@sq.sq.com (Liam R. E. Quin) writes:
|> etaylor@wilkins.iaims.bcm.tmc.edu (Eric Taylor) writes:
|> >Here is a simplistic method for rotating text by an arbitrary angle:
|> > [...]
|> >	I2(x,y) = I(a,b)
|> >		where
|> >		a = x * cos(theta) - y * sin(theta)
|> >		and
|> >		b = x * sin(theta) + y * cos(theta)
|> 
|> You will lose bits if you do this, or you will get holes in the result,
|> depending on how you implement it.
|> 

This is an FAQ in comp.graphics; the recommendation there is to apply the
inverse transformation ie create the destination bitmap and for each pixel apply
the inverse rotation transform to get a pixel in the original bitmap and use that.
For more details, see comp.graphics...

|> Liam R. E. Quin,  lee@sq.com, SoftQuad Inc., Toronto, +1 (416) 963-8337

STF
-- 

sfleming@uk.ac.hw.cs or sfleming@cs.hw.ac.uk or ...ukc!cs.hw.ac.uk!sfleming
"Jedi programmers do it with byte sabres."