trichview.com

trichview.support




Re: css fonts -


Return to index


Author

Message

Sergey Tkachenko

Posted: 09/02/2004 21:12:24


First, how new fonts can appear in document:

1) Applying fonts using UI

2) Pasting RTF or RVF (RichView format) from Clipboard

3) Inserting RTF or RVF from file

4) Drag&Drop RTF or RVF (may be from another application)


As for (1), it's your work to prevent undesirable fonts.


If you want strictly restrict formatting, it's simple.

Define all allowed formatting in TRVStyle.TextStyles, right click the

editor, choose "Settings" in the context menu, select "Use a predefined set

of styles".

After that, no new formatting will be used when inserting RTF or RVF. Fonts

from inserted documents will be mapped to the most similar existing

formatting.

This affects (2), (3) and (4)


If you want to restrict font names.

Insert document in hidden TRichView linked with its own TRVStyle component,

then iterate TextStyles of this RVStyle and correct their FontName

properties.

Then use SaveRVFToStream and InsertRVFFromStreamEd to insert data in the

main document.

It will work with (2) (use OnPaste event) and (3).

It's not possible with (3), you'll need to exclude RVF and RTF from

AcceptDragDropFormats property.



>

> Probably only font names.  If I could do full formatting restrictions,

that

> would be handy too, but not necessary.  Just trying to make sure that the

> look and feel of a website is not compromised by dodgy fonts.

>

> "Sergey Tkachenko" <svt@trichview.com> wrote:

> >Do you want to restrict font names (for example, only "Arial" and

"Courier

> >New", or do you want to restrict formatting (for example, only "Arial,

10pt,

> >black" and "Arial, 10pt, red italic")?

> >

> >>

> >> Hi,

> >>

> >> I'm trying to use a TrichViewEdit as an html editor, but restrict the

> >fonts

> >> that the user can choose or the styles the paragraphs can be to only

those

> >> contained within a css file.  Or even if I could get the hmtl export to

> >only

> >> export with font tags like H1 and H2 etc, then i could label my style

> >sheet

> >> appropriately.  Anybody know how i would go about this?

> >

> >

>





Powered by ABC Amber Outlook Express Converter