[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decwindows

Title:DECWINDOWS
Notice:DECwindows Motif V1.2-4 SSB kits: note 5519
Moderator:GRIM::MESSENGER
Created:Wed Nov 28 1990
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:5861
Total number of notes:24081

5765.0. "draw text that is rotated" by HYDRA::SCHAFER (Mark Schafer, SPE MRO) Thu Jan 30 1997 17:20

Can you rotate text?
    
    Mark Schafer
    SPE MRO
    297-3524
>> 
>> My programmers need to know how to draw text (using XLIB) that is
>> rotated.  They want to draw text strings from bottom-to-to-top,
>> top-to-bottom and right-to-left.  Currently, text strings can only be
>> drawn from left-to-right.
>> 
>> The font data structure shows a direction hint and there are four
>> defined values for it (left-to-right, right-to-left, top-to-bottom,
>> bottom-to-top).  It appears, however, that there is no way to load the
>> font data structure with the desired value for the direction (in the
>> proper location of course!) and then pass this data to the server.  The
>> font data structure seems to only be an "FYI" for the application
>> program  and cannot be modified and sent back to the server.
>> 
>> We are using XLIB calls to draw the text (x$draw_text) and the sopurce
>> language is FORTRAN.  The operating system is OpenVMS version 6.2 (and
>> greater).  Please let us know what we can do to rotate text to 90 degree
>> angles (or other angles if possible).
>> 
>> Another question:  Are larger fonts available (larger than 24 points)?
>> If so, where can we get them?  Or, can the server increase the font size
>> of a given font to arbitrary values or to integer multiples of some base
>> value?  Please let me know what is possible and where we can find the
>> associated documentation.  Thanks!
>> 
>> Dr. Steve G. Belovich
>> Vice President of Engineering
>> 
>> BV Technologies Inc.
>> 
>> e-mail: [email protected]
>> phone:  (216) 267-1881 x211
>> fax:    (216) 267-1880
>
>
T.RTitleUserPersonal
Name
DateLines
5765.1HYDRA::SCHAFERMark Schafer, SPE MROMon Feb 03 1997 11:0938
To: [email protected] ([email protected])
From: [email protected] (Dr. Steve G. Belovich (BV Technologies))
Subject: Re: X-Windows, XLIB draw text

Mark -

Thanks for the reply.  I need a solution that uses standard XLIB calls, such
as x$draw_text.  I can play with the font data structure and other items but
that's about it.  Postscript will not work.  

The application is for a  real-time plotting/graphing program.  It's
object-oriented code which must obey several rules.  I use simple XLIB calls
for compatibility and portability.  It would be kinda weird to have to
generate a postscipt file and then send it out over the network (it would
also lose performance).  There must be some way to handle this!

The option I'm trying to avoid is to "hand manipulate" the characters by
writing a character, changing the x-y coordinates and then writing another
character, etc.

If you find anything, please let me know.  Thanks.

Steve


Dr. Steve G. Belovich
Vice President

BV Technologies, Inc.
5310 W. 161st St.  Suite H
Brook Park, OH  44142-1610

E-mail:      [email protected]
Voice:       (216) 267-1881 x211
FAX:        (216) 267-1880
Home:       (216) 278-2665

5765.2draw to a pixmap/getpixel/rotate points/drawpointsCADSYS::CADSYS::LADEROUTETue Feb 04 1997 09:3512
    One method that could be imployed is to do the x$draw_text to a
    temporary Pixmap, then do an XGetImage so that you can do XGetPixel for
    the image to get all the points. You can store the points in a buffer
    and then rotate each point in the buffer. Once this is done you can
    then make a call to XDrawPoints().
    
    This was done for a piece of software we have in the CAD group by 
    Ed Burdick and works rather well.
    
    James Laderoute
    Digital Semiconductor
    CAD
5765.3STAR::KLEINSORGEFrederick KleinsorgeWed Feb 05 1997 09:0725
    
    Gosh, I use UISX which makes XLIB calls, and which can perform text
    rotation, path rotation, scaling, and shearing.  I argued loud and long
    with the X11 folks during X11R1 Beta that they needed graphics text. 
    
    In any case, you either need a graphics text extension to perform the
    function (it's amazing that we have scaled fonts, but necer got true
    graphics text), or you need to do it at the application level.
    
    The way UISX does it is to draw each character to a pixmap, and read
    each pixmap to build a local font structure in the client application
    space.  For "normal" text it then simply uses the normal X11 text
    commands, and for "graphics" text, it uses the character images and the
    put image operation.  It rotates, shears, etc, the character images on
    the fly into a local image buffer, and does the appropriate put image.
    
    The performance isn't too bad once the characters in the font are read
    and the font structure created.
    
    An alternative is to use a stroke font, i.e. text is actually a series
    of lines that are drawn by the application, the points in the line can
    be rotated, and permuted as needed.  Of course, again, this is custom
    work unless you are using a graphics library like PHIGS or GKS.
    
    
5765.4GERUND::WOLFEI'm going to huff, and puff, and blow your house downWed Feb 12 1997 23:3217
Display Postscript is another standard way to handle this. It's 
not clear from .1 that the customer understood this option. I'm basing 
this on:

>It would be kinda weird to have to generate a postscipt file and then send it
>out over the network (it would also lose performance). 

One of the biggest drawbacks of any DPS solution is that it to be supported
on the Xserver. That means you can kiss Xterminals goodbye and also
PCs with Xserver software - so it definitely limits your application's
availability. However, if it is available in his environment it's a LOT
easier that a do-it-yourself client side solution. DPS also scales
fonts very nicely (from PS outlines). 

			Pete


5765.5font transformations in Alpha VMS v7.1DECWIN::STEFANELLIGreat googaly moogalyThu Feb 13 1997 09:0625
The X11/R6 server (shipped with v7.1 of Alpha VMS) supports transformations
of the scalable fonts it supports.  To find what scalable font are
available use xlsfonts and pass it "*-0-*" as the font name.

The transformation is define by specifying the values for the
transformation matrix you want to use as part of the font name.
You can either replace the pixel size or point size fields.  The
syntax would look like:

	-bitstream-courier-medium-r-normal--[a b c d]-*-*-*-m-*-iso8859-1

where [a b c d] (brackets are required) are entries in the matrix

	a  b  0
	c  d  0
        0  0  1

So, passing [50 0 0 50] would give you a 50 pixel high font.
The values can be floating point.  They can also be negative, but
you need to use ~ instead of - for the minus sign.

Be careful about sending valid values.  The server doesn't seem to
appreciate 0 height fonts.

Doug
5765.6HYDRA::SCHAFERMark Schafer, SPE MROThu Feb 13 1997 10:3210
    I appreciate the discussion.  I frankly have not thought much about the
    implications of X11/R6 coming to VMS.  I think he's happy with the
    suggestion from HLO.  I agree that he didn't understand what DPS was
    when I asked him.
    
    Thanks,
    
    Mark Schafer
    SPE MRO
    297-3524
5765.7HYDRA::SCHAFERMark Schafer, SPE MROFri Feb 14 1997 10:1877
Of course, I don't deserve the credit he's giving me.  :-)  -Mark
    
