Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Make an array of H&J violations for processing with script

Return to Member Forum

  • Author
    Posts
    • #1199083

      A javascript issue:

      Ok, I am trying to get to the problematic places in my text where the justification is being pushed to the limit i.e. the yellow highlights.
      I want to treat these particular lines in a special way and do this with scripting.

      I cannot seem to find a way to address these lines with scripting.
      Do anybody know if this is at all possible?

      Thanks

    • #14323527
      Peter Kahrel
      Participant

      H&J violations aren’t exposed to scripting, you’ll have to find them yourself. Which is possible, but it’s a slow bussiness. For example, to find word-spacing violations, you first find the width of a standard space (i.e. a space in a non-justified line of text). You then go through the text and in each line of text and get the width of the first space. Determine the percentage by which that space was scaled, then compare that percentage with the minimum and/or the maximum value set in the Justification panel.

    • #14323526

      Hi Peter

      Thanks for the answer. I was afraid that would be the case.

      How would you go about picking up the width of a character?

    • #14323525

      Hmmm,
      I found the width of an unjustified space by finding the horizontalOffset.

    • #14323523
      Peter Kahrel
      Participant

      That’s the way to do it.

    • #14323500
      Peter Kahrel
      Participant

      H&J violations aren’t exposed to scripting, you’ll have to go and look for them yourself. Which is possible, but it’ll be a slow script. To find violations in word spacing, for example, you first need the width of a space in a non-justified line of ext (typically the last line of a paragraph, or place a small temporary text frame, apply the paragraph style, enter a space, and measure its width. Then go through every line of text, measure the width of the first space and determine its scale compared with the standard space. Compare that with the minimum and maximum in the Justification panel.

Viewing 5 reply threads
  • You must be logged in to reply to this topic.
Forum Ads