Bug 141417 - Allow derivative styles to maintain x-height rather than M-height
Summary: Allow derivative styles to maintain x-height rather than M-height
Status: RESOLVED INVALID
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.1.1.2 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-01 08:24 UTC by Eyal Rozenberg
Modified: 2021-04-01 08:29 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
Effective character size difference between Default and Source Text styles (10.34 KB, application/vnd.oasis.opendocument.text)
2021-04-01 08:24 UTC, Eyal Rozenberg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eyal Rozenberg 2021-04-01 08:24:28 UTC
Created attachment 170887 [details]
Effective character size difference between Default and Source Text styles

Font size is customarily measured by M-height (or capital height) not x-height; see:

http://xahlee.info/js/standard_font_size.html

for a discussion of this.

Thus, in LO writer (and all LO) font dialogs, sizes are given in M-height. And if you create a style derived from another style, it will maintain the same M-height.

This is problematic in running (Latin) text, where most characters are lowercase, and their height is basically the x-height. Now, if you use character styles with different fonts in the same text run, and fail to carefully set their font size (possibly even to a non-integral value), the sizes of different parts of the run will vary, distracting the user.

This is not some esoteric use case: You just:

1. Create a new document in LO writer.
2. Write some text, say "foo bar"
3. Select "bar"
4. Change the character style (not the paragraph style!) to "Source Text"

You'll see a significant character size difference. (Actually, this might depend on your font selection, but it would work with most default choices, and particularly with Liberation Serif vs Liberation Mono.) The attached document illustrates this

It would be at least as useful, if not more so, if it were possible for derivative styles to track the x-height of the underlying style rather than its M-height.

This can be achieved in one of several ways - partially depending on the extent to which there is an interest in exposing the x-height and allowing users to set it instead of the M-height. They are also not-mutually-exclusive:

1. Global LO setting of whether to use M-heights x-heights.
2. Font dialog(s) toggle of whether to have the font size text box reflect the x-height or the M-height.
3. Separate text boxes for the x and the M heights.
4. Global, document-wide and/or per-style setting of whether derivative styles which do not set a font size, but do set a font family, inherit the x-height or the M-height of the underlying style.
5. Buttons or toggle to reset a derived style's size to the x-height and the M-height respectively of the underlying style.

and there may be other approaches which have not occurred to me.
Comment 1 Eyal Rozenberg 2021-04-01 08:28:54 UTC
Whoops, I got it wrong. That is, the size does not represent the M height. Since I can't edit the opening comment, I'll refile.