Forum Replies Created

  • AHM

    Reply To: Highlighting and coloring text

    Participants 0
    Replies 1
    Last Activity 12 years, 11 months ago

    Thank you guys. Works like a charm.

    Just a couple hints (in case anyone else wants to do the same thing):

    For the macros which process the whole document (On_Document_Open_Complete and On_View_Change) it is a good idea to use the MoveToDocumentStart() function in the end again. Otherwise the user sees the last colored element rather than the document's beginning.

    In the On_View_Change macro is is useful to check not only the current view but also the previous one.
    As Tom pointed out the colors remain active when the user switches between Normal View and TagsOn View.
    Processing the document in this situation would not only have a negative impact on performance (depending on size of document and amount of processed elements) but would unnecessarily move the selection away from where the user put it.

    [code]if(ActiveDocument.PreviousViewType >= 2 && ActiveDocument.ViewType <= 1) {
        SetColors(“colorFont”, “color”);
        SetColors(“colorBack”, “background-color”);
    }[/code]

    Reply

    AHM

    Reply To: Highlighting and coloring text

    Participants 0
    Replies 1
    Last Activity 12 years, 11 months ago

    For example, if I have the following XML fragment:

    [code]A paragraph with colored words.Another paragraph with words in a different color.[/code]

    I need the font to be exactly the color defined in the color attribute.
    I think what you mean is that I could define something like:

    [code]colorFont {
      color: #003FC8;
    }
    colorFont {
      color: #7A2700;
    }[/code]

    The problem is that the users are free to select any of the 16.7 million colors from the Color Chooser.
    So what I would like to be able to do is something more dynamic like:

    [code]colorFont {
      color: attr(color);
    }[/code]

    Unfortunately, this does not work in CSS, but maybe there is another way of doing it.

    Thanks,
    Andreas

    Reply

Products
Downloads
Support