From: connolly@convex.com (Dan Connolly)
Subject: Re: Formatted Text
Date: Tue, 18 Aug 1992 23:57:24 GMT
Organization: Engineering, CONVEX Computer Corp., Richardson, Tx., USA
Keywords: rich text richtext rtf formatted text
X-Disclaimer: This message was written by a user at CONVEX Computer
              Corp. The opinions expressed are those of the user and
              not necessarily those of CONVEX.

In article <raney.713763516@teal> raney@teal.csn.org (Scott Raney) writes:
>george@osc.COM (George Baggott) writes:
>
>>I'm interested in displaying formatted text (i.e. tabs and/or multiple fonts).
>>I've checked out the XcRichText widget and I wasn't entirely pleased with it
>>(too slow,

I can see several reasons why you'd say so: 1) startup time: the widget
does an XLoadQueryFont for each font you'll be using. This takes about
1 second per font to send the font metric info from the server to the
client. Anybody got any suggestions on this?

2) formatting time: the widget can parse and format a few pages (up to
around 2000 words) in less than a second. The RTF spec document is much
larger: it takes 30 or so seconds. If you have documents that big,
you need something besides the RichText widget. Typical "online help"
pages display pretty quickly, I think.


> doesn't work in reverse video,

Guilty. In my defense, an RTF file has the actual RGB values of the colors
it uses, so it's not clear what I should do about reverse video.

> and you have to add all sorts of
>>font bindings to your .Xdefaults file).

Well, yes, the RichText Widget has an XmNfontList resource, but nobody
said you had to initialize it from your .Xdefaults file. It's no different
from the label, button, or text widgets' XmNfontList resource, except
that it defines certain values for the character set parameters to make
correspondence with RTF fonts.


>*** Warning! Marketing hype ahead!
>
>It may be too late if you're well into the development of an Xt
>application, but the text field objects in our UIMS product MetaCard
>support multiple alignments, fonts, sizes, colors, and
>subscript/superscript.  They also support search, sort, and hypertext.
>Check out the free save-disabled distribution on ftp.uu.net (directory
>vendor/MetaCard).
>
I just checked it out. It's a very good copy of HyperCard. I like it.
MetaCard isn't just a text formatter, it's a hypertext editor, where
the hypertexts consist of text, graphics, buttons, fields, and scripts
to add intelligence to the whole thing. If you can organize your information
into "cards" rather than "chapters", i.e. "screens" with fixed layout
rather than long flows of text, MetaCard might be a big win.

However, the text fields don't support per-paragraph indentation
like my widget. An my widget allows bitmaps in the flow of text.

My widget can display "chapter" style information, but like 
george@osc.COM (George Baggott) said, the performance isn't so hot.
I really expected the information to be broken into "chunks" of
a page or so.

The best book/chapter viewer I've seen is the DynaText browser
from Electronic Book Technologies. DynaText and MetaCard differ
significantly in at least one very important respect:

A DynaText book is a compiled SGML document, which has essentially no
layout or presentation information. The layout and presentation is
provided by a style sheet that can be decoupled from the SGML source
and even from the compiled book. In fact, DynaText is not an
authoring environment at all.

A MetaCard stack has the text, graphics, presentation, layout,
and semantics (scripts) all intertwined. This can be a very powerful
authoring environment, but the content of these documents is
inextricably married to the MetaCard paradigm. MetaCard has
a more "quick-and-dirty" feel to it, good for one-time demos
and original layouts.

DynaText has a decidedly more formal bent, optimized for more
lasting documents. I don't mean to say that MetaCard isn't good
for large or lasting documents -- I've seen very effective
HyperCard stacks containing several megabytes of text and graphics.
I've even heard of HyperCard applications that work much like
DynaText, in that they import SGML documents into the HyperCard
paradigm of presentation and navigation.

anyway, back to comp.windows.x.motif...

There's an issue that neither my widget nor MetaCard addresses to
my satisfaction: selection of X fonts. The document might call
for "12 point bold helvetica."

My widget defers to the XmNfontList resource and asks for the font
matching "swiss-bold" (swiss is an RTFism for sans-serif fonts). If the
fontList resource doesn't give a good answer, the widget punts
and uses fixed.

MetaCard probably does something somewhat more intelligent, but it
didn't work correctly when I used it -- probably because I didn't have
botht he 75dpi and 100dpi in my font path like the documentation says.
As a result, it used a Dec vt font that showed up as garbage in some
places, and it truncated the text in a few fields.

I suppose this problem will fade away as R5 servers with scalable
fonts come into wide usage. At least I hope so. But so far,
I've checked out Motif, InterViews, TMLib, and a few other toolkits,
and none of them helps very much.

Dan

Newsgroups: comp.windows.x.motif