New Chr Style Does Not Seem To Hold Font Size

Hi, am I doing somthing wrong here?

I create a chr style “Chr Text Body” that uses Arial, 8pt. (The font is not important, but the size is.) This chr style is for reference only and is rarely, if ever, actually used; although, attatching this style to a particular text is irrelevant. I can manually change this if the overall font size for the document needs to be changed. I then create a chr style “Chr Quote”, which uses Times New Roman, 105%, inherited from “Chr Text Body”. This produces the desired result with the relevant text portion being in TNR, 8.4pt. However, when I save, close and reopen the document, the relevant text comes up at TNR, 12.6pt, which is 105% of 12pt. If I then edit “Chr Quote” by adjusting the % to, say, 110 and clicking “Apply”, it forces the style to reasert the correct size. I then reset the size to 105%. Saving the file again achieves nothing. It appears that using the “Inherited from” only works while the document is open, but reverts to something else on reopening.

Or am I doing something wrong?

Matt

1 Like

Both Win10 and Linux Mint.
Version 7.4.6.2 (x64) on Win10. (Not sure about the LM version, but guess most uptodate.)
File type is .odt

Do current versions (7.6 or 24.2) also demonstrate the same problem?
But I remember that the relative size has a complicated logic in character styles (@Regina can tell for sure). It might not be what user expects; and additionally, what you describe is definitely a bug.

You have a chain of inheritance which needs to be checked. Please attach a sample file (one page is enough; make sure all style definitions are present and insert some example text). As @mikekaganski reminds, relative size computation has its own peculiarities, complicated by the fact that character styles live in a different space than paragraph styles (thus making both realms independent). The crucial point is how you define your “root” Chr Txt Body.

For me it is a bug. The values in the style are correctly written to file and correctly read back, but the calculated char height is wrong. I see the error also in older versions of LO and OOo. Thus likely inherited from OOo. I have not found a suitable bug report.

The calculated font height also do not adapt, when the parent character style gets a different font size. That is bug 109029 – Character style percentage font sizes are not updated automatically. Your problem might me related to that.

Don’t have these updated versions. Will try to update. Not sure how to do this on LM as I though this would update automatically.

Sorry. I have no idea what this means.

Not entirely sure what this means, either.

If I can update and the updated version still has the same issue – and whatever ajlittoz may be suggesting does not help – and it seems like a bug, how can I advise LO?

Attach a sample file so that I can have a look at your styles (and their inheritance chain). Bug reports are filed on TDF Bugzilla. Things are somehow sped up when you attach a sample file there too.

Test.odt (9.5 KB)

I confirm the bug. Style definition are correct. 105% size specification is kept but computation is faulty.

Use Bugzilla. A general starting point for infos about Bugzilla is QA/Bugzilla - The Document Foundation Wiki

Or read the documentation at 2. User Guide — Bugzilla 5.0.6 documentation

Or simple start on the page ajlittoz has linked. Your first bug report need not be perfect.

1 Like

Thanks. I’ve never done a bug report before, so this should be interesting. Appreciate all the help.

Can confirm then same thing happens in v. 7.6 on Windows10. Filed a bug report. Hope I did it right. If I can, I’ll see if I can find a way to test it on v.24.

I use the “hack” with macro for this, it sets the position in Superscript in character style to 0%. It also need set Text-To-Text Alignment → Base Line in parent Paragraph Styles.
bypass-charStyle.odt (101.0 kB)

Sub Main
	dim oDoc as object, oStyles as object, oStyle as object
	
	const cStyle="MyCharStyle-pct" 'NAME OF YOUR CHARACTER STYLE
	const cHeight=70 '% OF HEIGHT
	
	oDoc=ThisComponent
	oStyles=oDoc.StyleFamilies.getByName("CharacterStyles")
	oStyle=oStyles.getByName(cStyle)
	with oStyle
		.CharEscapement=0
		.CharEscapementHeight=cHeight
	end with
End Sub