COE ABQ Task 5.4: Rich Text Editing: Sub/Superscripts and Tabs, for RiverWare 7.1 / Features
Phil Weinstein, David Neumann, Edie Zagona, CADSWES, 1-11-2017
R:\doc\Output\ModelReport\2017\CoeAbq54-RichText-Features.docx
This document describes enhancements developed for RiverWare 7.1 to address this requirement:
COE-ABQ Task 5.4: Rich text editing: subscripts, superscripts and tabs
Enhance rich text editor to allow for subscripts, superscripts and tabs
RiverWare's rich text editor is currently used for only Model Report "Text" items. The following enhancements have been implemented:
For the "Tab" and SHIFT-space bar functions, if any text had been selected within the text edit panel, that selected text is replaced with the added non-breaking space characters.
|
![]() |
It is not possible to provide a "Tab" implementation which mimics tabs in conventional word processors, e.g. with regular or irregular "tab stops", as HTML does not directly support that -- and we don't have enough control over the HTML document being edited to provide a sophisticated "CSS" implementation of precise positioning of "DIV" elements.
Non-breaking spaces -- rather than just plain space characters -- are necessary to represent sequences of contiguous spaces, as HTML browsers condense such sequences of plain space characters into a single space.
Superscripts and subscripts appear very small in the Rich Text Editor -- smaller than they would appear in the generated HTML model report document. But the Model Report editor's preview panel does represent superscripted and subscripted text accurately (as it would in a browser). The user may want to also reduce the size of, especially subscripts, by applying a smaller text size.
It should be understood that the current Rich Text Editor is essentially a Qt5 widget intended to support very basic rich text editing. Basically, we have just deployed GUI controls to effect formatting changes to the widget's textual content. And while the resulting rich text is internally represented and serialized as HTML, this is not a full blown HTML editor.
For one thing, the RiverWare application does not have access to the structure of the document being edited. One implication of this is that, after applying super- or subscripting formatting to the selected text, RiverWare doesn't have any knowledge of the ranges of text to which this formatting has been applied. To remove super- or subscript formatting, the user may have to delete and re-enter the affected text.
![]() |