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

How to keep paragraph text horizontally centered?

Contributor ,
Jun 21, 2025 Jun 21, 2025

How to keep paragraph text always horizontally centered? No matter how many lines the text has, it should always remain horizontally centered. In my image, there are three text paragraphs. If there are four or two paragraphs, I'm not sure how to implement this using JSX code.

1.jpg

TOPICS
Actions and scripting
294
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
Adobe
Community Expert ,
Jun 22, 2025 Jun 22, 2025

Photoshop is not a good fit for this kind of work, Indesign (with its »Text Frame Options«) seems preferable. 

 

A relatively simple Script could evaluate the Type Layer’s bounds and offset it accordingly, but Asccenders and Descenders could confuse the issue. 

Using Baseline Shift instead (as your screenshot seems to indicate) might work … please provide the layered file. 

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
Contributor ,
Jun 22, 2025 Jun 22, 2025

You're welcome!

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 22, 2025 Jun 22, 2025

@w30290083o9nn 

 

Have you tried creating a Paragraph Style to control the paragraph level settings? 

 

You might also try Shift+Return instead of Return to keep all lines as one paragraph.

 

We can only see a small part of your Character panel, and I am very curious as to why you have shifted the baseline -142 pixels?

 

Jane

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
Contributor ,
Jun 22, 2025 Jun 22, 2025

Hello, -142 pixels is because it moves the horizontal position of the text to the middle of the paragraph text frame

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 22, 2025 Jun 22, 2025

Thank you @w30290083o9nn . Is your text frame printing or non-printing?

 

Jane

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
Contributor ,
Jun 22, 2025 Jun 22, 2025
LATEST

This paragraph text is mainly used for batch replacement because I have thousands of strings that need to be vertically aligned and centered. However, Photoshop paragraph text can only be vertically centered and cannot be horizontally centered.

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