Mark Vincenzes 14.Jul.06 10:33 AM a Web browser Domino Server7.0All Platforms
The web server uses a number of HTML tags to represent notes rich text "font properties".
(The "font properties" are what you specify with the notes editor using the "font" tab of the text info box, and include font face, size, style and color.)
When translating the font properties to HTML, the web server uses a combination of the tags:
<tt> - teletype / mono space font
<b> - bold
<i> - italic
<u> - underline
<s> - strikethru
<font> - for size, color, and face (other than Default Sans Serif)
<sup> - superscript
<sub> - subscript
Of these <sup> and <sub> are considered "text structure" tags by HTML 4.01 and are still proper usage.
The tags <font>, <u>, and <s> are deprecated, and the remaining are "frowned upon".
So, what are the alternatives for the web server to use and how do we go about doing it in a way that does not adversely affect existing applications?
(0) Base example
Assume you have some text, "Hello World!" that you mark as bold, italic, underline, strikethru, dark red, 17pt, Lucida Sans Unicode.
The web server would generate this HTML:
<b><i><u><s><font size="5" color="#C00000" face="Lucida Sans Unicode">Hello World!</font></s></u></i></b>
(The web server translates the point size 17 to a "virtual size" attribute value of "7". There is a web server table that defines how the point sizes are mapped to virtual size numbers.)
(1) Direct use of inline style
Is it sufficient just to translate this to the equivalent inline style attribute of a span tag?
(Note that I have mapped the virtual size "5" to the CSS font-size "large")
This pattern is difficult to override with a style sheet, since the inline style attribute takes precedence.
(2) Marking with inner span for override
If we add an inner span tag with a well known class name then it would be possible for the application developer to write a stylesheet that overrides the one generated by domino:
This variation can also have the inner span tag for user override.
(4) Separate classes to mimic the original tags:
We define classes that represent the older tags. Some use patterns will need separate classes for combinations of styles.
<style type="text/css">
.d_style_b { font-weight: bold } /* the b tag */
.d_style_i { font-style: italic } /* the i tag */
.d_style_u { text-decoration: underline } /* the u tag */
.d_style_s { text-decoration: line-through } /* the s tag */
.d_style_us { text-decoration: underline line-through } /* both s and u */
/* these represent the seven font size attributes */
.d_fsize_1 {font-size: xx-small}
.d_fsize_2 {font-size: x-small}
.d_fsize_3 {font-size: small}
.d_fsize_4 {font-size: medium}
.d_fsize_5 {font-size: large}
.d_fsize_6 {font-size: x-large}
.d_fsize_7 {font-size: xx-large}
</style>
For things like <b> and <u> we can predefine the styles for all generated pages. But for font faces and color we would generate special class names "on the fly" for each form being converted.
(5) Disabling certain of the font property specifications.
Another possibility (separate or in combination with one of the above) is to have the web server simply "ignore" some or all of the font properties.
For example the properties can be categorized as:
Face (a name of a font face)
Size (number representing point size)
Style (one or more of: plain, bold, italic, Underline, Strikethrough, Superscript, Subscript, Shadow, Emboss, Extrude)
Color (a color value that ends up as a red, green, blue triple)
There could be an option to disable each or any combination of the four categories. The web server would simply not generate the style settings for that category.
(6) A word about point size and "virtual size"
In the Notes editor you specify font size directly with the point size. The size attribute of the <font> tag uses a "virtual size" of 1 thru 7. CSS provides for virtual sizes xx-small thru xx-large and direct point size. The web server translates from the Notes point size to the virtual size using a table of threshold point sizes. In my examples I have continued using that mapping but substituted the CSS size names for the size attribute values.
I think we also need an option (distinct from the others being discussed) that allows the actual point size specified in the Notes rich text to be carried through to the style sheet.
(7) Conclusion - Comments, suggestions, other alternatives?
I am leaning toward the direct use of a style attribute with an inner span tag with class=domino_run (as in paragraph (2) above) along with an option for selectively disabling certain conversion (as in (5)) and an option for using absolute point size (6).
I invite comments, questions, suggestions, alternate proposals...