CSS - Font family

General TRichView support forum. Please post your questions here
Post Reply
vega
Posts: 50
Joined: Fri Oct 26, 2007 6:29 am

CSS - Font family

Post by vega »

How would I go about adding fonts to the font-family list when exporting RVF to HTML? for example, if Verdana is chosen, I need to have font-family: verdana, arial, sans-serif; . I need to insure nice rendering on all machines and OS's.

Thanks, Dan
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

It's not supported yet.
Do you have an idea how it can be implemented (without adding new properties to text style)?
May be an event for TRVStyle where you can return font-family for the given font name?
vega
Posts: 50
Joined: Fri Oct 26, 2007 6:29 am

Post by vega »

Sergey Tkachenko wrote:... May be an event for TRVStyle where you can return font-family for the given font name?
This sounds good to me but I'm not really qualified to give you any advice at this level. :oops:

My humble opinion is that it would be nice to have some kind of a "WebFontsCombobox" component holding pre-defined fonts known to be ok to use on webpages (a set of pre-def. fonts for each CharSet?). When a font is selected in this combo, it would be the one used on the RV document.

At HTML export time, the selected font would by the first one in the font-family list, followed by its closest match, then by the name of the family itself (serif, sans-serif, cursive etc.).

Example: Times New Roman is selected. CSS would say font-family:"Times New Roman", "New York", serif;. If none of these fonts are available on the client, the user agent will take any font from the Serif family.

Pre-defining these fonts (hard coded) would probably be ok since there is not much room for fantasy in this matter. Again, this is just an idea.

If it can help, I can send you a list of Web compatible fonts that I am providing in my app. (which mainly writes webpages with the help of TRV).

As I mentioned before, the HTML export capabilities of your components are outstanding and it would be great to implement this even further.

Have a nice day, Dan
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Please send them to me. I'll think about it.
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I received your file.
I think the best solution is implementing this feature in absolute transparent way. I.e., when the user applies one of these fonts, the proper font family is used for saving CSS.
This change will be uploaded in the next update, probably already today.

Note: not only Webdings and Wingdings, but any SYMBOL_CHARSET font, including Symbol, is not displayed in Opera & Firefox correctly (by their ideology, every character in HTML must have Unicode code, and SYMBOL_CHARSET fonts violate this rule).
TRichView converts text of Symbol font to the most similar Unicode equivalent, and use another font instead of Symbol.
It does nothing with Webdings and Wingdings because almost all their charcters do not have Unicode equivalents (or at least they are not included in the most of modern fonts)
vega
Posts: 50
Joined: Fri Oct 26, 2007 6:29 am

Post by vega »

Sergey Tkachenko wrote:... This change will be uploaded in the next update, probably already today...
How will we know when and where this is available for download?

Dan
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Info will be posted in the "Announcement" forum.
Post Reply