(Saving as HTML) how to save the font for Listnumbering(no M

General TRichView support forum. Please post your questions here
Post Reply
Memnarch
Posts: 24
Joined: Mon Jul 08, 2013 7:21 am

(Saving as HTML) how to save the font for Listnumbering(no M

Post by Memnarch »

Hi,
What i am trying to do is saving aDocument in HTML with a List.

However, the List's Font for the Numbers is lost on saving.
This is due to the ListLevel not saving all of it's style info in the OL-Tag(which is allowed btw)

If i use Markers as Text, i get a good looking result, but when i reload the HTML document, i don't get the numbering back as list, but as Text(that's to be expected).

I'd like to add the required CSS to the OL Tag. However, the ListLevel does not include virtual methods(please make more/all methods virtual to allow class-derivation in RV related classes).

Putting a span-tag around each LI gives the desired result, but the html document might be broken in some browsers.(as this is usually not allowed).

What is the best solution for now, to do what i need?(no MarkersAsText!)

Greetings
Memnarch
Sergey Tkachenko
Site Admin
Posts: 17565
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Can you give me a sample of HTML code applying font properties (for example, font color) to list numbers?

If you add some css to <li> or <ul>, it will be applied to the whole list, not only to list number. They can be overridden only by specifying all font attributes inside <li>, but would require an over-bloated CSS
Memnarch
Posts: 24
Joined: Mon Jul 08, 2013 7:21 am

Post by Memnarch »

Yup, at the moment i use Inline-CSS(that's where i need it for atm).
That's bloated but totally fine.

However iirc it is possible to define CSS-Style elements you can apply seperated.

here is an example with inline CSS:

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title></title>
<meta http-equiv="Content-Style-Type" content="text/css">
</head>
<body style="margin: 3px 3px 3px 3px; background-color: #ffffff;">
<ol style="text-indent: 0px; margin-left: 24px; list-style-position: outside; list-style-type: decimal; font-size: 32pt; color: #00FF00">
<li value=1 style=" text-align: left; padding: 0px 0px 0px 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px;"><span style=" font-size: 18pt; font-family: 'Tahoma', 'Geneva', sans-serif; font-style: normal; font-weight: normal; color: #ff0000; background-color: transparent; text-decoration: none;">Hello world</span></li>
</ol>
</body></html>
Memnarch
Posts: 24
Joined: Mon Jul 08, 2013 7:21 am

Post by Memnarch »

and an example with a CSS style ath the beginning(sorry, i used an edited version of my current output in the first example, quite blown up)

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>style-Attribut</title>
<style type="text/css">
OL {color:#E0E0E0}
span.test {color:#000000}
</style>
</head>
<body>
<ol>
<li><span class="test">Hello world</span></li>
<ol>

</body>
</html>
Sergey Tkachenko
Site Admin
Posts: 17565
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Yes, we need to save not only font properties in <ol>, but also <span> undoing these properties.
Well, it is possible, but it requires some work. I added it in to-do list.
Memnarch
Posts: 24
Joined: Mon Jul 08, 2013 7:21 am

Post by Memnarch »

Thank you.
I'll check it on Monday, but iirc span tags are currently already used for formatting within li elements(but maybe not always?)
Sergey Tkachenko
Site Admin
Posts: 17565
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

CSS for span is not necessary contains all properties, some of them may be omitted because default values are used.
Memnarch
Posts: 24
Joined: Mon Jul 08, 2013 7:21 am

Post by Memnarch »

AH ok. thanks for the info.
Memnarch
Posts: 24
Joined: Mon Jul 08, 2013 7:21 am

Post by Memnarch »

But it seems this is not the case when i do not use InlineCSS and define NoDefCSSStyle. Each TextStyleDeclaration contains all values.
Post Reply