Bug 142103 - Japanese full-width characters: Should be cropped, if they are the first character
Summary: Japanese full-width characters: Should be cropped, if they are the first char...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.0.5.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: CJK-Japanese
  Show dependency treegraph
 
Reported: 2021-05-05 15:21 UTC by DarkTrick
Modified: 2023-08-04 13:13 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Example odt file (9.69 KB, application/vnd.oasis.opendocument.text)
2021-05-05 15:22 UTC, DarkTrick
Details
Example screenshot (30.67 KB, image/png)
2021-05-05 15:22 UTC, DarkTrick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description DarkTrick 2021-05-05 15:21:53 UTC
Actual
=======
Japanese Characters containing empty space (like 「(〔【  ) look wrongly indented, if they are the first character in a paragraph or listing.
( see screenshot and example file attachment )

Expected
=========
If characters contain "empty space" and appear as first character in the paragraph or listing, the empty space should be cropped.
( see screenshot and example file attachment )


FYI
=====
Japanese fonts are like mono-fonts. That is, they occupy a squared size. Some of these characters can contain empty space before them.
Comment 1 DarkTrick 2021-05-05 15:22:22 UTC
Created attachment 171651 [details]
Example odt file
Comment 2 DarkTrick 2021-05-05 15:22:50 UTC
Created attachment 171652 [details]
Example screenshot
Comment 3 DarkTrick 2021-05-05 17:09:13 UTC
Workaround:
===========
If you have a font installed, that does not reserve space for those certain characters (like IPAPGothic ), you can manually set the first character to that font.
Comment 4 Vadym 2021-05-24 08:57:35 UTC
Thank you for reporting the bug. I can confirm this bug.

Version: 7.2.0.0.alpha1+ (x64) / LibreOffice Community
Build ID: b1c0734ffe0f395757b6e0cea7830d820231afeb
CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded
Comment 5 Ming Hua 2021-05-24 09:15:06 UTC
(In reply to Vadym from comment #4)
> Thank you for reporting the bug. I can confirm this bug.
I am by no means an expert, but I question this "confirming".

Yes, full-width punctuation marks will have empty space when placed at the beginning of a line and look misaligned like in reporter's screenshot.  However this is likely due to the design of the font used, as most fonts define the width of full-width punctuation marks as the same as the width of square-shaped glyphs, and don't have proper metadata (kerning?) to automatically adjust glyph position based on its position in a line/paragraph.  Moreover, for different fonts, this "empty space" may well be very different.

I personally don't think this is a problem LibreOffice can solve.  Nor should it try.
Comment 6 DarkTrick 2021-05-27 08:09:25 UTC
Thank you for your comment on this matter!

From what you wrote and further "investigation", I guess I agree with your statement.

That being said: Maybe there is some indirect way to prevent the problem ( I don't know about technical details here, so I might go off on an impossible tangent).

1) 
How does LibreOffice decide which fonts are used as standard?
Perhaps changing standard fonts to something, that works "as expected" in each language is possible?

2) 
> and don't have proper metadata (kerning?)
Maybe let the user know, if the font is "broken", so they understand, that some things might not work as expected?
Comment 7 Ming Hua 2021-05-28 00:07:42 UTC
(In reply to DarkTrick from comment #6)
> Thank you for your comment on this matter!
> 
> From what you wrote and further "investigation", I guess I agree with your
> statement.
Don't get me wrong, I agree it's a valid concern and enhancement request, I just don't feel LibreOffice is the right place on the technology/software stack to solve this issue.

FWIW, English/Latin-based text has more-or-less the same issue, usually called "hanging punctuation" or "optical margin alignment", see bug 106513.

> That being said: Maybe there is some indirect way to prevent the problem ( I
> don't know about technical details here, so I might go off on an impossible
> tangent).
As I said, I'm by no means an expert, so I'll just drop my 2 cents here, as a (somewhat) experienced Chinese user:

> 1) 
> How does LibreOffice decide which fonts are used as standard?
> Perhaps changing standard fonts to something, that works "as expected" in
> each language is possible?
LibreOffice is a bit different from most other word processing software here, in that it specify three different fonts for its text -- Western font, Asian (CJK, i.e. Chinese, Japanese, and Korean) font, and CTL (complex text layout, think Arabic, Hindi, etc.).  See the Tools > Options > Language Settings > Languages dialog.

To the best of my knowledge, there is no "default" CJK font defined in the default template, therefore no such "used as standard" font for Japanese text.  There is a list of preferred font to fallback on for each language, but it depends on whether each of the fonts in that list is installed on your system, and therefore not reliable.

> 2) 
> > and don't have proper metadata (kerning?)
> Maybe let the user know, if the font is "broken", so they understand, that
> some things might not work as expected?
Again to the best of my knowledge, all current widely used (meaning the open source ones, and the ones come with Windows or macOS operating system) Chinese and Japanese fonts are "broken" in this regard.  I guess most native Chinese and Japanese users just don't consider this issue a big deal (I personally don't, either).
Comment 8 Ming Hua 2021-05-28 00:23:36 UTC
(In reply to Ming Hua from comment #7)
> Again to the best of my knowledge, all current widely used (meaning the open
> source ones, and the ones come with Windows or macOS operating system)
> Chinese and Japanese fonts are "broken" in this regard.

(In reply to DarkTrick from comment #3)
> If you have a font installed, that does not reserve space for those certain
> characters (like IPAPGothic ), you can manually set the first character to
> that font.
I've never used fonts by IPA before, only heard of their name.  If this "proportional" IPAPGothic font suits you need, by all means set it as the default Asian font on your system.  But my guess is that it also make those punctuation marks narrower even if they are not at the start of a line.  And many users would find that undesirable.