Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

aligning text boxes

Contributor ,
Jun 24, 2018 Jun 24, 2018

Is there a way to align text boxes so that the alignment is based on the type and not bounding box?

3.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jun 24, 2018 Jun 24, 2018

You can start by closing up the Text Frame to the type. Double-click the center-bottom bounding box point. This will automatically close up the Text Frame to the baseline of the last line of type. You can also use the center-side bounding box points to close up the width of the Frame. (This can do odd things like re-breaking your lines of type. If it does, try using No Break [Options menu of Character panel] on the longest line.)

Then use the Align panel (Window > Object & Layout > Align) to Alig

...
Translate
Community Expert ,
Jun 24, 2018 Jun 24, 2018

You can start by closing up the Text Frame to the type. Double-click the center-bottom bounding box point. This will automatically close up the Text Frame to the baseline of the last line of type. You can also use the center-side bounding box points to close up the width of the Frame. (This can do odd things like re-breaking your lines of type. If it does, try using No Break [Options menu of Character panel] on the longest line.)

Then use the Align panel (Window > Object & Layout > Align) to Align or Space the Frames.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 24, 2018 Jun 24, 2018

Hi COGordonW:

The alignment commands are based on the frame reference points (corner handles, side handles, center point).

Jeff's idea is a good one—something else you might play around with is to define a baseline grid and snap the text to it, and use consistent frame sizes.

~Barb

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 25, 2018 Jun 25, 2018
LATEST

Hi COGordonW ,

I'm not exactly clear what you like to do. Something like this perhaps:

 

Two text frames next to each other not aligned to the first baseline:

AlignFirstLineOfTwoTextFrames-1.PNG

 

Aligned:

AlignFirstLineOfTwoTextFrames-2.PNG

 

Below an ad-hoc script ( ExtendScript / JavaScript ) that will do this.

First select the text frame you want to align the other one to and then add the other frames to the selection.

Then run the script.

 

( function()
{
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;
app.doScript
    (
    alignFirstBaselinesOfSelectedTextframes ,
    ScriptLanguage.JAVASCRIPT,
    [],
    UndoModes.ENTIRE_SCRIPT,
    "Align first baseline of selected text frame to other selected frames | SCRIPT"
    );

function alignFirstBaselinesOfSelectedTextframes()
{
    if( app.documents.length == 0 ){ return };
    if( app.selection.length == 0 ){ return };

    if( app.selection[0].constructor.name != "TextFrame" ){ return };
    if( app.selection[0].texts[0].insertionPoints < 2 ){ return };

    var sourceFrame = app.selection[0];
    var sourceFrameBaseLine = sourceFrame.texts[0].characters[0].baseline;

    for(var n=1; n < app.selection.length ; n++)
    {
        if( app.selection.constructor.name != "TextFrame" ){ continue };
        if( app.selection.texts[0].insertionPoints < 2 ){ continue };

        app.selection.move( undefined , [ 0 , sourceFrameBaseLine - app.selection.texts[0].characters[0].baseline ] );
    }
};
}() )

 

Regards,
Uwe

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines