Scalable fonts in x5250

James Rich <[email protected]>
Newsgroups gmane.comp.emulators.tn5250
Message-ID <[email protected]>
Hi everyone,

I've been working on scalable font support in x5250.  Using scalable fonts 
allows you to resize the window to an arbitrary size and x5250 resizes the 
fonts to match.  Last night I got it working well enough that I feel it 
might be worth sharing as a demonstration of the concept.  There are still 
quite a few bugs to be ironed out, so this isn't ready for serious use. 
But I would appreciate a few daring or curious souls who would try it out 
and make a few suggestions on improvements.  The code is at:

http://www.chowhouse.com/~james/x5250/x5250-0.5.3-pre1.tar.gz

This has the same requirements of lib5250 as x5250-0.5.2 so if you haven't 
updated tn5250 in a while, you'll need to get the latest CVS from 
sourceforge.

Here is a list of known bugs:

* When using a window manager that resizes the window as you drag the 
mouse (as opposed to drawing an outline as you drag and the resizing after 
you let go of the mouse button) the font doesn't resize very well, 
particularly if you slowly change size.  This is because the code doesn't 
handle small resizing requests very well.  Large resize requests, like 
maximizing the window, work quite well.

* Sometimes artifacts remain after reducing the window size.

* Moving the window around on the destop can cause flicker in some 
environments.  This is because moving the window around sends 
ConfigureNotify events, triggering the font resizing code.

* Some window managers appear to be ignoring the height resize requests 
x5250 sends to get a proper minimum height.  x5250 won't take any action 
if the window is too tall, but it tries to resize a window that is too 
short.  I can correctly resize the window using windowmaker by simply 
increasing the horizontal size - the height is automatically resized.  But 
in KDE4 this doesn't really work.  This might be related to the first bug.

* There is currently no way to set a user configurable initial size. 
Ideally this would be set using the -geometry command line argument or 
resource, but this doesn't work currently because I don't have a way to 
pick a font to draw with initially.  Right now the font size is 
initialized to a hard coded 100, which results in a 10 point font on most 
displays.  Then using this font, an initial window size is chosen that is 
large enough to hold 80 columns of text in that font.  I don't have any 
ideas on how to reverse that logic, i.e. pick a starting window size and 
then find a font that will fit inside it.  I'd really like some ideas on 
how to handle this.

* The indicator window (i.e. the blue rectangular box that show the 
current cursor location and puts up messages like "X SYSTEM") and the 
pop up menu can now use a different font than the rest of the screen, 
including proportional fonts.  When using proportional fonts and a small 
window size, the indicator window sometimes places the text outside the 
viewable area.

I think that pretty much covers all the bugs I'm aware of.  Using scalable 
fonts requires you to use a font that has a zero in positions 6, 7, and 11 
in the font name, like this:

-misc-fixed-bold-r-normal--0-0-100-100-c-0-iso8859-1

Positions 8 and 9 can also be zero, but that isn't required.  The 80 
column font and 132 column can each be specified differently, as can the 
font for the indicator and pop up windows.  If different fonts aren't 
specified, they default to the 80 column font.  You can specify the font 
to use using -font for the 80 column font, -font132 for the 132 column 
font, and -fontui for the indicator and pop up windows font.  Here is a 
complete example:

x5250 -fn "-b&h-luxi mono-medium-r-normal--0-0-0-0-m-0-iso8859-1" -font132 
-misc-fixed-bold-r-normal--0-0-100-100-c-0-iso8859-1 -fontui 
-adobe-helvetica-medium-r-normal--14-140-75-75-p-77-iso8859-1 
<sessionname>

The above fonts may not be on your system, and be sure to replace 
<sessionname> with a session in your .tn5250rc file or use the hostname or 
IP address of your System i.  You can check which fonts are on your system 
by running xlsfonts from the command line.

James Rich

if you want to understand why that is, there are many good books on
the design of operating systems. please pass them along to redmond
when you're done reading them :)
 	- Paul Davis on ardour-dev
-- 
This is the Linux 5250 Development Project (LINUX5250) mailing list
To post a message email: LINUX5250-Zwy7GipZuJhWk0Htik3J/[email protected]
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/linux5250
or email: LINUX5250-request-Zwy7GipZuJhWk0Htik3J/[email protected]
Before posting, please take a moment to review the archives
at http://archive.midrange.com/linux5250.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.