From:	SMTP%"[email protected]" 14-FEB-1997 10:06:44.95
To:	[email protected] (Alpha Developer support)
CC:	
Subj:	Re: I: X-Windows, XLIB draw text

Return-Path: [email protected]
Received: by asimov.mro.dec.com (UCX V4.1-12, OpenVMS V6.2 VAX);
	Fri, 14 Feb 1997 10:06:39 -0500
Received: from multiverse.com by mail13.digital.com (8.7.5/UNX 1.5/1.0/WV)
	id JAA26359; Fri, 14 Feb 1997 09:58:17 -0500 (EST)
Received: from .multiverse.com (ts2-170.clv.multiverse.net [207.170.129.170]) by multiverse.com (8.8.5/8.8.5/Gissy/dilbert1.1) with SMTP id JAA20130 for <[email protected]>; Fri, 14 Feb 1997 09:57:25 -0500 (EST)
Date: Fri, 14 Feb 1997 09:57:25 -0500 (EST)
Message-Id: <[email protected]>
X-Sender: [email protected]
X-Mailer: Windows Eudora Version 1.4.4
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
To: [email protected] (Alpha Developer support)
From: [email protected] (Dr. Steve G. Belovich (BV Technologies))
Subject: Re: I: X-Windows, XLIB draw text

Hey Mark -

Thanks much for the info on the new X server.  Which version of Open VMS
supports this?  I have v6.2 and our newer machines have 7.0 (I think - I'll
have to check).  If this works, It'll allow bigger text which is always a plus.

Our BVC ToolSet software is becoming very popular because we support all
kinds of serial graphics (RS232) legacy terminals; e.g., ReGIS, Tektronix,
etc. as well as X-Windows and NT workstations.  Supporting both
simultaneously and in a completely transparent manner has been a real
challenge.  We've got it so that all displays, menus, etc. built on one
terminal appear fine on other terminals and inherit the the capabilities of
the more advanced terminal.  This translation is done on-the-fly without any
intervention (or even awareness) on the part of the user.  This feature has
allowed us to provide 100% functionality over the phone as well as
hyper-fast display updates over the phone - without "preloading" software
via floppy disk.  This has real advantages in remote locations where we have
to support overseas applications.  We can do it all from Cleveland Ohio,
courtesy of the phone company.  Oh, another thing - we only run on DEC
machines!  WE ARE ALMOST CERTAINLY THE ONLY COMPANY THAT DOES THIS
EXCLUSIVELY!  PLEASE PASS THE WORD AROUND!

This is the reason why I need more flexibility with regards to text.  The
older terminals support arbitrary sized text at arbitrary angles of
rotation.  The X standard tried to be too cute using traditional publisher's
font descriptions.  Text parsing is rarely efficient and it usually requires
coding gymnastics to insert/delete/edit substrings.  X-Y graphs, trends,
SQC/SPC charts, X-bar-R graphs, etc. all need text at 90 degrees and
sometimes 270 degrees. "faking it" via moving the x-y origin of the text is
"do-able" but is a real pain.  Oh well...

You've been extremely helpful.  Tell your boss you deserve a raise
immediately.  If you hear more in this regard, please let me know.  Also, if
you hear of business opportunities for us or our system, please let me know.
Give me your "snail mail address" and our sales staff can send you mores
pecific info about what we do.  Thanks again for your help!

Regards,

Steve Belovich


Dr. Steve G. Belovich
Vice President

BV Technologies, Inc.
5310 W. 161st St.  Suite H
Brook Park, OH  44142-1610

E-mail:      [email protected]
Voice:       (216) 267-1881 x211
FAX:        (216) 267-1880
Home:       (216) 278-2665