Cannot make texts align, missing formatting options?

As you can see from this picture below

Both of these texts are aligned to the middle vertically, same font and size (Liberation Serif, 28), However, the one on the right has a small gap above that makes it stand below the center line. The only way to bring it to the midline is to “Clear Direct formatting”. However, I do not want to use this option, it eliminates the gradient color settings for which UI is not available yet, also I want to know what setting it is that controls this. Also, the line spacing is also set to single for both.
I checked the paragraph settings as well, they are both identical.

You don’t tell how many shapes there are in your drawing.

Is the blue square with 167 at left a single shape or a blue square and a text box?

Similarly, how many shapes are there at right? Three? More?

There is a common misconception with Draw: people often think that a text box is necessary. In fact, any shape can be labelled. This removes the need of a text box and eases text alignment. For example, the left part can be implemented with a single shape labelled “167”.

Attach the file for close analysis.

Here is my design:
image

Left half is a single shape. Right half was not exactly same as yours with two shapes; consequently I used 3 shapes. The trick is to give the text box exactly the same size as the background square.

AskLOMixedRectWithText.odg (39.9 KB) is done quick’n’dirty with direct formatting. Using styles could achieve a more reliable and stable document.

It is likely that your text is bold, which I didn’t apply.

if you put your cursor in the 32 and click Format > Character > Position does it show it as Subscript, Raise/lower by: 8%, Relative font size: 100%? Just set it to Normal

test alignment.odg (11.9 KB)
Here is the uploaded document.
The rectangle with 167 is a single rectangle, as well as the one with 32. It has formatting options from Microsoft Office which does not have a UI in LibreOffice yet. So, I don’t want to use “Clear Direct Formatting” yet. The text is bold, which I forgot to mention.

Nope, I never tampered with it and it was not set to subscript. Completely identical settings on both, as far as I could check.

In that case look at Format > Paragraph > Indents and spacing, probably the line spacing is set to 1.15 for 32

Unfortunately, that is not the case. When I noticed this issue, the first few things I did was checking paragraph and line spacing, both of which were in order. I also uploaded the file for people to check it out. Up until now, I had to clear direct formatting to fix it, which is not applicable in this case.

The difference is produced by the property “FontIndependentLineSpacing”. The right shape is an import from MS Office, which can be seen at type=“ooxml-rect”, whereas the left shape is a native shape with type=“rectangle”. On import from MS Office the shape gets FontIndependentLineSpacing=TRUE, whereas for the left shape the property is missing, which means it has value FALSE.

I do not know a UI for this setting. I would change it directly in file source.

Or you write a macro to change it. You see the property when you look at the shape properties with the Development Tools.

I do hope they are gonna add UI for these things as well. By the way, how did you find out the name of the shape to deduct it was from MS Office?

There is a tool DevelopmentTools in menu Tools. It opens at the bottom edge. Click on the shape, then on “CurrentSelection” and tab “Properties” in the Development Tools. Open the + at @0. Scroll down till item CustomShapeGeometry and open the +. It has a list of +. When you open one, you see it has an item Name and an item Value. One of these has Name = Type and Value= ooxml-rect. The number where you find the ‘Type’ item is not always the same, you need to examine the items one by one. The DevelopmentTools are a useful tool when writing Basis macros.

.