Bug 141035 - "Generic" font size setting doesn't affect of Asian, CTL text if support hasn't been enabled
Summary: "Generic" font size setting doesn't affect of Asian, CTL text if support hasn...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
7.0.4.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: RTL-CTL RTL-UI
  Show dependency treegraph
 
Reported: 2021-03-14 23:10 UTC by Gessel
Modified: 2022-02-18 16:59 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
Screen shot of 6pt default paste in several languages showing font format problems (19.68 KB, image/png)
2021-03-14 23:10 UTC, Gessel
Details
Illustration of changing font size after disabling options->languages->Asian/Complex Text (50.24 KB, image/png)
2021-11-12 21:05 UTC, Gessel
Details
character dialog box shows Asian Block UTF8 Character but size is wrong (53.46 KB, image/png)
2021-11-13 11:08 UTC, Gessel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gessel 2021-03-14 23:10:37 UTC
Created attachment 170489 [details]
Screen shot of 6pt default paste in several languages showing font format problems

Either using the text box tool (horizontal or vertical) or pasting text from the clip board, Arabic script text (fa, ku tested failed, ru, en-us tested no problem, 4 keyboard limit in Linux, alas) appears in a fixed character format that can't be changed (font, size, variation, etc).  

Copy paste is the same though, so apparently georgian works, but hindi doesn't. 

Set the default font to, say 
Western: Noto Sans, regular, 6pt English (USA)
Asian: Noto Sans CJK SC, regular, 6pt, Chinese (simplified)

And past the below (unformatted text) into a blank spot on a document creating a text box.

cat
قطة
կատու
pişik
বিড়াল
ကြောင်
kočka
گربه
კატა
חתול
ngeru
ネコ

What the grbH? 

OK, now select the text box you just created and Format->Character and change the font size to 60 pt.  

WHUT????  OK, try selecting the text and changing the format - try changing just  قطة.  Can't do it.  

OK, now try in writer.  Huh, perfecto.   Change the font size?  no problemo.
Calc?  no problems.  Impress?  لا مشكلة

Only draw is having this problem.  And it isn't LTR/RTL.  

Work around: set the type in Inkscape, export line by line as .svg, import, assemble.  Tedious....
Comment 1 Ming Hua 2021-03-16 11:21:32 UTC
I don't usually use Draw, but here is a suggestion:

Background information -- LibreOffice distinguish three types of text: ordinary western, east Asian (CJK), and complex text layout (CTL).  If you install LibreOffice in a English (or other common European languages) locale, the latter two are disabled by default.

