[BRLTTY] Low-level BrlAPI questions

Aura Kelloniemi kaura.dev at sange.fi
Wed Apr 14 15:13:45 EDT 2021


Hi

Davce, nice to have your opinion as well!

On 2021-04-14 at 14:27 -0400, Dave Mielke <Dave at mielke.cc> wrote:
 > I might as well throw in my opinion: To me, it's the region size that should define the cell count, and it's the exact cell count that matters. Text and masks can be padded/truncated as necessary to fit the cell count. And, to me, a region size of 0 could mean from begin to the end.

I agree.

 > Using the text size to define the cell count is imprecise.

yes, and it should not be used for that purpose, basicly because of UTF-8.

 > What a user typically wants to do is to write some text without worrying
 > about anything other than having it written. He/she expects the interface
 > to worry about things like truncating, padding, wrapping, etc. It's kind of
 > like expecting an HTML writer to need to know the precise rendering width.

Yes, and that is what I am trying to acheive in my bindings. My secondary goal
is to be as efficient as possible, and that's what I am after.

I already have a working implementation, but it does extra scaning and
copying, which could be avoided, if there was a low-level function in BrlAPI
that is not so strict about text and mask sizes specified by the caller. But I
can very well live without this addition.

 > As I see it, there really should be no need at all for a simple client
 > writer to ever need to ask the size of the display.

How would you achieve that? The client needs to implement scrolling, because
even the shortest messages don't fit on every braille display without
wrapping.

Well of course it is possible to develop a client library, which provides
facilities for reading contiguous texts, for example, but it is already
special-purpose. Such a library might not be ideal for writing a game, or a
music notation editor.

 > The Tcl and Java bindings (which I maintain) hide all of this from the
 > user.

I guess I need to take a look.

-- 
Aura


More information about the BRLTTY mailing list