Graphics

 View Only
  • 1.  Bounding boxes and text height

    Posted 06-12-2019 22:21

    Slowly going crazy. Helping a co-worker set up a stat page that can have between three and six lines. The font size increases based on number of lines. Got that set up pretty well, but the lines also need to distribute themselves within the background frame, and that's where the trouble comes in.

    I got them to distribute using Visual Logic, taking the height of the background frame (a quad), subtracting the combined height of the text and dividing by the number of gaps required, using the top of the frame to set the position of the first text line and positioning the rest relative to it. But it always looked off. Looking closer, I discovered that the text bounding box heights I was using for measurement and pivot point placement were not the same as the actual text heights. Okay, it leaves room for potential ascenders and descenders. Fine. Figure if I took the height of the bounding box, subtracted the font size and divided that by two, I'd get the dimensions of the top/bottom empty space. Nope! Using Quads to measure, I found that font sizes don't appear to be measured in pixels. Okay, must be points. But that conversion didn't work either. I'd expect a 52pt font to be roughly 69 pixels, but the quad height was closer to 59.

    So now I'm stuck. I can't figure out how to accurately get the heights of these text boxes or how to equally distribute them. My initial approach was close but visually you could see it was off. I've looked through the forums but haven't found this exact issue. Is my base logic faulty? Am I simplyapproaching the problem from the wrong angle, making it harder than it needs to be? Can someone nudge me in the right direction?t



  • 2.  RE: Bounding boxes and text height

    Posted 06-14-2019 23:54

    Jeff,

    Can you post the visual logic?

    If you would like I can do a remote session with you. Feel free to reach out below:

    PeterP@rossvideo.com


    #XPression


  • 3.  RE: Bounding boxes and text height

    Posted 06-18-2019 17:27

    Peter, thanks for the response. Sorry, been a busy couple days but here at last is my insanely messy work-in-progress VL. I apologize in advance for the damage done to your eyes and brain as you try to trace out my thought process as I tried solving the issue.


    #XPression