Since you didn't mention CTL in your following description of default font setting:
(In reply to Gessel from comment #0)
> Set the default font to, say 
> Western: Noto Sans, regular, 6pt English (USA)
> Asian: Noto Sans CJK SC, regular, 6pt, Chinese (simplified)
I suspect you didn't turn on CTL support.

What is your setting for "Tools > Options" dialog, "Language Settings > Languages" panel, "Default Language for Documents > Complex text layout" option?  If it's disabled, can you turn it on and re-test?  After enabling CTL, you should see a third drop-down list in your usual font setting dialogs, where you can also specify the size of CTL fonts to be 6pt by default.
Comment 2 Gessel 2021-03-16 11:52:48 UTC
Hi Ming, thank you for the support - you were right and not-a-bug, though a bit of a confusing UI issue.

As set:
Default Languages for Documents:
CTL enabled - Default - Hindi

I changed that setting to Farsi (installed system language) and the CTL default font option appeared and now works as expected.   

Perhaps it is slightly a bug that CTL can be enabled as an option but that leaving it to default means the "enabled" flag does not yield the expected results.
Comment 3 Eyal Rozenberg 2021-11-12 16:25:26 UTC
So, can you please explain what remains as a reported bug?

Also, can the problematic behavior be reproduced when East-Asian scripts (CJK and such) are disabled?

Finally, in your instructions, you asked us to set the "default font". What default? The default drawing style font?
Comment 4 Gessel 2021-11-12 21:05:17 UTC
Created attachment 176221 [details]
Illustration of changing font size after disabling options->languages->Asian/Complex Text
Comment 5 Gessel 2021-11-12 21:56:08 UTC
I understand the behavior and that one needs to set default languages for Asian and Complex Text Layout faults in Tools->Options->Language Settings->Languages to be able to work with characters from those sets.

It is non-intuitive to me (perhaps only me) as the characters that are in UTF-8 Unicode Blocks other than Western appear at the initially set Western-set default size and font, but can't be manipulated.

By "default font" I meant not selecting anything and opening Format->Character then setting font preference so that additional created text takes those parameters.

For example, you can uncheck the default languages for Asian and Complex Text Layouts, then unselect any objects, choose Format->Character and set the font to Noto Sans (which has a pretty complete Unicode set), set the font size to, say, 6 point, then paste the example text as unformatted and the text is rendered as I'd expect - 6 point, Noto Sans, and, say 0xEF 0xBE 0x88 renders as ネ 6 point, 

If you create a new document, set the font as above to Noto Sans 18 point and paste the unformatted text, it renders as expected - the whole block in 18 point, all non-western characters rendered in Noto Sans 18 point.

If, after pasting one block, you unselect all objects and change the "default" font to a different size (still without enabling Asian/CTL), then if pasting the same example as unformatted text (as above) only the characters in the western block follow the change - the Asian and CTL block characters render in the font size set in the previous step.  

And, as initially noted, attempting to change the font parameters only applies to the Western block.  - that is you can't change the font/style/size/features of non-western characters, which is very strange looking when you try.

This seems like buggy behavior and a little weird.  I'm not sure why I have to set a default language for Asian and CTL UTF8 blocks to be able to modify the rendering of characters in those blocks.  I mean if an alert popped up if I tried to type or paste non-western characters without setting the default non-western languages and forced me to set those before proceeding, I'd still be curious as to why, but it would avoid confusing behavior.

Further, if I have changed the font size, but it is still rendering in the first selected size, and select a character from a code block for which a default language has not been set and open Format->Character, the dialog shows the font/size I set, not the font/size the character is being rendered in.

I'd expect non-western characters to follow the western defaults if not explicitly set.  That is, if I deselect Asian and CTL in preferences and paste in a UTF8 text block spanning multiple language blocks, it should render any characters available in the selected font at that size and permit modification (size, angle, etc).  

It's a little strange to have to set font parameters for each language code block separately every time I want to adjust a text block.  I can see why there may be use cases where that's desirable, but it seems more like an exception.  

If I want to write "I named my ネコ 'گربه'" I'd expect to be able to change the font from 10pt Noto Sans to 60 point KacstTitle (say) in a single step, rather than having to select the font/style/size/features combinations three times.

It seems obvious that if the default language isn't set features like spell checking and hyphenation wouldn't work, but it is not obvious to me why changing font/size etc. isn't supported.
Comment 6 Gessel 2021-11-13 11:08:58 UTC
Created attachment 176228 [details]
character dialog box shows Asian Block UTF8 Character but size is wrong

This illustrates an odd behavior when dealing with mixed language block text. "I named my neko 'Gorbeh'."
Comment 7 Gessel 2021-11-13 12:05:22 UTC
I think I understand the behavior a bit better:

Unless one checks and selects default language options in Tools->Options->Language Settings->Languages for Asian and CTL language blocks, the Format->Character->Font pane does not show options for adjusting the font settings for the unchecked language blocks: Asian and/or CTL.  

However, pasted unformatted UTF8 text with characters from Asian and/or CTL code blocks are set in the default fonts defined in these thus hidden preferences.  On my system, Asian fonts are rendered in Noto Sans CJK SC 10.5 point, CTL in DejaVu Sans 12pt.  Western follows my set preference (Cormorant Garamond in Writer or Noto Sans in Draw).

Selecting some Asian text (貓 for example) and then navigating Format->Character (while Asian is unchecked in Languages as above) shows the default Western code block settings as if the characters were set in that font (they are not, this is misleading).  Making changes in this dialog do not apply to the characters.  It appears the dialog is broken.

Using the tool bar options for setting font/size via pull-downs, which show by default in Writer and can be enabled in Draw by selecting View->Toolbars and checking "Text Formatting" does work as expected. If you select the whole of, say:

cat
قطة
կատու
貓
پشیله‌
고양이
بزونه
pisîk
বিড়াল
ကြောင်
kočka
گربه
კატა
חתול
ngeru
ネコ

the font and size pull-downs switch to blank, indicating mixed fonts and sizes in the selection because the font and size values having taken the value of the options in the Format->Character pane, options that are hidden unless Asian and CTL default language options are selected.

Setting the font and size in these toolbar pull-downs, in either Draw or Writer or Calc, does the expected: sets all the characters (regardless of language block) to the selected font and size (as do the Style buttons).

Because the Text Formatting toolbar is hidden by default in Draw, I didn't think to try that. Because the tool bar is enabled by default in Writer, I didn't try the Format->Character dialog in Writer.  I see now they all behave the same.

Note that Calc is similar, the Format->Cells->Font dialog behaves the same as Format->Character in Draw and Writer, as does the Toolbar Font and Size pull-downs.  

I'd argue that if the default languages are not set, the result should not be that Asian and CTL code blocks take values from hidden dialogs as this is confusing. They should be formatted with the same font and size as Western code blocks unless the user has explicitly set the default Asian and CTL language options, and even mixed language block text should follow specified font choices.  In my experience most system default fonts have fairly complete UTF8 coverage so the chances of getting a paragraph of squares is low.
Comment 8 Eyal Rozenberg 2022-02-18 16:27:03 UTC
Ok, I (think I) understand now what the issue is.
Comment 9 Eyal Rozenberg 2022-02-18 16:27:28 UTC
Feel free to rephrase if I got it wrong.
Comment 10 Gessel 2022-02-18 16:59:20 UTC
Yes, the title seems a good reflection - thanks.  I believe this is the sort of UI omission that only effects first time users of Asian/CTL fonts who failed to specify an Asian/CTL font, but can be a little frustrating for those users, as I recently was.

I may be using the royal plural; maybe I'm the only one to get stuck in this particular corner.