[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [StrongED] Display of Tabs and Ctrls



In message <bea1abcf52.martin@xxxxxxxxxxxxxxxx>
          Martin Bazley <martin.bazley@xxxxxxxxxxxxxxxx> wrote:

> The following bytes were arranged on 14 Sep 2012 by Fred Graute :
>
> > In message <579916cf52.martin@xxxxxxxxxxxxxxxx>
> >           Martin Bazley <martin.bazley@xxxxxxxxxxxxxxxx> wrote:
> > > I don't see the problem.  You can already configure three different
> > > representation strings ("[09]", "    " and "--->", the latter two of
> > > varying length), so why not add a fourth (\x80\x81\x81\x82)?
> >
> > Because (\x80\x81\x82\x83) isn't a representation string but a table
> > that looks like this:
> >
> >    83 FF FF FF FF FF FF FF ; tab spanning 1 char
> >    80 82 FF FF FF FF FF FF ;
> >    80 81 82 FF FF FF FF FF ;
> >    80 81 81 82 FF FF FF FF ;
> >    80 81 81 81 82 FF FF FF ;
> >    80 81 81 81 81 82 FF FF ;
> >    80 81 81 81 81 81 82 FF ;
> >    80 81 81 81 81 81 81 82 ; tab spanning 8 chars
> >
> > The other representations are strings so picking the right characters
> > for a given tab length is different for (\x80\x81\x82\x83). This means
> > the code responsible for this must be (made) aware of how to select the
> > correct glyphs to display.
>
> Ah, I didn't expect that.  I presume this is necessary so that the
> single-character tab (\x83) works?  Given that that's one of the major
> advantages of the old dotted lines, I'd rather not give that up.

Yes, in order to display tabs as the old dotted line we need that have a
representation string for each of the possible tab lengths.

> I'm trying to work out what you mean by "representation strings".

By representation string I mean the string that is displayed on the
screen so '[xx]', '     ' and '--->' are all representations strings.

> Do you mean that there is only one zero-terminated string in memory -
> either "        " or "------->" - and the length is altered by
> increasing the start address to get shorter tabs?

Both "        " and "------->" are in memory. The code picks the string
that corresponds to the active option in Mode Choices -> Tabs. To do
this the code, at redraw time, inspects the settings for Ctrl and Tab.

> (BTW, I apparently managed to break StrongED's hardwrap typing the above
> paragraph.  The third line continued past column 72 and softwrapped onto
> the next line, and I had to insert a line break manually.  Not sure if
> it was the eight spaces or the seven hyphens which confused it.)

It's the hyphens. The _NoWrap expression in News mode prevents wrapping
of lines that contain a group of 4 symbols. I've never really understood
why it's there, maybe it should be removed.

> > Previously this was done by checking the font type in use and the
> > display options set for Ctrl/Tab at redraw time. Currently this is no
> > longer required as 4.69a7 only uses representation strings.
>
> I don't understand - what happens if the 'As Ctrl' option is configured?

Then it will handled like any other control code, this is decided when
preparing for redraw. Normally the Tabs syntaxgroup is assigned to Tabs
but when 'As Ctrl' is active we assign the Ctrl syntaxgroup to Tabs.

(I hope that makes sense, it's a bit hard to explain to someone who is
not familiar with StrongED's redraw system.)

> > > All I'm proposing is that the front-end to the configuration is made
> > > slightly more intelligent so as to physically prevent the user
> > > configuring dotted lines and outline (or system) fonts simultaneously.
> >
> > Selecting those options simultaneously is fine under the current system.
> > Outline and system fonts ignore the configured styles completely and
> > always use the alphabetical representation.
>
> Wait.  So what I was proposing earlier (outline and system fonts force
> the Tab representation to '--->' aka 'dotted line', but bitmap fonts
> don't) has already been implemented?

The options available in 4.69a7 aren't all that different from 4.69a4.
The main difference is that outline fonts now have support for Ctrl/Tab.

This required some changes to how Ctrl/Tab are represented. The System
font no longer supports the old dotted line, it now uses '--->'. The old
dotted line could have been kept but it required passing information to
the VDU redraw engine in an awkward way so I decide to remove it [*].

(To cater for users who prefer the system font the SystemOS font was
added which looks the same as the system font but it does support the
CtrlTab style allowing a real dotted line (in its new form) and the
display of control codes as small hex numbers.)

When 'Display Ctrl as [xx]' is off the System font now displays Ctrl as
a letter from '@' to '_' instead of the '.' previously.

Bitmap fonts use the same mappings as the other fonts and, when using
the Regular style, Ctrl/Tab will look the same. However you can make
them look different by using the CtrlTab style, eg Ctrl as small hex
numbers and Tab as a dotted line.

The only thing that's changed is that for bitmap fonts is that the old
dotted line (mapped to 4 chars) has been replaced by a mapping to 2
chars.

In short, we always use '    ' + '--->' for Tab, and '[xx]' + '@' to '_'
for Ctrl. When using a bitmap font, '--->' and '@' to '_' can be made to
look differently by provide alternative glyphs for those character
positions.

Hopefully that's cleared things up.

[*] The redraw system will see major changes and I want things to be as
     simple as possible right now. When it's all finished I'll see if
     any of the old options can be restored.

Cheers,
Fred.

-- 
StrongED developer
http://www.stronged.iconbar.com/


-- 
To unsubscribe send a mail to StrongED+unsubscribe@xxxxxxxxxxxxxx