Can I offer my two-penn'orth?

A lot of water has gone under this bridge, but that was years ago, back in
j602 days. It's all gone a bit rusty for me.

Both June Kim and myself once offered completely different solutions to the
problem(s!) of displaying boxed unicode (<su). June's follows and extends
the actual J algorithm. Mine (~addons/format/sbox) does a cheap'n'cheerful
job of patching (":<su) having computed the boxes with single-byte
placeholders in a surrogate (su). It's value :-)) is that it emphasises
preserving the integrity of the boxes. It might actually handle '�' – which
becomes a valid unicode code-point at some stage.

Sorry, haven't looked at it for a year or two, don't know whether it still
works. And "works" is a relative term: if you give sbox too many different
code points (>127), it will inevitably fall over.

Anyway the article…
   http://code.jsoftware.com/wiki/Addons/format/sbox
…might get you ahead a month or two when cobbling your own solution, since
it's a taste of the wacky world of utf-8 and what you're up against. (…Or
maybe it will set you back a month or two.)

The take-home message is that it's highly font-dependent. And font-version
dependent.

(Sorry, can't find June's solution in jwiki. Suggest search Pipermail.)

I conjecture a robust solution would abandon box-drawing chars in favor of
a graphics one: rasterizing separate leaves on the tree of (<su), then
using Quartz (on Apple devices) to draw borders round the resulting
collection of rectangles. Rather like a good spreadsheet does. Meanwhile,
unless someone's willing to go that route, is it really going to repay the
effort? Might it not even be better to print 3 stars and a shrug whenever
utf is detected, than output a corrupt display – which sends the message to
novice users there's a (potentially fixable) bug?

But a graphics approach might even extend to 3-D. And beyond…! Just think
of the visualizations *that* would make possible.


On Wed, May 10, 2017 at 3:03 AM, bill lam <[email protected]> wrote:

> The feature was there because a co-author (bill) was lazy.
> A better user experience would be possible if illegal sequence
> be skipped or replaced by space or other special characters.

…snipped…
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to