Graphics

 View Only
  • 1.  Scripting Leading

    Posted 08-03-2018 01:35
    I've set up radio-button-controlled font tags to resize text in a full-screen text graphic, but the size of the font in the original text dictates the leading of multiple rows of text within the text field. After a little reasearch, I thought I might be able to GetTextHeight and then SetLeading.

    I tried the script below in OnSetText. It compiled, but it didn't do what I need.
    dim Body1Output as xpTextObject
    Self.GetTextHeight(Body1Output.text)
    Body1Output.Leading=Body1Output.textHeight


  • 2.  RE: Scripting Leading

    Posted 08-03-2018 12:06
    Can you share a very simple sample and I can look at it next week to see if it's caused by a bug in the software or not?
    #XPression


  • 3.  RE: Scripting Leading

    Posted 08-03-2018 13:14
    Leading is a member of XpFont object , not xpTextObject .
    XpTextObject doesn't have a textHeight member

    see sample code to manipulate leading information :

    Dim fontObj as XpFont

    Engine.GetFontByName("MyFontName", fontObj)
    fontObj.Leading = val


    .where MyFontName is the name of your font, and val is the new value you want to assign





    #XPression


  • 4.  RE: Scripting Leading

    Posted 08-03-2018 15:40
    If you are replacing the whole text object with a new font, I'd expect the leading of the new font to apply. Maybe im overlooking something though.
    #XPression