It is currently 18 Apr 2021, 01:45

• Featuring Members' Works (Image Attachments) •
1: member
2: member
3: member
4: member
5: member

GIMP/GL:  Tutorials | Tips | 🡆 Questions | Interests | Script Requests
Recommendations:  Index | Top 10
Resources:  Python-Fu Plug-ins | Scheme-Fu Scripts | GIMP
Python:  Lessons | Questions | Exercises
The Arts:  GIMPed | GIMPed Photos | Other | Contests | Public Domain Images | Isolated Images | Blender
Inkscape
Social:  Say Hello | Anything Goes | Shares | FCSP

Help centering text in Gimp

GIMP or GIMP LEARN forum related Questions
Mapsking
Forum Member

Help centering text in Gimp

Post#1 by Mapsking » 01 Apr 2021, 11:16


Hello,

I must not be understanding something, and possibly it is a simple question, but is there an easy way to natively center text in a text box vertically? I am not talking about left or right justification, nor am I talking about the alignment tool to align the whole bounding box, I am talking about the fact that every time I type some text, the text itself in the text box is not in the center of the box. Please see the example below. Is there an easy way to do this, and maintain my layer size, as shown by the guides? If I align the layer, but the text itself is not centered in the box, it is still off. Is this a problem with the font, with Gimp, with me, or something else? Can someone make a script to automatically center text vertically in a text layer? What other solutions are there? Any help is appreciated!

Thanks a lot!

Image

p.s. In PS, this is shown as 24 px, but in Gimp, it has to be 29, and is still not exact. Is there some setting in Windows, or Gimp I need to look at? If I look at the text layer in PS, the only difference is that it is 24 px there.

Krikor
Forum Member

Post#2 by Krikor » 01 Apr 2021, 16:02


Mapsking wrote:
01 Apr 2021, 11:16
Hello,

I must not be understanding something, and possibly it is a simple question, but is there an easy way to natively center text in a text box vertically? I am not talking about left or right justification, nor am I talking about the alignment tool to align the whole bounding box, I am talking about the fact that every time I type some text, the text itself in the text box is not in the center of the box. Please see the example below. Is there an easy way to do this, and maintain my layer size, as shown by the guides? If I align the layer, but the text itself is not centered in the box, it is still off. Is this a problem with the font, with Gimp, with me, or something else? Can someone make a script to automatically center text vertically in a text layer? What other solutions are there? Any help is appreciated!

Thanks a lot!

[...]

p.s. In PS, this is shown as 24 px, but in Gimp, it has to be 29, and is still not exact. Is there some setting in Windows, or Gimp I need to look at? If I look at the text layer in PS, the only difference is that it is 24 px there.
Good question. :fb_wow:

It would be nice if just as we can center the text horizontally in the text box we could also do it vertically.
If that is possible, I also don't know how to do it.

Of course, it is possible with the alignment tool, but it is not what you want here.

One option I found, although also far from practical, is to use the Gimp Text Editor to adjust the baseline of the desired text.

In the image below:
TextAlignedVert.jpg
Krikor - How to align text vertically
TextAlignedVert.jpg # (49.37 KiB) Viewed 333 times (Thumbnail | Recognize | Sq Tile)
01- Displays the font in its original position after being typed - In yellow and not centered.
02- Displays the central guide where the text should be aligned vertically.
03- Red text was set to -36 when adjusting the baseline. Being centralized.
04- Window showing the change made to the baseline value (-36).

Maybe someone has better solutions for this case.
"I feel that in both art and music, it's not the success that matters but the pleasure it gives you. Focus on the pleasure and the learning will come naturally." - Brian Weston

rich2005
GIMP Guru

Post#3 by rich2005 » 01 Apr 2021, 17:14


The problem is, it is a bit of a mis-formed font. Looks like capital characters but is set up like lower case, more space at the top. Using a fixed text box it is possible to truncate the bottom of the text. Looks like you made a text box first according to the graphic, then added text.
What you can do is set the text box to dynamic, that will show the extents of the text. Then move the text layer into position, either the move tool or with the text tool active, shift-alt and click-drag moves the text.

Image

Krikor
Forum Member

Post#4 by Krikor » 01 Apr 2021, 20:44


Wow!
Rich2005, after your explanation the whole thing was much easier and faster.
Thank you for the tip! :thumbsup:
Attachments
TextAligned2.jpg
Krikor - TextAlignedVertical - Rich005`s tip
TextAligned2.jpg # (59.1 KiB) Viewed 307 times (Thumbnail | Recognize | Sq Tile)
"I feel that in both art and music, it's not the success that matters but the pleasure it gives you. Focus on the pleasure and the learning will come naturally." - Brian Weston


GIMP/GL:  Tutorials | Tips | 🡆 Questions | Interests | Script Requests
Recommendations:  Index | Top 10
Resources:  Python-Fu Plug-ins | Scheme-Fu Scripts | GIMP
Python:  Lessons | Questions | Exercises
The Arts:  GIMPed | GIMPed Photos | Other | Contests | Public Domain Images | Isolated Images | Blender
Inkscape
Social:  Say Hello | Anything Goes | Shares | FCSP

Post Reply New Topic
  • Similar Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 11 guests