View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0012565 | Scribus | Typography | public | 2014-07-28 14:22 | 2016-07-06 21:58 |
Reporter | Gerrit_B | Assigned To | jghali | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | Intel | OS | Windows | OS Version | 7 (NL) |
Product Version | 1.4.4 | ||||
Target Version | 1.5.1 | Fixed in Version | 1.5.1svn | ||
Summary | 0012565: Right alignment of hyphens | ||||
Description | When text is aligned to the right side of the textframe and hyphenation is switched on, a soft hyphen is not placed against the right side of the textframe. If the soft hyphen is replaced by a hard hyphen and follow by a line break, the result is as might be expected. When Optical Margins are applied to the right, the hyphen is placed as it should be. (See the attached .odt file for screendumps.) | ||||
Steps To Reproduce | Obvious | ||||
Tags | HOST-Oman, layout | ||||
Patch | Yes | ||||
|
|
|
I think this is a duplicate, right? |
|
With the #layout tag we also got 0010720 : "Right-aligned text does not work as expected with some fonts." 0010720 is not about hyphens, but i mention the hyphen phenomenon in one of its comments. I suggest we keep both open since they seems different however related. |
|
I tried to modify the hyphenation so that can work with optical frame option. please chick the attachment. |
|
ibrahim, i cannot say if this patch does what you think it does. but by reading it, i cannot be confident that you understood what you are doing: from a logical (mathematical logic!) point of view it does not really make sense to first check for a value being different than something *and* then being equal to something else. can you please explain why you think your patch solves this issue and provide a patch that is also "logically" correct? |
|
Perhaps I understand it wrongly. please correct me if I am wrong. the solution of this issue is to 1)remove the small space between the soft hyphen and the right side of the text frame. 2)making sure that the behaviour of the soft hyphen be like the hard hyphen after adding optical margin. |
|
In the patch,if (currentCh != '-' && currentCh == SpecialChars::SHYPHEN)" is quite silly code. Please fix that first. |
|
I fixed it and attach it again. Can you review it again.. |
|
updated_Shyphen.diff (823 bytes)
Index: scribus/pageitem_textframe.cpp =================================================================== --- scribus/pageitem_textframe.cpp (revision 20493) +++ scribus/pageitem_textframe.cpp (working copy) @@ -2753,7 +2753,7 @@ itemText.setFlag(a, ScLayout_SoftHyphenVisible); glyphs->grow(); glyphs->more->glyph = font.char2CMap(QChar('-')); - glyphs->more->xadvance = font.charWidth('-', itemText.charStyle(a).fontSize() / 10.0) * scaleH; //FIX ME - hyphen is not rendered with proper width - check yhis with large glyphs horizontal scaling eg. 20% + glyphs->more->xadvance = font.charWidth('-',0) * scaleH; //FIX ME - hyphen is not rendered with proper width - check yhis with large glyphs horizontal scaling eg. 20% hyphWidth = glyphs->more->xadvance; } else |
|
The Idea of this patch is that Scribus when it run and reach this following line: glyphs->more->xadvance = font.charWidth('-', itemText.charStyle(a).fontSize() / 10.0) * scaleH; The function charWidth receives the width of hyphen (font size) and but it is more space at the end of the line. So, I removed the hyphen width and replace it with 0 then I end with a good results |
|
2 questions and 1 advice : 1) I'm not sure : isn't font.charWidth('-',0) allways equal to 0 ? That would make your code simpler. 2) in the changed line, there is an explicit comment advising to "test with large glyphs horizontal scaling eg. 20%". Have you done so and did you try your patch, as advised, with "large glyphs horizontal scaling eg. 20%" ? This horizontal scaling is to be set in the property palette text subtab. 3) in case your patch really fix the issue, the comment should be deleted since the code isnt to be fixed anymore. Isnt ? |
|
Any answers Ibrahim ? |
|
Sorry for delay 1) Yes I checked It today and I found that it always 0.\ 2) I did not understand what he mean by "test with large glyphs horizontal scaling eg. 20%" |
|
1) Then your patch can be made more simple 2) Horizontal scaling of glyphs is a setting in the "Advanced" subpane of the "Text" pane of the property palette (F2). It can also be set in the character style definition (F3). A large horizontal scaling will have big effects on horizontal computations since glyphs take more rooms than with a normal scaling. Can you test your patch with a text that has such a big horizontal scaling, and say your patch also fixes the right alignment of hyphens in such a case ? |
|
Ok I understand now, I tested and it is fine. |
|
> I tested and it is fine. Not really. A quick test shows that the patch break layout when text is aligned on both sides. |
|
>Not really. A quick test shows that the patch break layout when text is aligned on both sides. Could you elaborate more? and tell me what is the right behaviour which is supposed to be, because I don't see any problem. |
|
I mean that your fix doesn't work and produce incorrect layout when using other alignment that the right alignment. I've found what seems a proper fix. See comment in commit r20618. |
|
Link for the lazy: https://github.com/scribusproject/scribus/commit/61c039bcdfa144a71ad1d43e6b92d1485d49c824#diff-28265c389e29824ffd6d6825f8255fcfR2781 |
|
Thanks guys, makes a nice birthday present! |
|
jluc, can you test to confirm fix? thx! |
Date Modified | Username | Field | Change |
---|---|---|---|
2014-07-28 14:22 | Gerrit_B | New Issue | |
2014-07-28 14:22 | Gerrit_B | File Added: Alignment bug Scribus 1.4.4. - 18-7-2014.odt | |
2014-07-28 16:44 | Kunda | Note Added: 0033056 | |
2014-07-28 21:37 | JLuc | Tag Attached: layout | |
2014-07-28 21:44 | JLuc | Note Added: 0033063 | |
2014-07-29 13:52 | Kunda | Relationship added | related to 0012346 |
2014-07-29 13:52 | Kunda | Relationship added | related to 0010720 |
2014-07-29 13:53 | Kunda | Status | new => confirmed |
2014-07-29 13:53 | Kunda | Target Version | => 1.5.1 |
2014-10-04 16:13 | JLuc | Relationship added | related to 0011071 |
2015-11-01 07:35 | ibrahim | Tag Attached: HOST-Oman | |
2015-11-01 09:27 | ibrahim | File Added: updated_hyphen.diff | |
2015-11-01 09:28 | ibrahim | Note Added: 0037142 | |
2015-11-01 15:27 | JLuc | Patch | => Yes |
2015-11-05 12:29 | Kunda | Sticky Issue | No => Yes |
2015-11-06 13:23 | ale | Note Added: 0037281 | |
2015-11-06 13:25 | ale | Note Edited: 0037281 | |
2015-11-06 13:25 | ale | Note Edited: 0037281 | |
2015-11-10 11:10 | ibrahim | Note Added: 0037379 | |
2015-11-10 14:32 | JLuc | Note Added: 0037383 | |
2015-11-11 08:35 | ibrahim | File Deleted: updated_hyphen.diff | |
2015-11-12 08:07 | ibrahim | File Added: updated_Shyphen.diff | |
2015-11-12 09:19 | ibrahim | Note Added: 0037446 | |
2015-11-17 08:15 | ibrahim | File Deleted: updated_Shyphen.diff | |
2015-11-17 08:15 | ibrahim | File Added: updated_Shyphen.diff | |
2015-11-17 08:30 | ibrahim | Note Added: 0037527 | |
2015-11-17 09:08 | JLuc | Note Added: 0037528 | |
2015-11-17 09:12 | JLuc | Note Edited: 0037528 | |
2015-11-23 11:48 | JLuc | Note Added: 0037602 | |
2015-11-24 05:49 | ibrahim | Note Added: 0037631 | |
2015-11-24 10:02 | JLuc | Note Added: 0037639 | |
2015-11-24 10:04 | JLuc | Note Edited: 0037639 | |
2015-11-24 10:04 | JLuc | Note Edited: 0037639 | |
2015-11-24 10:40 | ibrahim | Note Added: 0037640 | |
2015-12-01 22:35 | jghali | Note Added: 0037780 | |
2015-12-07 06:01 | ibrahim | Note Added: 0037844 | |
2015-12-12 13:59 | jghali | Note Added: 0037899 | |
2015-12-12 13:59 | jghali | Status | confirmed => resolved |
2015-12-12 13:59 | jghali | Fixed in Version | => 1.5.1svn |
2015-12-12 13:59 | jghali | Resolution | open => fixed |
2015-12-12 13:59 | jghali | Assigned To | => jghali |
2015-12-12 13:59 | jghali | Sticky Issue | Yes => No |
2015-12-12 23:10 | Kunda | Note Added: 0037903 | |
2015-12-13 11:33 | g.bruijnes | Note Added: 0037908 | |
2016-01-18 15:43 | Kunda | Note Added: 0038251 | |
2016-01-23 17:16 | cbradney | Target Version | 1.5.1 => 1.5.3 |
2016-01-23 17:38 | Kunda | Target Version | 1.5.3 => 1.5.1 |
2016-02-13 19:51 | cbradney | Status | resolved => closed |
2016-07-06 21:58 | jghali | Issue cloned: 0014206 |