Graphics

 View Only
  • 1.  getting TextWithTags ignores the first tag

    Posted 07-16-2018 12:58
    Hi,

    Reading the documentation for TextWithTags, it says "When retrieving the text string assigned to the text object it may not include the first font tag as that tag may actually represent the font choice for the text object and it would therefore be redundant."

    However, this is sometimes not what I want it to do - for example, in script I am setting the TextWithTags of one text object to the TextWithTags of another text object:

    destTextObject.TextWithTags = srcTextObject.TextWithTags

    If the source text object's text is something like {blue}foo {green}bar then the destination text object will pick up the correct font for "bar", but "foo" will use whatever font was explicitly set on that text object.

    Is there any way round this?

    Many thanks
    Tom


  • 2.  RE: getting TextWithTags ignores the first tag

    Posted 07-16-2018 14:07
    Hi Tom,

    Version 8.2-4441 of XPression and above will include the First Font tag in the returned TextWithTags property. What version are you currently running?

    Brian
    #XPression


  • 3.  RE: getting TextWithTags ignores the first tag

    Posted 07-16-2018 19:30
    What is the workaround when on an older version? In my case 7.1-3951. I have't used text with tags yet, but I will quite soon in this project...
    #XPression


  • 4.  RE: getting TextWithTags ignores the first tag

    Posted 07-16-2018 20:07
    You can use visual logic. It will not have this issue with the first tag missing.
    #XPression