Graphics

 View Only
  • 1.  Visual Logic for Position with accent marks

    Posted 20 days ago

    Hello,

    I was wondering if there is any type of visual logic I can use that if a lastname include an accent mark in it, the position of their first name, that is stacked above it, could be shifted up on the Y position and if there is no accent mark, it remains in the original position?



    ------------------------------
    Brian Contreras
    Production Coordinator
    ------------------------------


  • 2.  RE: Visual Logic for Position with accent marks

    Posted 19 days ago

    It's a bit of brute force method, but you can use the String Position block to determine if any specific accented characters are included in your last name field. Put as many of those as you need into an Or block, then you can use the result of the Or (will return true if any of the accented characters are included in your text object) to feed a String Selector (pre 12.0, you can use some Value blocks and an Input Selector) to set the Y Position of the First Name. Here's a quick sample I spun up...you can add as many String Position blocks as you need to include additional characters if necessary.



    ------------------------------
    Jeff Mayer
    Ross Video
    ------------------------------



  • 3.  RE: Visual Logic for Position with accent marks

    Posted 19 days ago

    Looks like I posted an answer at the same time as Jeff Mayer (which was very similar) so I'll add a scripting answer instead:

    Dim hasAccents As Boolean = System.Text.RegularExpressions.Regex.IsMatch(Text, "[ÀÈÏÒÙ]", System.Text.RegularExpressions.RegexOptions.IgnoreCase)
    Scene.SetObjectPropertyString("first_name_text", "Position.Y", Iif(hasAccents, 10, 0))

    You can add to the regex as needed.