View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0011628 | Scribus | General | public | 2013-06-24 14:56 | 2017-06-10 13:22 |
Reporter | JLuc | Assigned To | avox | ||
Priority | normal | Severity | crash | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 1.5.0svn | ||||
Fixed in Version | 1.5.0svn | ||||
Summary | 0011628: Layout issues | ||||
Description | Uploaded doc shows 2 problematic layout strategies when a some obstacle lays on top of a text frame. - First situation shows how the words are broken in parts without any concern for hyphen rules. Should scribus break words without caring langage rules in that specific situation ? - 2nd situation is worse. Notice that first letter is now lower case. It shows how layout is performed for the first line of a text frame (but same happens for the last line) : letters are laid as long as they fit in the frame and as soon as some part of a letter does not fit (here the upper part of the 'l') then a line break is performed and letters now flow on the next line. Problem is : AFAIK in such a case, there is NO usual WAY to have text flow on a unbroken first line. In case we are not in a linked text frame it is possible to insert a line break at the begining of the frame. But this is kindof a hack rather than a proper solution. And in the case of a linked frame as here, there is no solid solution ! I'm not sure what alternative strategy would be OK. Other DTP program or text editors have various solutions that might be of interest. | ||||
Tags | No tags attached. | ||||
Patch | |||||
|
|
|
|
|
AMOF my real life issue was in the case of a 2 columns text frame : in such a situation its not possible to move the 2nd column's top without moving the first column's top... This happens very frequently, allmost allways, when an image is laid out on top of a text frame. So the solution is to use 2 linked text frames instead of 2 columns text frames ??? :-(( No, i think this behaviour is not correct and has to be improved. I upload new file version. Note that sentences are broken in the same way as in the first situation described here : without caring the langage hyphen rules. |
|
|
|
|
|
This issue happens also without linking texts or with single colum text frames, in a very basic shape as in new uploaded example "bad layout basic" : "Matériel" word is broken after t because é is too high... but only when the barrier is an other frame, not when it is the border of the text frame itself. |
|
|
|
|
|
see also 0004773, 0011727 As 0011727 mentions, the good hyphens placements are not taken care of. |
|
|
|
|
|
I uploaded another sample with strange results : "strange bad layout.sla" that displays how a line is broken at the space between 2 identical words. If there is vertical room for the first word, why is there not enough room for the 2nd (identical) one ? Change "first line offset" in the PP to any of the 4 possibilities, and change the interfering block vertical position aswell, so as to explore various relative positions. |
|
bugfix11727.diff (5,605 bytes)
Index: scribus/pageitem_textframe.cpp =================================================================== --- scribus/pageitem_textframe.cpp (Revision 18464) +++ scribus/pageitem_textframe.cpp (Arbeitskopie) @@ -1503,6 +1503,8 @@ itemText.blockSignals(true); setMaxY(-1); double maxYAsc = 0.0, maxYDesc = 0.0; + int regionMinY = 0, regionMaxY= 0; + double autoLeftIndent = 0.0; for (int a = firstInFrame(); a < itLen; ++a) @@ -2068,14 +2070,19 @@ maxYAsc = qMax(maxYAsc, 0.0); maxYDesc = current.yPos + realDesc; +// regionMinY = static_cast<int>(floor(maxYAsc)); +// regionMaxY = static_cast<int>(floor(maxYDesc)); + regionMinY = static_cast<int>(floor(current.yPos - (asce + offset))); + regionMaxY = static_cast<int>(floor(current.yPos + desc)); + if (current.itemsInLine == 0 && !current.afterOverflow) { //start a new line goNoRoom = false; // find line`s start - pt1 = QPoint(static_cast<int>(floor(current.xPos)), static_cast<int>(floor(maxYAsc))); - pt2 = QPoint(static_cast<int>(floor(current.xPos + (style.minGlyphExtension() * wide))), static_cast<int>(floor(maxYDesc)) -1); + pt1 = QPoint(static_cast<int>(floor(current.xPos)), regionMinY); + pt2 = QPoint(static_cast<int>(floor(current.xPos + (style.minGlyphExtension() * wide))), regionMaxY -1); pt = QRect(pt1, pt2); realEnd = 0; //check if there is overflow at start of line, if so jump behind it and check again @@ -2102,7 +2109,7 @@ //check if in indent any overflow occurs while (Xpos <= Xend && Xpos < current.colRight) { - pt.moveTopLeft(QPoint(static_cast<int>(floor(Xpos)), static_cast<int>(floor(maxYAsc)))); + pt.moveTopLeft(QPoint(static_cast<int>(floor(Xpos)), regionMinY)); if (!regionContainsRect(m_availableRegion, pt)) { Xpos = current.xPos = realEnd = findRealOverflowEnd(m_availableRegion, pt, current.colRight); @@ -2155,7 +2162,12 @@ maxYAsc = current.yPos - realAsce; maxYDesc = current.yPos + realDesc; - pt.moveTopLeft(QPoint(static_cast<int>(floor(current.xPos)), static_cast<int>(floor(maxYAsc)))); +// regionMinY = static_cast<int>(floor(maxYAsc)); +// regionMaxY = static_cast<int>(floor(maxYDesc)); + regionMinY = static_cast<int>(floor(current.yPos - (asce + offset))); + regionMaxY = static_cast<int>(floor(current.yPos + desc)); + + pt.moveTopLeft(QPoint(static_cast<int>(floor(current.xPos)), regionMinY)); done = false; } if (current.isEndOfCol(realDesc)) @@ -2452,13 +2464,13 @@ { if (hl->effects() & ScStyle_HyphenationPossible || hl->ch == SpecialChars::SHYPHEN) { - pt1 = QPoint(charStart, static_cast<int>(floor(maxYAsc))); - pt2 = QPoint(static_cast<int>(charEnd + hyphWidth), static_cast<int>(floor(maxYDesc)) -1); + pt1 = QPoint(charStart, regionMinY); + pt2 = QPoint(static_cast<int>(charEnd + hyphWidth), regionMaxY -1); } else { - pt1 = QPoint(charStart, static_cast<int>(floor(maxYAsc))); - pt2 = QPoint(charEnd, static_cast<int>(floor(maxYDesc)) -1); + pt1 = QPoint(charStart, regionMinY); + pt2 = QPoint(charEnd, regionMaxY -1); } } else if (!legacy && SpecialChars::isBreakingSpace(hl->ch)) @@ -2468,8 +2480,8 @@ } else { - pt1 = QPoint(charStart, static_cast<int>(floor(maxYAsc))); - pt2 = QPoint(charEnd, static_cast<int>(floor(maxYDesc)) -1); + pt1 = QPoint(charStart, regionMinY); + pt2 = QPoint(charEnd, regionMaxY -1); } pt = QRect(pt1, pt2); if (!regionContainsRect(m_availableRegion, pt)) @@ -2635,7 +2647,7 @@ { // find end of line current.breakLine(itemText, style, firstLineOffset(), a); - EndX = current.endOfLine(m_availableRegion, style.rightMargin(), static_cast<int>(floor(maxYAsc)), static_cast<int>(floor(maxYDesc))); + EndX = current.endOfLine(m_availableRegion, style.rightMargin(), regionMinY, regionMaxY); current.finishLine(EndX); //addLine = true; assert(current.addLine); @@ -2712,7 +2724,7 @@ current.updateHeightMetrics(itemText); //current.updateLineOffset(itemText, style, firstLineOffset()); //current.xPos = current.breakXPos; - EndX = current.endOfLine(m_availableRegion, current.rightMargin, static_cast<int>(floor(maxYAsc)), static_cast<int>(floor(maxYDesc))); + EndX = current.endOfLine(m_availableRegion, current.rightMargin, regionMinY, regionMaxY); current.finishLine(EndX); hyphWidth = 0.0; @@ -2958,7 +2970,12 @@ maxYAsc = qMax(maxYAsc, 0.0); maxYDesc = current.yPos + realDesc; - EndX = current.endOfLine(m_availableRegion, style.rightMargin(), static_cast<int>(floor(maxYAsc)), static_cast<int>(floor(maxYDesc))); +// regionMinY = static_cast<int>(floor(maxYAsc)); +// regionMaxY = static_cast<int>(floor(maxYDesc)); + regionMinY = static_cast<int>(floor(current.yPos - (asce + offset))); + regionMaxY = static_cast<int>(floor(current.yPos + desc)); + + EndX = current.endOfLine(m_availableRegion, style.rightMargin(), regionMinY, regionMaxY); current.finishLine(EndX); if (opticalMargins & ParagraphStyle::OM_RightHangingPunct) |
|
Uploaded a fix that solves this one and 11727. The idea is to always use the nominal font ascender / descender when checking the available region for obstacles. Should be tested for regressions. |
|
I applied avox patch with a small change |
Date Modified | Username | Field | Change |
---|---|---|---|
2013-06-24 14:56 | JLuc | New Issue | |
2013-06-24 14:56 | JLuc | File Added: lauout inconveniencies.sla | |
2013-06-24 14:56 | JLuc | File Added: Screenshot test2013-06-24 16:55:25.jpg | |
2013-06-24 15:03 | JLuc | Note Added: 0030342 | |
2013-06-24 15:04 | JLuc | Note Edited: 0030342 | |
2013-06-24 15:05 | JLuc | File Added: bad layout 2 columns.sla | |
2013-06-24 15:06 | JLuc | File Added: Screenshot test2013-06-24 17:06:09.jpg | |
2013-06-24 15:07 | JLuc | Note Edited: 0030342 | |
2013-06-24 15:22 | JLuc | Note Edited: 0030342 | |
2013-06-24 15:22 | JLuc | Note Edited: 0030342 | |
2013-06-24 15:24 | JLuc | Note Edited: 0030342 | |
2013-06-24 15:27 | JLuc | Note Edited: 0030342 | |
2013-07-03 21:25 | JLuc | Note Added: 0030402 | |
2013-07-03 21:25 | JLuc | File Added: bad layout basic.sla | |
2013-07-03 21:25 | JLuc | File Added: bad layout basic.jpg | |
2013-09-08 19:54 | JLuc | Note Added: 0030575 | |
2013-09-09 17:34 | JLuc | Note Edited: 0030575 | |
2013-09-16 16:43 | JLuc | File Added: strange bad layout.sla | |
2013-09-16 16:43 | JLuc | File Added: strange bad layout.png | |
2013-09-16 16:55 | JLuc | Note Added: 0030595 | |
2013-09-16 16:57 | JLuc | Note Edited: 0030575 | |
2013-09-16 17:27 | JLuc | Note Edited: 0030595 | |
2013-09-16 18:20 | avox | File Added: bugfix11727.diff | |
2013-09-16 18:21 | avox | Note Added: 0030596 | |
2013-09-18 22:37 | jghali | Note Added: 0030602 | |
2013-09-18 22:37 | jghali | Status | new => resolved |
2013-09-18 22:37 | jghali | Fixed in Version | => 1.5.0svn |
2013-09-18 22:37 | jghali | Resolution | open => fixed |
2013-09-18 22:37 | jghali | Assigned To | => avox |
2013-10-30 21:39 | cbradney | Status | resolved => closed |
2014-12-24 17:32 | JLuc | Relationship added | parent of 0012861 |
2017-06-10 13:22 | jghali | Relationship added | related to 0014849 |