View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0016099 | Scribus | Typography | public | 2020-04-27 09:53 | 2020-08-11 20:56 |
Reporter | ftake | Assigned To | jghali | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 1.5.6.svn | ||||
Target Version | Fixed in Version | 1.5.6.svn | |||
Summary | 0016099: Add implicit space between a Latin character and a CJK character | ||||
Description | Scribus adds a 1/4 em space between a Latin character and a CJK character according to [1]. However, when their paragraph is justified, the width of that space should be extended like other space characters. Otherwise, the texts become unbalanced. [1] https://www.w3.org/TR/jlreq/#handling_of_western_text_in_japanese_text_using_proportional_western_fonts | ||||
Steps To Reproduce | See files attached. | ||||
Tags | No tags attached. | ||||
Patch | No | ||||
|
extensible-implicit-space.sla (17,827 bytes) |
|
It looks like the condition at line 452 of textshaper.cpp needs to be more complex. Some like this maybe: if (firstChar != 0 && ((SpecialChars::isCJK(m_story.text(firstChar).unicode()) && SpecialChars::isCJK(m_story.text(firstChar - 1).unicode())) || (SpecialChars::isCJK(m_story.text(firstChar).unicode()) && SpecialChars::isLetterRequiringSpaceAroundCJK(m_story.text(firstChar - 1).unicode())) || (SpecialChars::isLetterRequiringSpaceAroundCJK(m_story.text(firstChar).unicode()) && SpecialChars::isCJK(m_story.text(firstChar - 1).unicode()))) ) run.setFlag(ScLayout_ImplicitSpace); |
|
I think the function to be fixed is scribus/pageitem_textframe.cpp justifyLine(). It seems that we need refactoring around imSpace before fixing this problem. imSpace indicates the width of 1/4 em space but I cannot understand from the code at a glance. |
|
At this point, justifyLine() does not have the information that there is an implicit space between CJK and latin chars. Hence my proposal to change the condition at line 452 of textshaper.cpp. The imSpace variable in justifyLine() is something different that the 1/4 em space. The 1/4 em spaces are currently inserted in TextShaper::shape() at line 583 and 598 of textshaper.cpp. |
|
I reminded the implementation. I'm sorry, the title was wrong. The space between Latin and CJK is not what we call implicit space. > It looks like the condition at line 452 of textshaper.cpp needs to be more complex. Some like this maybe: You are right. But I am wondering if we can move the code adding 1/4 space to somewhere handling spaces. Even though we add the conditions to the if statement setting ScLayout_ImplicitSpace, we still need another code at justifyLine() to reduce the space width by the amount of quaterEM, which has been already added to the extra width. |
|
>> I'm sorry, the title was wrong. The space between Latin and CJK is not what we call implicit space. Is there a specific technical name for such space? |
|
> Is there a specific technical name for such space? No, as far as I know. We are using "implicit space" as a space implicitly added for justification (ScLayout_ImplicitSpace). On the other hand 1/4 space between CJK and Latin is added (also implicitly) regardless of justification/alignment. So the title should be "Add implicit space between a Latin character and a CJK character", I think. I'm wondering adding U+2005 (four-per-em space) to glyph cluster instead of extraWidth makes it simple although I'm not sure such use of glyph cluster is allowed. |
Date Modified | Username | Field | Change |
---|---|---|---|
2020-04-27 09:53 | ftake | New Issue | |
2020-04-27 09:53 | ftake | File Added: extensible-implicit-space.png | |
2020-04-27 09:53 | ftake | File Added: extensible-implicit-space.sla | |
2020-04-27 12:27 | jghali | Note Added: 0047571 | |
2020-04-27 13:08 | ftake | Note Added: 0047572 | |
2020-04-27 13:22 | jghali | Note Added: 0047573 | |
2020-04-27 13:53 | ftake | Note Added: 0047574 | |
2020-04-27 14:15 | jghali | Note Added: 0047575 | |
2020-04-27 15:55 | ftake | Note Added: 0047576 | |
2020-05-06 11:46 | jghali | Summary | Implicit space between a Latin character and a CJK character should be extensible in a justified paragraph => Add implicit space between a Latin character and a CJK character |
2020-05-06 11:46 | jghali | Description Updated | View Revisions |
2020-05-06 11:47 | jghali | Assigned To | => jghali |
2020-05-06 11:47 | jghali | Status | new => resolved |
2020-05-06 11:47 | jghali | Resolution | open => fixed |
2020-05-06 11:47 | jghali | Fixed in Version | => 1.5.6.svn |
2020-08-11 20:56 | cbradney | Status | resolved => closed |