[comp.windows.news] Text Scaling in NeWS

bobm@valhalla.ee.rochester.edu (05/17/89)

Dear NeWS Users;
	I am developing a software package using the NeWS windowing system.
The package employs zoom and scroll facilities.  The display is the mapping
of a network of system modules.  Each module is represented by a rectangle
with its id number and name written within the rectangle boundaries.

Problem:  When the scaling factor becomes very small (zoomed way out) as
it does when viewing a large system, the text looses proportion to the 
rectangles.  It appears too large and it also shifts so that much of it
is outside the rectangle.  The display behaves very nicely under conditions
of larger scaling factors.


Has anyone experienced this degredation before?  Any ideas?  Could it
be simply a loss of precision? (ie. roundoff or truncation error)

Thank you for your attention.  We now return you to the regularly
scheduled news.


********************************************************************************
*           Robert F. Molyneaux           *     This space intentionally       *
*          bobm@ee.rochester.edu          *            left blank              *
********************************************************************************

alexis%yummy@gateway.mitre.org (05/20/89)

We have a large neural network simulation / modeling system build
in NeWS (and X).  All of the windows scale, which means that
network/layer names, node/arc values, etc have to be scaled if
they are currently being displayed.  In doing this we saw all 
of the scaling problems you mentioned.

Re centering the font, cshow uses stringwidth which seems to count 
the space after the last character -- giving a noticable offset for
small fonts.  Use stringbbox to correct this problem.

Re proportion, this could be round off error -- NeWS has a foolishly
small amount of precision -- but it could be the fixed font sizes.
After creating the string I find the size of the text and scale
again if necessary.  This catches both of these problems.

In general you can't do much with small fonts.  Since NeWS (or at
least Sun) currently uses only bitmapped fonts, there's a limit to
what can be done (on both the large and the small end).  We have
a last ditch if-you-can't-draw-it-right-then-don't-draw-it-at-all
check which turns off the scaled text if the text just can't be 
generated small enough.

alexis wieland            alexis%yummy@gateway.mitre.org