Bug 489967 - Filenames containing CJK characters are wrongly padded resulting in excessive whitespace
Summary: Filenames containing CJK characters are wrongly padded resulting in excessive...
Status: REPORTED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 24.05.2
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-09 10:06 UTC by hch12907
Modified: 2024-08-13 01:37 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Screenshot of the bug (91.66 KB, image/png)
2024-07-09 10:06 UTC, hch12907
Details
attempt to replicate the bug (235.69 KB, image/png)
2024-08-09 16:05 UTC, Nath ROSET
Details
Red line show unequal line heights (26.40 KB, image/png)
2024-08-09 17:16 UTC, hch12907
Details
Same directory with a font designed for CJK characters and additional scripts (83.53 KB, image/png)
2024-08-13 01:37 UTC, Nath ROSET
Details

Note You need to log in before you can comment on or make changes to this bug.
Description hch12907 2024-07-09 10:06:58 UTC
Created attachment 171495 [details]
Screenshot of the bug

SUMMARY
I noticed that filenames containing CJK characters are not vertical-centrally aligned in details mode, it looks like they are overly padded from the top.

In icons view mode, when the files are selected, the selection box of CJK-containing filenames looks taller than the selection box of Latin-only filenames.

As you can see from the screenshot, when those files are mixed with other Latin-only filenames there is excessive whitespace, which looks jarring. For example, look at Main.txt and Name 名字.txt.

STEPS TO REPRODUCE
1. Create a directory containing files with Latin-only filename and mixed CJK-Latin filename.
2. In any view (icons, details, compact) you should notice the CJK-containing filenames look odd. 

OBSERVED RESULT
Filenames wrongly rendered, with excessive whitespace

EXPECTED RESULT
Filenames correctly rendered

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.1.2
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.2
Kernel Version: 6.9.7-arch1-1 (64-bit)
Graphics Platform: Wayland
Scaling factor: 125% @ 1080p

ADDITIONAL INFORMATION
Since this is related to text, I figured I should note the fonts used are Inter 10.5px for Latin and Source Han Sans SC for CJK. Changing to other fonts like FreeSans 11px doesn't resolve the issue, though.
Comment 1 Paul Meier 2024-08-09 12:30:52 UTC
Can confirm, this also happens for me with some files and directories
Comment 2 Nath ROSET 2024-08-09 16:05:45 UTC
Created attachment 172443 [details]
attempt to replicate the bug

attempt to replicate the issue using the same font, same font size and same scaling factor
Comment 3 Nath ROSET 2024-08-09 16:08:11 UTC
Comment on attachment 172443 [details]
attempt to replicate the bug

Hello I've tried to replicate the issue using the same font, same font size and same scaling factor but I'm unable to locate the issue. This was taken using the current development session with recent build of Dolphin. Could you please provide more context about what the issue seems to be ?
Comment 4 hch12907 2024-08-09 17:16:24 UTC
Created attachment 172449 [details]
Red line show unequal line heights

Your screenshot has the bug too.

I made an illustration showing the problem more clearly.
Comment 5 Nath ROSET 2024-08-13 01:37:47 UTC
Created attachment 172571 [details]
Same directory with a font designed for CJK characters and additional scripts

I can see the discrepancy when using Inter but it seems to disappear when using a font that was designed to handle CJK characters, such as the Noto Sans CJK family of fonts. 
Additionally, looking at the Inter website (https://rsms.me/inter/#languages), it seems that they do not cover any CJK characters. Therefore I don't think KDE can do anything about it unfortunately.