r21272 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Mon May 2 20:45:11 UTC 2016


Author: jghali
Date: Mon May  2 20:45:11 2016
New Revision: 21272

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21272
Log:
#14015: Hyphen displayed as a slash

Modified:
    trunk/Scribus/scribus/pageitem_textframe.cpp

Modified: trunk/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21272&path=/trunk/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_textframe.cpp	(original)
+++ trunk/Scribus/scribus/pageitem_textframe.cpp	Mon May  2 20:45:11 2016
@@ -2598,8 +2598,16 @@
 				{
 					if (current.breakIndex >= 0)
 					{
+						// go back to last break position
 						i = current.breakIndex;
 						a = glyphRuns[i].firstChar();
+						style = itemText.paragraphStyle(a);
+						const_cast<ScFace&>(font) = itemText.charStyle(a).font();
+						if (style.lineSpacingMode() == ParagraphStyle::AutomaticLineSpacing)
+							style.setLineSpacing(font.height(hlcsize10) * autoLS);
+						else if (style.lineSpacingMode() == ParagraphStyle::BaselineGridLineSpacing)
+							style.setLineSpacing(m_Doc->guidesPrefs().valueBaselineGrid);
+						charStyle = itemText.charStyle(a);
 					}
 					assert( i >= 0 );
 					assert( i < glyphRuns.length() );
@@ -2607,13 +2615,6 @@
 					current.isEmpty = (i - current.line.firstRun + 1) == 0;
 					if (current.addLine)
 					{
-						// go back to last break position
-						style = itemText.paragraphStyle(a);
-						if (style.lineSpacingMode() == ParagraphStyle::AutomaticLineSpacing)
-							style.setLineSpacing(font.height(hlcsize10) * autoLS);
-						else if (style.lineSpacingMode() == ParagraphStyle::BaselineGridLineSpacing)
-							style.setLineSpacing(m_Doc->guidesPrefs().valueBaselineGrid);
-
 						if (itemText.text(a) == ' ') {
 							glyphRuns[i].setFlag(ScLayout_SuppressSpace);
 							glyphRuns[i].glyphs()[0].xadvance = 0;
@@ -2635,7 +2636,7 @@
 							glyphRuns[i].setFlag(ScLayout_SoftHyphenVisible);
 							GlyphLayout hyphen;
 							hyphen.glyph = font.char2CMap(QChar('-'));
-							hyphen.xadvance = font.glyphBBox(hyphen.glyph, itemText.charStyle(a).fontSize() / 10.0).width;
+							hyphen.xadvance = font.glyphBBox(hyphen.glyph, charStyle.fontSize() / 10.0).width;
 							hyphWidth = hyphen.xadvance * scaleH;
 							glyphRuns[i].glyphs().append(hyphen);
 						}




More information about the scribus-commit mailing list