[comp.sys.amiga.programmer] console.device

phi@goanna.cs.rmit.oz.au (Philip Hingston) (03/14/91)

Hi folks,

	I have been fiddling with the example program in the RKM's for
opening the console device using a custom screen.

	Everything is fine if that window uses the default font. But if I
have some other font, e.g. ruby 15, things get confused.

	For example, if I write out a string of characters, the cursor finishes
up a long way past the end of the string - not in good shape for inserting
more characters, editting the string etc.

	There are other problems too which seem to be related to miscalculating
the width of characters.

	Is there anything special that needs to be done to have this work 
properly? I am talking 1.3 here, not 2.0.

	Thanks for any advice.	phi
-- 
Philip Hingston, Computer Science,ACSnet: phi@goanna.cs.rmit.oz
R.M.I.T.                          ARPA:   phi%goanna.cs.rmit.oz.au@uunet.uu.net
GPO BOX 2476 V,                   CSNET:  phi%goanna.cs.rmit.oz.au@australia
Melbourne, 3001, AUSTRALIA        UUCP:   ...!uunet!goanna.cs.rmit.oz.au!phi

meranda@iguana.cis.ohio-state.edu (deron meranda) (03/15/91)

In article <4964@goanna.cs.rmit.oz.au> phi@goanna.cs.rmit.oz.au (Philip Hingston) writes:
>	I have been fiddling with the example program in the RKM's for
>opening the console device using a custom screen.
>
>	Everything is fine if that window uses the default font. But if I
>have some other font, e.g. ruby 15, things get confused.
>

The main problem is that Ruby fonts are PROPORTIONALLY SPACED!
                                        ---------------------

>	For example, if I write out a string of characters, the cursor finishes
>up a long way past the end of the string - not in good shape for inserting
>more characters, editting the string etc.
>
>	There are other problems too which seem to be related to miscalculating
>the width of characters.
>
>	Is there anything special that needs to be done to have this work 
>properly? I am talking 1.3 here, not 2.0.
>...

I have noticed this problem too, and it has really bothered me -- GREATLY.
I have even considered writing my own console device, but all that BCPL
stuff and other DOS nonsense makes me sick.

This problem happens with any screen (using SetFont 2.7), not just custom
ones.  Along the same lines, the Intuition string gadget also messes up
when using a proportional spaced font.  ( Also, a related but separate
bug (read, unsupported wish) is that the console device always uses the
algorithmic conversion of fonts, even if a real matching italics or
boldface font exists and is already loaded. )

Of course there are arguments against supporting proportional fonts at
all, since the console device is a rough implementation of the standard
ANSI X3.64 style terminal emulation (which is only designed for mono-
spaced characters - consider problems with cursor addressing).  There
is also a speed and efficiency issue.

BUT, why support it only HALF WAY?  If the user intentionally specifies
a proportional font, then they should not expect everything (like
absolute cursor movements) to work -- but the cursor should still
follow the rendered text correctly!

If this is impossible to fix, does there exist an console-like package
(or subset of) which does support proportional fonts?


Deron E. Meranda  ( meranda@cis.ohio-state.edu )

darren@cbmvax.commodore.com (Darren Greenwald) (03/19/91)

In article <95997@tut.cis.ohio-state.edu> deron meranda <meranda@cis.ohio-state.edu> writes:
>In article <4964@goanna.cs.rmit.oz.au> phi@goanna.cs.rmit.oz.au (Philip Hingston) writes:
>>	I have been fiddling with the example program in the RKM's for
>>opening the console device using a custom screen.
>>
>>	Everything is fine if that window uses the default font. But if I
>>have some other font, e.g. ruby 15, things get confused.
>>
>
>The main problem is that Ruby fonts are PROPORTIONALLY SPACED!
>                                        ---------------------
	Yup, the console.device doesn't deal with proportional fonts.
>
>
>I have noticed this problem too, and it has really bothered me -- GREATLY.
>I have even considered writing my own console device, but all that BCPL
>stuff and other DOS nonsense makes me sick.
>
	You really don't have to know anything about DOS, or BCPL to
write a console.device (the console.device interprets text escape sequences.
You would have to know something about DOS to write a console handler like
CON:)

>
>Of course there are arguments against supporting proportional fonts at
>all, since the console device is a rough implementation of the standard
>ANSI X3.64 style terminal emulation (which is only designed for mono-
>spaced characters - consider problems with cursor addressing).  There
>is also a speed and efficiency issue.
>
	Yea, a major efficiency issue, and as you noted, without a standard
to emulate, you'd have to roll your own definitions (e.g., where does the cursor
move to when a cursor up is issued?  To the same column (if possible), or to
approximately the same visual position?)

>BUT, why support it only HALF WAY?  If the user intentionally specifies
>a proportional font, then they should not expect everything (like
>absolute cursor movements) to work -- but the cursor should still
>follow the rendered text correctly!
>
	Hmmm - well, even this is no trivial matter.  The first thing that
comes to my mind is how wide is the cursor suppose to be?  A vertical bar
cursor would be better than solid when doing proportional fonts.

	I'm not real sure how useful it would be to handle only the case of
sending text, and end-of-lines (e.g., I'm really not so sure that I would
call this "HALF WAY" since I can't really think of anything in which this
would be all that useful - useless for MORE, Shell editing, ED, EMACS,
etc.).  Even things like compilers tend to output a lot of cursor positioning
commands when printing status messages.
 
	I think if your seriously going to try to support proportional fonts
in a console.device your going to have do quite a bit more than just get
the cursor positioned after the most recently output text character. 

>If this is impossible to fix, does there exist an console-like package
>(or subset of) which does support proportional fonts?
>
>
>Deron E. Meranda  ( meranda@cis.ohio-state.edu )


--------------------------------------------------------------
Darren M. Greenwald | Commodore-Amiga Software Engineering   
                    | USENET: uunet!cbmvax!darren                       
--------------------------------------------------------------
Quote: "It would be impossible to discuss the subject without
        a common frame of reference." - Spock