View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0009848 | Scribus | Styles | public | 2011-03-17 10:30 | 2019-09-28 05:51 |
Reporter | cezaryece | Assigned To | jghali | ||
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | closed | Resolution | no change required | ||
Platform | all | ||||
Product Version | 1.4.0svn | ||||
Target Version | 1.5.4 | ||||
Summary | 0009848: [PATCH, OBSOLETE] Add control for Hyphenation Mode property of Paragraph Style | ||||
Description | Someone add HyphenationMode property for paragraph`s style, but it was not used in any place. In my patch I have add: - control for this property in Style Manager - hyphenator`s work depends on paragraph HyphenationMode property - applying Paragraph Style with other hyphenation mode than AutomaticHyphenation call dehyphenation routine | ||||
Tags | No tags attached. | ||||
Patch | Yes | ||||
child of | 0001279 | feedback | louisdesjardins | Unify settings in Paragraph styles/Properties palette/Text editor |
child of | 0012496 | acknowledged | Metabug: Marks & Footnotes & Weld (1.5.0.svn) |
|
HyphenationModeinParStyle.patch (15,471 bytes)
Index: Scribus/scribus/hyphenator.cpp =================================================================== --- Scribus/scribus/hyphenator.cpp (wersja 16448) +++ Scribus/scribus/hyphenator.cpp (kopia robocza) @@ -215,9 +215,15 @@ while ((firstC+Ccount < signed(text.length())) && (firstC != -1) && (lastC < signed(text.length()))) { + int parHyphMode = it->itemText.paragraphStyle(firstC).hyphenationMode(); firstC = text.indexOf(wordBoundary, firstC+Ccount); if (firstC < 0) break; + if (parHyphMode == ParagraphStyle::NoHyphenation) + { + firstC = it->itemText.endOfParagraph(it->itemText.nrOfParagraph(firstC)); + continue; + } if (firstC > 0 && text.at(firstC-1) == SpecialChars::SHYPHEN) { Ccount = 1; @@ -274,7 +280,7 @@ { if (!hasHyphen) it->itemText.hyphenateWord(startC + firstC, found.length(), NULL); - else if (Automatic) + else if (Automatic && parHyphMode == ParagraphStyle::AutomaticHyphenation) { if (specialWords.contains(found2)) { Index: Scribus/scribus/smpstylewidget.h =================================================================== --- Scribus/scribus/smpstylewidget.h (wersja 16448) +++ Scribus/scribus/smpstylewidget.h (kopia robocza) @@ -47,6 +47,7 @@ void showCStyle(QList<ParagraphStyle*> &pstyles, QList<CharStyle> &cstyles, const QString &defLang, int unitIndex); void showParent(QList<ParagraphStyle*> &pstyles); void setOpticalMargins(int o, bool inhO=false, const ParagraphStyle *parent=NULL); + void showHyphenationMode(QList<ParagraphStyle*> &pstyles); friend class SMParagraphStyle; Index: Scribus/scribus/smpstylewidget.cpp =================================================================== --- Scribus/scribus/smpstylewidget.cpp (wersja 16448) +++ Scribus/scribus/smpstylewidget.cpp (kopia robocza) @@ -7,6 +7,7 @@ #include <QEvent> +#include "styles/paragraphstyle.h" #include "smpstylewidget.h" #include "units.h" #include "util.h" @@ -39,6 +40,10 @@ lineSpacing_->setSuffix(unitGetSuffixFromIndex(0)); spaceAbove_->setSuffix(unitGetSuffixFromIndex(0)); spaceBelow_->setSuffix(unitGetSuffixFromIndex(0)); + + hyphenationMode->addItem(tr("No Hyphenation")); + hyphenationMode->addItem(tr("Manual Hyphenation")); + hyphenationMode->addItem(tr("Automatic Hyphenation")); // optMarginCombo->addItem(tr("None"), ParagraphStyle::OM_None); // optMarginCombo->addItem(tr("Left Protruding"), ParagraphStyle::OM_LeftProtruding); @@ -93,6 +98,7 @@ //dropCapsBox->setToolTip( tr("Enable or disable drop cap")); dropCapLines_->setToolTip( tr("Drop Cap Lines")); dropCapOffset_->setToolTip( tr("Drop Cap Offset")); + hyphenationMode->setToolTip( tr("Hyphenation Mode")); alignement_->setToolTip( tr("Alignment")); tabList_->first_->setToolTip( tr("First Line Indent")); tabList_->left_->setToolTip( tr("Left Indent")); @@ -117,6 +123,10 @@ lineSpacingMode_->addItem( tr("Automatic Linespacing")); lineSpacingMode_->addItem( tr("Align to Baseline Grid")); + hyphenationMode->addItem(tr("No Hyphenation")); + hyphenationMode->addItem(tr("Manual Hyphenation")); + hyphenationMode->addItem(tr("Automatic Hyphenation")); + // optMarginCombo->clear(); // optMarginCombo->addItem(tr("None"), ParagraphStyle::OM_None); // optMarginCombo->addItem(tr("Left Protruding"), ParagraphStyle::OM_LeftProtruding); @@ -140,6 +150,7 @@ glyphExtensionLabel->setText(tr("Glyph Extension")); minGlyphExtLabel->setText(tr("Min:", "Glyph Extension")); maxGlyphExtLabel->setText(tr("Max:", "Glyph Extension")); + hyphenationModeLabel->setText(tr("Hyphenation Mode")); } void SMPStyleWidget::unitChange(double oldRatio, double newRatio, int unitIndex) @@ -159,7 +170,13 @@ lineSpacingMode_->addItem( tr("Fixed Linespacing")); lineSpacingMode_->addItem( tr("Automatic Linespacing")); lineSpacingMode_->addItem( tr("Align to Baseline Grid")); + + hyphenationMode->clear(); + hyphenationMode->addItem(tr("No Hyphenation")); + hyphenationMode->addItem(tr("Manual Hyphenation")); + hyphenationMode->addItem(tr("Automatic Hyphenation")); + // optMarginCombo->clear(); // optMarginCombo->addItem(tr("None"), ParagraphStyle::OM_None); // optMarginCombo->addItem(tr("Left Protruding"), ParagraphStyle::OM_LeftProtruding); @@ -214,6 +231,8 @@ dropCapOffset_->setValue(pstyle->dropCapOffset() * unitRatio, pstyle->isInhDropCapOffset()); dropCapOffset_->setParentValue(parent->dropCapOffset() * unitRatio); + + hyphenationMode->setCurrentItem(pstyle->hyphenationMode(), pstyle->isInhHyphenationMode()); alignement_->setStyle(pstyle->alignment(), pstyle->isInhAlignment()); alignement_->setParentItem(parent->alignment()); @@ -255,6 +274,7 @@ dropCapLines_->setValue(pstyle->dropCapLines()); dropCapOffset_->setValue(pstyle->dropCapOffset() * unitRatio); parentDropCapButton->hide(); + hyphenationMode->setCurrentItem(pstyle->hyphenationMode()); alignement_->setStyle(pstyle->alignment()); tabList_->setTabs(pstyle->tabValues(), unitIndex); tabList_->setLeftIndentValue(pstyle->leftMargin() * unitRatio); @@ -759,6 +779,25 @@ } } +void SMPStyleWidget::showHyphenationMode(QList<ParagraphStyle*> &pstyles) +{ + if(pstyles.isEmpty()) + { + qDebug()<<"Warning showMaxGlyphExt called with an empty list of styles"; + return; + } + int hm = (pstyles[0]->hyphenationMode()); + for (int i = 0; i < pstyles.count(); ++i) + { + if (hm != (pstyles[i]->hyphenationMode())) + { + hyphenationMode->setCurrentItem(pstyles[i]->hyphenationMode()); + return; + } + } + hyphenationMode->setCurrentItem(hm); +} + void SMPStyleWidget::slotDefaultOpticalMargins() { // optMarginCheckLeftProtruding->setChecked(false); Index: Scribus/scribus/smtextstyles.h =================================================================== --- Scribus/scribus/smtextstyles.h (wersja 16448) +++ Scribus/scribus/smtextstyles.h (kopia robocza) @@ -75,6 +75,7 @@ void slotDropCap(bool isOn); void slotDropCapLines(int lines); void slotDropCapOffset(); + void slotHyphenationMode(int hm); void slotSpaceAbove(); void slotSpaceBelow(); void slotAlignment(); Index: Scribus/scribus/scribusdoc.cpp =================================================================== --- Scribus/scribus/scribusdoc.cpp (wersja 16448) +++ Scribus/scribus/scribusdoc.cpp (kopia robocza) @@ -5415,7 +5414,9 @@ ParagraphStyle newStyle; newStyle.setParent(name.isEmpty()? Style::INHERIT_PARENT : name); itemSelection_ApplyParagraphStyle(newStyle, customSelection, true); + if (newStyle.hyphenationMode() != ParagraphStyle::AutomaticHyphenation) + itemSelection_DoDeHyphenate(); } Index: Scribus/scribus/smpstylewidget.ui =================================================================== --- Scribus/scribus/smpstylewidget.ui (wersja 16448) +++ Scribus/scribus/smpstylewidget.ui (kopia robocza) @@ -326,95 +327,126 @@ </widget> </item> <item> - <widget class="QToolButton" name="parentDropCapButton" > - <property name="enabled" > + <widget class="QToolButton" name="parentDropCapButton"> + <property name="enabled"> <bool>true</bool> </property> - <property name="text" > + <property name="text"> <string>Use Parent Value</string> </property> </widget> </item> <item> <spacer> - <property name="orientation" > + <property name="orientation"> <enum>Qt::Vertical</enum> </property> - <property name="sizeType" > + <property name="sizeType"> <enum>QSizePolicy::MinimumExpanding</enum> </property> - <property name="sizeHint" stdset="0" > + <property name="sizeHint" stdset="0"> <size> <width>272</width> - <height>0</height> + <height>13</height> </size> </property> </spacer> </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_7"> + <item> + <widget class="QLabel" name="hyphenationModeLabel"> + <property name="text"> + <string>Hyphenation Mode</string> + </property> + </widget> + </item> + <item> + <widget class="SMScComboBox" name="hyphenationMode"> + <property name="text" stdset="0"> + <string>Disable Hyphenation</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> </layout> </item> <item> - <layout class="QVBoxLayout" name="verticalLayout_3" > + <layout class="QVBoxLayout" name="verticalLayout_3"> <item> - <widget class="QGroupBox" name="groupBox" > - <property name="font" > + <widget class="QGroupBox" name="groupBox"> + <property name="font"> <font> <weight>50</weight> <bold>false</bold> </font> </property> - <property name="title" > + <property name="title"> <string>Optical Margins</string> </property> - <layout class="QFormLayout" name="formLayout" > - <property name="fieldGrowthPolicy" > + <layout class="QFormLayout" name="formLayout"> + <property name="fieldGrowthPolicy"> <enum>QFormLayout::AllNonFixedFieldsGrow</enum> </property> - <item row="4" column="1" > - <layout class="QHBoxLayout" name="horizontalLayout_4" > + <item row="4" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_4"> <item> - <widget class="QPushButton" name="optMarginDefaultButton" > - <property name="text" > + <widget class="QPushButton" name="optMarginDefaultButton"> + <property name="text"> <string>Reset to Default</string> </property> </widget> </item> <item> - <widget class="QPushButton" name="optMarginParentButton" > - <property name="text" > + <widget class="QPushButton" name="optMarginParentButton"> + <property name="text"> <string>Use Parent Value</string> </property> </widget> </item> </layout> </item> - <item row="0" column="1" > - <widget class="SMRadioButton" name="optMarginRadioNone" > - <property name="text" > + <item row="0" column="1"> + <widget class="SMRadioButton" name="optMarginRadioNone"> + <property name="text"> <string>None</string> </property> - <property name="checked" > + <property name="checked"> <bool>true</bool> </property> </widget> </item> - <item row="1" column="1" > - <widget class="SMRadioButton" name="optMarginRadioBoth" > - <property name="text" > + <item row="1" column="1"> + <widget class="SMRadioButton" name="optMarginRadioBoth"> + <property name="text"> <string>Both Sides</string> </property> </widget> </item> - <item row="2" column="1" > - <widget class="SMRadioButton" name="optMarginRadioLeft" > - <property name="text" > + <item row="2" column="1"> + <widget class="SMRadioButton" name="optMarginRadioLeft"> + <property name="text"> <string>Left Only</string> </property> </widget> </item> - <item row="3" column="1" > - <widget class="SMRadioButton" name="optMarginRadioRight" > - <property name="text" > + <item row="3" column="1"> + <widget class="SMRadioButton" name="optMarginRadioRight"> + <property name="text"> <string>Right Only</string> </property> </widget> Index: Scribus/scribus/smtextstyles.cpp =================================================================== --- Scribus/scribus/smtextstyles.cpp (wersja 16448) +++ Scribus/scribus/smtextstyles.cpp (kopia robocza) @@ -509,6 +509,8 @@ connect(pwidget_->dropCapLines_, SIGNAL(valueChanged(int)), this, SLOT(slotDropCapLines(int))); connect(pwidget_->dropCapOffset_, SIGNAL(valueChanged(double)), this, SLOT(slotDropCapOffset())); + connect(pwidget_->hyphenationMode, SIGNAL(activated(int)), this, SLOT(slotHyphenationMode(int))); + connect(pwidget_->tabList_, SIGNAL(tabsChanged()), this, SLOT(slotTabRuler())); connect(pwidget_->tabList_, SIGNAL(mouseReleased()), this, SLOT(slotTabRuler())); connect(pwidget_->tabList_->left_, SIGNAL(valueChanged(double)), this, SLOT(slotLeftIndent())); @@ -581,6 +583,8 @@ disconnect(pwidget_->dropCapLines_, SIGNAL(valueChanged(int)), this, SLOT(slotDropCapLines(int))); disconnect(pwidget_->dropCapOffset_, SIGNAL(valueChanged(double)), this, SLOT(slotDropCapOffset())); + disconnect(pwidget_->hyphenationMode, SIGNAL(activated(int)), this, SLOT(slotHyphenationMode(int))); + disconnect(pwidget_->parentCombo, SIGNAL(activated(const QString&)), this, SLOT(slotParentChanged(const QString&))); @@ -894,6 +898,18 @@ } } +void SMParagraphStyle::slotHyphenationMode(int mh) +{ + for (int i = 0; i < selection_.count(); ++i) + selection_[i]->setHyphenationMode(mh); + + if (!selectionIsDirty_) + { + selectionIsDirty_ = true; + emit selectionDirty(); + } +} + void SMParagraphStyle::slotTabRuler() { if (pwidget_->tabList_->useParentTabs()) |
|
I dont know how to gently solve problem of changing this property for existing styles and text using it. Now there is no control or check if any text is using that style and need be hyphenated or dehyphenated. It may be done in few ways - action in menu for rehyphenating all text in doc - action called on applying style`s changes - any automatic action - only user manual hyphenation/dehyphenation (like now) What is better? |
|
Longer I am thinking about it, I am starting to prefer menu entry for script/routine for re-hyphenation, and like in Short Words dialogue box, there should be setting for doing it for frame, page or whole document. |
|
In its current form, this patch is too intrusive and would quite likely damage existing documents. Hyphenation via styles should only be available for new docs if the user activates the feature. |
|
IMHO user should be informed that styles has no information about hyphenation mode and that there is possibility to set it to enable/disable hyphenation for desire styles. But while opening these old docs as default value of hyphenation mode in style should be set hyphenation setting for document. What you think? |
|
I am not able to see the patch and to see Scribus work with it but in any event I have worked on a UI file that could be of help maybe. The idea is quite simple: users can create as many “Typographic colour” sets as they wish to accomplish the desired typographic colour. Scribus would ship with a few predefined sets. The idea is to save those sets that could be seen as substyles, usable in a paragraph style. Since one image is worth a thousand word, I provide here the .ui file. Get back to me if further details are needed. |
|
|
|
Hi Louis! Two questions: - what's group tracking? Not character spacing, is it? - "No hyphen on last word of pages" - shouldn't that be "of frames" ? If you have several text frames on a page you need extra rules to determine the "last word". Comments: - when we have mixin-styles that could be just part of a paragraph style - what about widows/orphans settings? - we'll probably have a "maximum word spacing" setting in the future, too - do we need a separate hyphenation language that is different from the spell-checking language? - We should use "word spacing" instead of "word tracking" |
|
"do we need a separate hyphenation language that is different from the spell-checking language?" No if we can set language for whole style, which will affect hyphenation and spell-checker (what about short-words and quotes chars?). For me language should be applicable locally on demand for selected text from PP. BTW all char and paragraph styles settings should be applicable locally for selected text without creating new style. But all that discus is only near report topic... What about commit this patch just as is? For old documents (there is no direct settings about hyphenation) default value from document hyphenation setting should be set. |
|
Cezary, its obvious from the mailing list that there are people using 1.5.0 for normal work. There must be a way to tell Scribus to keep current hyphenation and not use Paragraph style based hyphenation. Also, have you considered the opening of 1.3.x/1.4.x created documents and the effect that this patch would have on them. Remember, people like John Culleton create in 1.4.0svn and export with 1.5.0 for the PDF export options. |
|
I just saw my answers disappear with an error from the server… I will not re-write tonight but will later on. Andreas, please stay tuned! |
|
@cbradney: do you expect some problems with 1.5.0 with porting that patch to it? I can prepare two patches if it helps. As I wrote before - if while opening there is not direct set of hyphenation property for style then should be used default setting for document for each style. Simply and efficiency. In fact I have some fixes in my local Scribus used for production where I am testing my patches, so I must provide new patch (specially fix how to get not hyphenated paragraphs - not by avoid hyphenation in hyphenator but enabling or disabling hyphenation while formatting lines - seems it works much better and is easier while changing hyphenation setting for style). But there must be agreement for that feature at start. |
|
Hi Andreas! Here is a bit more info about the Typographic Colour feature. I had already wrote that in a discussion earlier this summer and I realize you were not in the loop. So I repost this email here where it will be much more helpful to pursue the discussion! I am not forgetting to get back with answers to your specific questions. For now here is the email that was sent along with the .ui file that is now available here on the bugtracker. Hello everyone, Some further thoughts I would like to share in the form of a new dialog I created using Qt-design for Scribus. "Typographic Colour" is constantly coming to the surface from time to time so I thought of getting into this further. Some links below. It's a long time shot since I believe we should have some way to simplify the work and get more consistent results with type. So here is what I suggest. First, we need a new menu in Edit > Typographic Colour This will bring up the dialog attached here. Filling this dialog and hitting ok will add a new "Typographic Color Set" in the top window of the dialog. By default, Scribus will ship with 4 basic settings that can of course be edited at will by the users: No hyphenation | Tight Justification | Medium Justification | Loose Justification. Or users can add to this short list they own Set. For the sake of the explanation, let's say we have those 4 basic settings. They constitute 4 options that will then appear in the Property Palette as Typographic Color. Users can select one of them from a new pull-down menu that will either be added to the PP or — my preference so far — be replacing the actual tabs for Optical Margins and for Advanced Settings (except the 3 fields that are more Type Effects than anything else in my view but this is highly debatable! and that we can move elsewhere in the PP [we will have more room with my suggestion]). Last minute thought! We could even propose 6 settings with the application since the settings for word tracking and glyph extension works so well we could then have the following 6 basic settings which, when chosen by the users, would ensure top quality typography. Without Hyphenation Tight Justification No Hyphen | Medium Justification No Hyphen | Loose Justification No Hyphen With Hyphenation Tight Justification With Hyphen | Medium Justification With Hyphen | Loose Justification With Hyphen Basically, we want to help the user by putting in his/her hand a powerful tool that will help achieve outstanding Typographic Color for body text with a single command in the PP while leaving all the room to create more Sets, as the work demands it. Once the user is happy with the result, all the type settings, including this Typographic Color can be synthetised into a single Paragraph Style Sheet. The Typographic Color pull down menu will also appear in the Create Paragraph Style dialog in replacement of all the separate settings that is currently crowding this dialog. Now, we may not want this in a new submenu of the Edit menu. I also gave this some thoughts. Since we're using the Prefs to deal with such lists (I am thinking of the list of custom document sizes), the other place where this could fit would obviously be in the Prefs. The behaviour would be the same. The list created there would appear in both the PP and in the Paragraph Style Dialog. We could apply it as any other settings — like a color or a pattern or make it part of a Paragraph Style Sheet. Easy. So, this dialog I am proposing now is a first draft. It can be turned into a Prefs window that would include the 3 main settings that affect the Typographic Color: Optical Margins, Tracking and Glyph Extension... and Hyphenation. You will note that I have removed 2 options for Optical Margins as I assume it has no effect when there are no hanging punctuation or hyphens on one side. So, unless I miss something, I see no reason to have the Right Only, Left Only and Both Sides distinction. It doesn't matter! The settings in my view is either ON or OFF and applies to both sides since only one side will be affected anyway, depending on the language being a Left-Right or a Right-Left language. Let me know if what I assume is wrong. You will also note that I have added a couple more settings for Hyphenation. These are missing since the beginning. I have also removed the dinosaurs which are the 2 options Suggestions of Hyphenation and Hyphenate when Typing. They make simply no sense and we warn users not to use those settings so we better take them away. Let me know what you think! Louis http://en.wikipedia.org/wiki/Typography#Color http://fr.wikipedia.org/wiki/Gris_typographique http://de.wikipedia.org/wiki/Grauwert |
|
This topic is related to 0008805. Implementation of this feature would resolve 0008243. I have some remarks to this solution: 1) There is no need for six default settings of Typographics Colour. One style is sufficient. Other styles can be created by user when would be needed. 2) New dialog in Edit > Typographic Colour is nearly perfect and implementation the stylying into PP and Styles as well. What is really nonsense is removing optical margins. Margins and the rest of the features in Advanced Settings should be kept the same way as now. So remove "Use optical margins" from UI proposition and keep Optical Margins and the rest of the Advanced Settings. PP should be redesigned because it contains a lot of blank space. 3) After the implementation, Extras > Hyphenate Text, Dehyphenate Text could be removed. |
|
Hi Mike, 1. The reason for 6 defaults settings is to make people at ease and make them *use* the feature. If someone finds this is too much or too little, the only thing needed then is to edit that list. A job might require that there is no hyphens at all and there is still the need to have uniformity in typographic colour. The other variable of importance once you have isolated the font, font size and linespacing is the width of composition. Hence those 3 settings for each of Hyphenated or Not hyphenated text. 2) I think that Optical Margins are part of the settings that help accomplish professional typographic colour. Again, this is something people might just not use because they don’t know what it's for. Also, why I took away the right or left options is only because my understanding of the feature makes me believe that if there is nothing to hang on one of the sides, selecting rigth or left will make no difference and can in fact lead to errors. Hence the choice of simplifying and letting only On or Off by the mean of a single checkbox. I would keep it there in the new dialog however I have no strong opinion on keeping it in the PP as a distinct settings but one has to consider that if we're going to use this settings, it’s more than probable that it’s going to be *along with* the variables that affect the quality of typography? Why would someone use Optical Margins without dealing with the other variables at the same time? 3) Right. |
|
Hi louisdesjardins. I was thinking about implementation of this missing feature once again. Is really necessary to create Typographics Colour dialog? Other solution: - repair Word Traking, Min. and Norm. in Style manager (not related to this feature) - add "Hyphenation" + list with styles to the character style dialog bellow Language - create Edit > Hyphenation Styles or implement GUI directly into Style manager (better) - Hyphenation Style would be bellow the Character Style item. - other options would remain unchanged |
|
|
|
Hi Mike, The purpose of that dialog is to make more accessible and more usable a whole set of features more easily than having to reset them for every paragraph style needed. Create a style and grab the typographic colour that fits the needs according to easy-to-understand naming. Plus, this approach makes it easy to be consistent from document to document. As I see that, in the paragraph style dialog you would only be shown the list from which to pick the desired typographic colour. So, one pulldown menu instead of the whole thing, still you can easily access the settings for fine-tuning, through that new dialog. It's pretty convenient in my view. |
|
Two questions at the beginning: Will this patch somehow resolve the situation when image is at the bottom of page and text flows around the image, but frame doesn't end? ...something like "No Hyphen on Last Word of Column". And second question: What is Group Tracking? There are some bugs in your UI: - Delete button is missing. - No Hyphen on Last Word of Pages > Frame For me, the proposed solution is less accessible than creating only Hyphenation Styles. Optical Margins, Language, Word Tracking, Glyph Extension I would prefer to have separately - directly in Paragraph/Character Styles. Example one: For bilingual document you must doubled the number of Typographic Colour and Styles too. When you would have only Hyphenation Styles, there would be the same number of Hyphenation Styles as for document written only in one language => language should be property of Character Style. Example two: You have a simple book. Headlines: no hyphenation + some settings of glyph extension and word tracking, opt. margins; Normal text: hyphenation + settings2; Footnotes: hyphenation + settings3; Image caption: no hyphenation + settings4. So you have 4 Typographic Clour Styles. If you use Hyphenation Styles, only 2 are necessary - hyphenation, no hyphenation. Other properties is possible to inherit via Styles. I think, more users should say how they are working with Scribus. |
|
Sorry for the confusion about Group Tracking. I took the field that already exists in the "Advanced Settings" subtab of the Text tab in the PP. The new mockup doesn’t have the icon itself which should replace the plain text I put in the mockup but it is the exact same thing. It's arguable whether we need that in that new dialog or not but for the moment, I prefer to leave it there. It can be removed in a breeze without affecting the dialog. In answer to Andreas' questions: 1. That was the now late Group Tracking. Thanks for being patient! :-) 2. I have fixed the Last Word of Frames. Nice call! Thanks! In answer to Mike's comments: I completely understand that you would prefer to have those settings in a distinct dialog and your example of a bilingual (or more) document is nice but in my view, considering just how much languages are different, make or not extensive use of capital letters or longer or shorter words, not mentioning the diacritics signs and the typographic spaces, that for each language there would have to be nonetheless a need for a new Typographic Colour set. Those settings are somewhat bound together. For headlines is see no real interest for Typographic Colour. Remember it is meant for body text. It can be of course used for everything else but will prove its efficiency when Typographic Color is at stake. |
|
|
|
Looking at your proposal for Hyphenation Style I think that we must keep in mind the final result. Typographic Colour is the real challenge here. Not hyphenation. Hyphenation is one variable in the whole process and isolating it in a specific dialog will, in my view, not help more to accomplish what needs to be done. People might just forget that it exists just like they do now. Or they will not use the Advanced Settings. All this is of no real help, is it? What we need here is a holistic approach! |
|
Hi Andreas, You wrote a few comments a couple weeks ago and I reproduce them only to facilitate the follow up! Comments: Andreas - when we have mixin-styles that could be just part of a paragraph style Louis - Right, this is what I envision too. Andreas - what about widows/orphans settings? Louis - Still possible but not part of this dialog Andreas - we'll probably have a "maximum word spacing" setting in the future, too Louis - This would be wonderful. Maybe I should add it to the dialog? This is clearly part of the Typographic Colour. More below. Andreas - do we need a separate hyphenation language that is different from the spell-checking language? Louis - I think these go together and if not it would be exceptional, no? Andreas - We should use "word spacing" instead of "word tracking" Louis - In my understanding, "word tracking" refers to letterspacing within each word and the envisioned "word spacing" refers to the space between words. You might just want that: keep a distance between words (this will of course have more effect on non-justified text) while tightening the tracking. The one example that comes readily to mind is when you set type for kids learning to read. Schoolboards ask for an increased spacing between words. Being able to set that space would be more than nice. |
|
Where are we up to now with this request? Is there consensus on the issues and does the current version of the patch cover them? Has it been properly tested and does it apply and work on 1.4.1svn ? |
|
No, that patch is outdated. Working on text layout routine I have found nicer way for controlling hyphenation from paragraph styles setting during text formatting routine. Now I am working hard on foot/endnotes feature for 1.5, but I try to take a break and prepare new patch for hyphenation control. I don`t know about consensus. I would like to provide simply way for controlling hyphenation for paragraphs for headers (most common case). Luis idea is maybe good, but it is enhancement for all typography settings and control - should be requested separatelly, not instead my proposal. |
|
I agree with cezaryece. This request should solve only the patch. Additional features should be requested in separated bug. I think there is no consensus. Solution as Louis proposed is not so effective for me so I proposed other solution of the missing feature. |
|
Ok, understood.. However, we need to be clear on the direction for 1.4.0 - stable, well tested fixes will be accepted. Features will be considered only if thoroughly tested and not wide reaching. I'd suggest a patch for a fix for 1.4.1.svn and a patch for a feature set for 1.5.0.svn. Please also note we need to get 1.5.0.svn stabilised, so patches there need to be tested and proven, and 90-100% complete (assuming a reality exists where the remaining % can be completed quickly). |
|
Acting on hyphenation only, within a style, might seem interesting but it is not the way to go in my view. It's like considering the motor without the transmission, or vice versa. Only so it's clear, I am really not talking for myself alone here and not trying as well to solve a case of a unique individual but in fact learning from over 25 years of experience with dtp, text formatting, magazines and books making, all text intensive work, including multilingual documents. Hyphenations are one part of the equation here. |
|
Hi Louis, please consider a separate feature request for typo. color. Thanks |
|
Hi Stefan, I don't understand how a separate feature request would help this discussion. I think I'm clearly on target. I am not reinventing the wheel. Aside from a very few options that are still not available in both the Advanced Settings for Text (in the PP) and the Hyphenation dialog, I suggest we make them work together in a logical way. Adobe InDesign and QuarkXPress are working just the same as I suggest. The only real novelty here is the way to name the option which I think is better named by the final result than by naming each mechanism by its name. So I go for Typographic Colour that translates very well into other languages as it is a typographic reality designers are facing in their everyday work. |
|
Typographic colour, however probably means absolutely nothing to a beginner.. but I don't mind if some docs are written about it if it is added. Still.. this bug relates to certain hyphenation issues, and not about additional ideas necessarily. Hijacking bugs causes them to never get fixed or for a fix to take too longer. a) Do we want this fixed as described via the bug description? (If no->close the bug) b) Is this patch complete and does this patch do what it is intended? c) Does it break anything else ? (which implies the answer to b is no) As long as we have a) yes b) yes and c) no , then lets get this patch into SVN and close this bug. If you want to add another RFE for further enhancements to attain this Typographic Colour stuff, then please go ahead. |
|
1. I will write the doc if someone is to take the challenge of gathering those settings together and make them a new set of substyles named "Typographic Colour". I ask for NO novelties, just a gathering of the already available settings. BTW I think that I will not have a big effort to write much because all the typographic color stuff is well covered in Wikipedia! :-) 2. I fully agree that "Hijacking bugs causes them to never get fixed or for a fix to take too longer." For this very reason, I think that bug 0009848 should be closed. Answers are as follow: a) no b) because of a) = no, it's irrelevant c) because of a) = no, it's irrelevant We should instead put energy on bug 0000417 http://bugs.scribus.net/view.php?id=417 which is a need and once solved will make more appealing the new RFE for Typographic Colour (for which I will create a separate bug as asked). |
|
New bug http://bugs.scribus.net/view.php?id=10502 created |
|
hyph_control.patch (43,111 bytes)
Index: scribus/pageitem_textframe.cpp =================================================================== --- scribus/pageitem_textframe.cpp (wersja 17188) +++ scribus/pageitem_textframe.cpp (kopia robocza) @@ -1735,7 +1735,7 @@ double overflowWidth = 0.0; double hyphWidth = 0.0; bool inOverflow = false; - if (hl->effects() & ScStyle_HyphenationPossible || hl->ch == SpecialChars::SHYPHEN) + if ((style.hyphenationMode() != ParagraphStyle::NoHyphenation) && ((hl->effects() & ScStyle_HyphenationPossible) || hl->ch == SpecialChars::SHYPHEN)) hyphWidth = charStyle.font().charWidth('-', hlcsize10) * (charStyle.scaleH() / 1000.0); if ((current.isEndOfLine(style.rightMargin() + hyphWidth)) || current.isEndOfCol(realDesc) || SpecialChars::isBreak(hl->ch, Cols > 1) || (current.xPos - current.maxShrink + hyphWidth) >= current.mustLineEnd) { @@ -1803,10 +1803,12 @@ charEnd = static_cast<int>(ceil(current.xPos - current.maxShrink) + hyphWidth); } if (legacy && - (((hl->ch == '-' || (hl->effects() & ScStyle_HyphenationPossible)) && (current.hyphenCount < m_Doc->HyCount || m_Doc->HyCount == 0)) - || hl->ch == SpecialChars::SHYPHEN)) + (hl->ch == '-' + || ((style.hyphenationMode() != ParagraphStyle::NoHyphenation) + && ((hl->effects() & ScStyle_HyphenationPossible) + && ((current.hyphenCount < m_Doc->HyCount || m_Doc->HyCount == 0) || hl->ch == SpecialChars::SHYPHEN))))) { - if (hl->effects() & ScStyle_HyphenationPossible || hl->ch == SpecialChars::SHYPHEN) + if ((style.hyphenationMode() != ParagraphStyle::NoHyphenation) && (hl->effects() & ScStyle_HyphenationPossible || hl->ch == SpecialChars::SHYPHEN)) { pt1 = QPoint(charStart, maxYAsc); pt2 = QPoint(static_cast<int>(charEnd + hyphWidth), maxYDesc); @@ -1908,7 +1910,8 @@ } // hyphenation - if (((hl->effects() & ScStyle_HyphenationPossible) || (hl->ch == '-') || hl->ch == SpecialChars::SHYPHEN) && (!outs) && !itemText.text(a-1).isSpace() ) + if (((hl->ch == '-') || ((style.hyphenationMode() != ParagraphStyle::NoHyphenation) && ((hl->effects() & ScStyle_HyphenationPossible) || hl->ch == SpecialChars::SHYPHEN))) + && (!outs) && !itemText.text(a-1).isSpace() ) { breakPos = current.xPos; if (hl->ch != '-') @@ -1923,7 +1926,7 @@ if (legacy || (breakPos - rightHang < current.colRight - style.rightMargin())) { - if ((current.hyphenCount < m_Doc->HyCount) || (m_Doc->HyCount == 0) || hl->ch == SpecialChars::SHYPHEN) + if ((style.hyphenationMode() != ParagraphStyle::NoHyphenation) && ((current.hyphenCount < m_Doc->HyCount) || (m_Doc->HyCount == 0) || hl->ch == SpecialChars::SHYPHEN)) { current.rememberBreak(a, breakPos, style.rightMargin() + hyphWidth); } @@ -2074,7 +2077,7 @@ current.finishLine(EndX); hyphWidth = 0.0; - if ((hl->effects() & ScStyle_HyphenationPossible) || hl->ch == SpecialChars::SHYPHEN) + if ((style.hyphenationMode() != ParagraphStyle::NoHyphenation) && ((hl->effects() & ScStyle_HyphenationPossible) || hl->ch == SpecialChars::SHYPHEN)) { // insert hyphen if (current.lastInRowLine) Index: scribus/smpstylewidget.h =================================================================== --- scribus/smpstylewidget.h (wersja 17188) +++ scribus/smpstylewidget.h (kopia robocza) @@ -47,6 +47,7 @@ void showCStyle(QList<ParagraphStyle*> &pstyles, QList<CharStyle> &cstyles, const QString &defLang, int unitIndex); void showParent(QList<ParagraphStyle*> &pstyles); void setOpticalMargins(int o, bool inhO=false, const ParagraphStyle *parent=NULL); + void showHyphenationMode(QList<ParagraphStyle*> &pstyles); friend class SMParagraphStyle; Index: scribus/smpstylewidget.cpp =================================================================== --- scribus/smpstylewidget.cpp (wersja 17188) +++ scribus/smpstylewidget.cpp (kopia robocza) @@ -7,6 +7,7 @@ #include <QEvent> +#include "styles/paragraphstyle.h" #include "smpstylewidget.h" #include "units.h" #include "util.h" @@ -40,6 +41,10 @@ spaceAbove_->setSuffix(unitGetSuffixFromIndex(0)); spaceBelow_->setSuffix(unitGetSuffixFromIndex(0)); + hyphenationMode->addItem(tr("No Hyphenation")); + hyphenationMode->addItem(tr("Manual Hyphenation")); + hyphenationMode->addItem(tr("Automatic Hyphenation")); + // optMarginCombo->addItem(tr("None"), ParagraphStyle::OM_None); // optMarginCombo->addItem(tr("Left Protruding"), ParagraphStyle::OM_LeftProtruding); // optMarginCombo->addItem(tr("Right Protruding"), ParagraphStyle::OM_RightProtruding); @@ -93,6 +98,7 @@ //dropCapsBox->setToolTip( tr("Enable or disable drop cap")); dropCapLines_->setToolTip( tr("Drop Cap Lines")); dropCapOffset_->setToolTip( tr("Drop Cap Offset")); + hyphenationMode->setToolTip( tr("Hyphenation Mode")); alignement_->setToolTip( tr("Alignment")); tabList_->first_->setToolTip( tr("First Line Indent")); tabList_->left_->setToolTip( tr("Left Indent")); @@ -117,6 +123,10 @@ lineSpacingMode_->addItem( tr("Automatic Linespacing")); lineSpacingMode_->addItem( tr("Align to Baseline Grid")); + hyphenationMode->addItem(tr("No Hyphenation")); + hyphenationMode->addItem(tr("Manual Hyphenation")); + hyphenationMode->addItem(tr("Automatic Hyphenation")); + // optMarginCombo->clear(); // optMarginCombo->addItem(tr("None"), ParagraphStyle::OM_None); // optMarginCombo->addItem(tr("Left Protruding"), ParagraphStyle::OM_LeftProtruding); @@ -140,6 +150,7 @@ glyphExtensionLabel->setText(tr("Glyph Extension")); minGlyphExtLabel->setText(tr("Min:", "Glyph Extension")); maxGlyphExtLabel->setText(tr("Max:", "Glyph Extension")); + hyphenationModeLabel->setText(tr("Hyphenation Mode")); } void SMPStyleWidget::unitChange(double oldRatio, double newRatio, int unitIndex) @@ -159,7 +170,13 @@ lineSpacingMode_->addItem( tr("Fixed Linespacing")); lineSpacingMode_->addItem( tr("Automatic Linespacing")); lineSpacingMode_->addItem( tr("Align to Baseline Grid")); + + hyphenationMode->clear(); + hyphenationMode->addItem(tr("No Hyphenation")); + hyphenationMode->addItem(tr("Manual Hyphenation")); + hyphenationMode->addItem(tr("Automatic Hyphenation")); + // optMarginCombo->clear(); // optMarginCombo->addItem(tr("None"), ParagraphStyle::OM_None); // optMarginCombo->addItem(tr("Left Protruding"), ParagraphStyle::OM_LeftProtruding); @@ -215,6 +232,8 @@ dropCapOffset_->setValue(pstyle->dropCapOffset() * unitRatio, pstyle->isInhDropCapOffset()); dropCapOffset_->setParentValue(parent->dropCapOffset() * unitRatio); + hyphenationMode->setCurrentItem(pstyle->hyphenationMode(), pstyle->isInhHyphenationMode()); + alignement_->setStyle(pstyle->alignment(), pstyle->isInhAlignment()); alignement_->setParentItem(parent->alignment()); @@ -255,6 +274,7 @@ dropCapLines_->setValue(pstyle->dropCapLines()); dropCapOffset_->setValue(pstyle->dropCapOffset() * unitRatio); parentDropCapButton->hide(); + hyphenationMode->setCurrentItem(pstyle->hyphenationMode()); alignement_->setStyle(pstyle->alignment()); tabList_->setTabs(pstyle->tabValues(), unitIndex); tabList_->setLeftIndentValue(pstyle->leftMargin() * unitRatio); @@ -759,6 +779,25 @@ } } +void SMPStyleWidget::showHyphenationMode(QList<ParagraphStyle*> &pstyles) +{ + if(pstyles.isEmpty()) + { + qDebug()<<"Warning showMaxGlyphExt called with an empty list of styles"; + return; + } + int hm = (pstyles[0]->hyphenationMode()); + for (int i = 0; i < pstyles.count(); ++i) + { + if (hm != (pstyles[i]->hyphenationMode())) + { + hyphenationMode->setCurrentItem(pstyles[i]->hyphenationMode()); + return; + } + } + hyphenationMode->setCurrentItem(hm); +} + void SMPStyleWidget::slotDefaultOpticalMargins() { // optMarginCheckLeftProtruding->setChecked(false); Index: scribus/smtextstyles.h =================================================================== --- scribus/smtextstyles.h (wersja 17188) +++ scribus/smtextstyles.h (kopia robocza) @@ -75,6 +75,7 @@ void slotDropCap(bool isOn); void slotDropCapLines(int lines); void slotDropCapOffset(); + void slotHyphenationMode(int hm); void slotSpaceAbove(); void slotSpaceBelow(); void slotAlignment(); Index: scribus/smpstylewidget.ui =================================================================== --- scribus/smpstylewidget.ui (wersja 17188) +++ scribus/smpstylewidget.ui (kopia robocza) @@ -1,7 +1,8 @@ -<ui version="4.0" > +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> <class>SMPStyleWidget</class> - <widget class="QWidget" name="SMPStyleWidget" > - <property name="geometry" > + <widget class="QWidget" name="SMPStyleWidget"> + <property name="geometry"> <rect> <x>0</x> <y>0</y> @@ -9,39 +10,39 @@ <height>533</height> </rect> </property> - <layout class="QVBoxLayout" > + <layout class="QVBoxLayout"> <item> - <widget class="QTabWidget" name="tabWidget" > - <property name="currentIndex" > + <widget class="QTabWidget" name="tabWidget"> + <property name="currentIndex"> <number>0</number> </property> - <widget class="QWidget" name="tab" > - <attribute name="title" > + <widget class="QWidget" name="tab"> + <attribute name="title"> <string>Properties</string> </attribute> - <layout class="QVBoxLayout" name="verticalLayout_4" > + <layout class="QVBoxLayout" name="verticalLayout_4"> <item> - <layout class="QHBoxLayout" > - <property name="spacing" > + <layout class="QHBoxLayout"> + <property name="spacing"> <number>5</number> </property> - <property name="margin" > + <property name="margin"> <number>0</number> </property> <item> - <widget class="QLabel" name="parentLabel" > - <property name="text" > + <widget class="QLabel" name="parentLabel"> + <property name="text"> <string>Based On:</string> </property> - <property name="wordWrap" > + <property name="wordWrap"> <bool>false</bool> </property> </widget> </item> <item> - <widget class="QComboBox" name="parentCombo" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="Minimum" > + <widget class="QComboBox" name="parentCombo"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <horstretch>5</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -51,49 +52,49 @@ </layout> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_5" > + <layout class="QHBoxLayout" name="horizontalLayout_5"> <item> - <layout class="QVBoxLayout" name="verticalLayout_2" > + <layout class="QVBoxLayout" name="verticalLayout_2"> <item> - <widget class="QGroupBox" name="distancesBox" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Minimum" hsizetype="Preferred" > + <widget class="QGroupBox" name="distancesBox"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="font" > + <property name="font"> <font> <weight>50</weight> <bold>false</bold> </font> </property> - <property name="title" > + <property name="title"> <string>Distances and Alignment</string> </property> - <layout class="QVBoxLayout" > + <layout class="QVBoxLayout"> <item> - <layout class="QHBoxLayout" > + <layout class="QHBoxLayout"> <item> - <widget class="QLabel" name="lineSpacingLabel" > - <property name="maximumSize" > + <widget class="QLabel" name="lineSpacingLabel"> + <property name="maximumSize"> <size> <width>22</width> <height>22</height> </size> </property> - <property name="text" > + <property name="text"> <string>TextLabel</string> </property> - <property name="buddy" > + <property name="buddy"> <cstring>lineSpacingMode_</cstring> </property> </widget> </item> <item> - <widget class="SMScComboBox" name="lineSpacingMode_" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" > + <widget class="SMScComboBox" name="lineSpacingMode_"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -101,21 +102,21 @@ </widget> </item> <item> - <widget class="SMScrSpinBox" name="lineSpacing_" > - <property name="minimum" > + <widget class="SMScrSpinBox" name="lineSpacing_"> + <property name="minimum"> <number>1</number> </property> - <property name="maximum" > + <property name="maximum"> <number>300</number> </property> </widget> </item> <item> <spacer> - <property name="orientation" > + <property name="orientation"> <enum>Qt::Horizontal</enum> </property> - <property name="sizeHint" stdset="0" > + <property name="sizeHint" stdset="0"> <size> <width>40</width> <height>20</height> @@ -126,36 +127,36 @@ </layout> </item> <item> - <layout class="QHBoxLayout" > + <layout class="QHBoxLayout"> <item> - <widget class="QLabel" name="spaceAboveLabel" > - <property name="maximumSize" > + <widget class="QLabel" name="spaceAboveLabel"> + <property name="maximumSize"> <size> <width>22</width> <height>22</height> </size> </property> - <property name="text" > + <property name="text"> <string>TextLabel</string> </property> - <property name="buddy" > + <property name="buddy"> <cstring>spaceAbove_</cstring> </property> </widget> </item> <item> - <widget class="SMScrSpinBox" name="spaceAbove_" > - <property name="maximum" > + <widget class="SMScrSpinBox" name="spaceAbove_"> + <property name="maximum"> <number>300</number> </property> </widget> </item> <item> <spacer> - <property name="orientation" > + <property name="orientation"> <enum>Qt::Horizontal</enum> </property> - <property name="sizeHint" stdset="0" > + <property name="sizeHint" stdset="0"> <size> <width>40</width> <height>20</height> @@ -166,36 +167,36 @@ </layout> </item> <item> - <layout class="QHBoxLayout" > + <layout class="QHBoxLayout"> <item> - <widget class="QLabel" name="spaceBelowLabel" > - <property name="maximumSize" > + <widget class="QLabel" name="spaceBelowLabel"> + <property name="maximumSize"> <size> <width>22</width> <height>22</height> </size> </property> - <property name="text" > + <property name="text"> <string>TextLabel</string> </property> - <property name="buddy" > + <property name="buddy"> <cstring>spaceBelow_</cstring> </property> </widget> </item> <item> - <widget class="SMScrSpinBox" name="spaceBelow_" > - <property name="maximum" > + <widget class="SMScrSpinBox" name="spaceBelow_"> + <property name="maximum"> <number>300</number> </property> </widget> </item> <item> <spacer> - <property name="orientation" > + <property name="orientation"> <enum>Qt::Horizontal</enum> </property> - <property name="sizeHint" stdset="0" > + <property name="sizeHint" stdset="0"> <size> <width>40</width> <height>20</height> @@ -206,11 +207,11 @@ </layout> </item> <item> - <layout class="QHBoxLayout" > + <layout class="QHBoxLayout"> <item> - <widget class="SMAlignSelect" native="1" name="alignement_" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Minimum" hsizetype="Minimum" > + <widget class="SMAlignSelect" name="alignement_" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -219,10 +220,10 @@ </item> <item> <spacer> - <property name="orientation" > + <property name="orientation"> <enum>Qt::Horizontal</enum> </property> - <property name="sizeHint" stdset="0" > + <property name="sizeHint" stdset="0"> <size> <width>211</width> <height>20</height> @@ -236,45 +237,45 @@ </widget> </item> <item> - <widget class="QGroupBox" name="dropCapsBox" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Minimum" hsizetype="Preferred" > + <widget class="QGroupBox" name="dropCapsBox"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="title" > + <property name="title"> <string>Drop Caps</string> </property> - <property name="checkable" > + <property name="checkable"> <bool>true</bool> </property> - <property name="checked" > + <property name="checked"> <bool>true</bool> </property> - <layout class="QVBoxLayout" > + <layout class="QVBoxLayout"> <item> - <layout class="QHBoxLayout" > + <layout class="QHBoxLayout"> <item> - <layout class="QVBoxLayout" > + <layout class="QVBoxLayout"> <item> - <layout class="QHBoxLayout" > + <layout class="QHBoxLayout"> <item> - <widget class="QLabel" name="label" > - <property name="text" > + <widget class="QLabel" name="label"> + <property name="text"> <string>&Lines:</string> </property> - <property name="buddy" > + <property name="buddy"> <cstring>dropCapLines_</cstring> </property> </widget> </item> <item> - <widget class="SMSpinBox" name="dropCapLines_" > - <property name="minimum" > + <widget class="SMSpinBox" name="dropCapLines_"> + <property name="minimum"> <number>2</number> </property> - <property name="maximum" > + <property name="maximum"> <number>20</number> </property> </widget> @@ -282,23 +283,23 @@ </layout> </item> <item> - <layout class="QHBoxLayout" > + <layout class="QHBoxLayout"> <item> - <widget class="QLabel" name="label_2" > - <property name="text" > + <widget class="QLabel" name="label_2"> + <property name="text"> <string>Distance from Text:</string> </property> - <property name="buddy" > + <property name="buddy"> <cstring>dropCapOffset_</cstring> </property> </widget> </item> <item> - <widget class="SMScrSpinBox" name="dropCapOffset_" > - <property name="minimum" > + <widget class="SMScrSpinBox" name="dropCapOffset_"> + <property name="minimum"> <number>-3000</number> </property> - <property name="maximum" > + <property name="maximum"> <number>3000</number> </property> </widget> @@ -309,10 +310,10 @@ </item> <item> <spacer> - <property name="orientation" > + <property name="orientation"> <enum>Qt::Horizontal</enum> </property> - <property name="sizeHint" stdset="0" > + <property name="sizeHint" stdset="0"> <size> <width>40</width> <height>20</height> @@ -326,24 +327,24 @@ </widget> </item> <item> - <widget class="QToolButton" name="parentDropCapButton" > - <property name="enabled" > + <widget class="QToolButton" name="parentDropCapButton"> + <property name="enabled"> <bool>true</bool> </property> - <property name="text" > + <property name="text"> <string>Use Parent Value</string> </property> </widget> </item> <item> <spacer> - <property name="orientation" > + <property name="orientation"> <enum>Qt::Vertical</enum> </property> - <property name="sizeType" > + <property name="sizeType"> <enum>QSizePolicy::MinimumExpanding</enum> </property> - <property name="sizeHint" stdset="0" > + <property name="sizeHint" stdset="0"> <size> <width>272</width> <height>0</height> @@ -351,70 +352,97 @@ </property> </spacer> </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_7"> + <item> + <widget class="QLabel" name="hyphenationModeLabel"> + <property name="text"> + <string>Hyphenation Mode</string> + </property> + </widget> + </item> + <item> + <widget class="SMScComboBox" name="hyphenationMode"/> + </item> + <item> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> </layout> </item> <item> - <layout class="QVBoxLayout" name="verticalLayout_3" > + <layout class="QVBoxLayout" name="verticalLayout_3"> <item> - <widget class="QGroupBox" name="groupBox" > - <property name="font" > + <widget class="QGroupBox" name="groupBox"> + <property name="font"> <font> <weight>50</weight> <bold>false</bold> </font> </property> - <property name="title" > + <property name="title"> <string>Optical Margins</string> </property> - <layout class="QFormLayout" name="formLayout" > - <property name="fieldGrowthPolicy" > + <layout class="QFormLayout" name="formLayout"> + <property name="fieldGrowthPolicy"> <enum>QFormLayout::AllNonFixedFieldsGrow</enum> </property> - <item row="4" column="1" > - <layout class="QHBoxLayout" name="horizontalLayout_4" > + <item row="4" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_4"> <item> - <widget class="QPushButton" name="optMarginDefaultButton" > - <property name="text" > + <widget class="QPushButton" name="optMarginDefaultButton"> + <property name="text"> <string>Reset to Default</string> </property> </widget> </item> <item> - <widget class="QPushButton" name="optMarginParentButton" > - <property name="text" > + <widget class="QPushButton" name="optMarginParentButton"> + <property name="text"> <string>Use Parent Value</string> </property> </widget> </item> </layout> </item> - <item row="0" column="1" > - <widget class="SMRadioButton" name="optMarginRadioNone" > - <property name="text" > + <item row="0" column="1"> + <widget class="SMRadioButton" name="optMarginRadioNone"> + <property name="text"> <string>None</string> </property> - <property name="checked" > + <property name="checked"> <bool>true</bool> </property> </widget> </item> - <item row="1" column="1" > - <widget class="SMRadioButton" name="optMarginRadioBoth" > - <property name="text" > + <item row="1" column="1"> + <widget class="SMRadioButton" name="optMarginRadioBoth"> + <property name="text"> <string>Both Sides</string> </property> </widget> </item> - <item row="2" column="1" > - <widget class="SMRadioButton" name="optMarginRadioLeft" > - <property name="text" > + <item row="2" column="1"> + <widget class="SMRadioButton" name="optMarginRadioLeft"> + <property name="text"> <string>Left Only</string> </property> </widget> </item> - <item row="3" column="1" > - <widget class="SMRadioButton" name="optMarginRadioRight" > - <property name="text" > + <item row="3" column="1"> + <widget class="SMRadioButton" name="optMarginRadioRight"> + <property name="text"> <string>Right Only</string> </property> </widget> @@ -423,56 +451,56 @@ </widget> </item> <item> - <widget class="QGroupBox" name="groupBox_2" > - <property name="enabled" > + <widget class="QGroupBox" name="groupBox_2"> + <property name="enabled"> <bool>true</bool> </property> - <property name="sizePolicy" > - <sizepolicy vsizetype="Minimum" hsizetype="Preferred" > + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize" > + <property name="minimumSize"> <size> <width>0</width> <height>163</height> </size> </property> - <property name="title" > + <property name="title"> <string>Advanced Settings</string> </property> - <layout class="QGridLayout" name="gridLayout" > - <item row="0" column="0" > - <layout class="QHBoxLayout" name="horizontalLayout" > - <property name="sizeConstraint" > + <layout class="QGridLayout" name="gridLayout"> + <item row="0" column="0"> + <layout class="QHBoxLayout" name="horizontalLayout"> + <property name="sizeConstraint"> <enum>QLayout::SetDefaultConstraint</enum> </property> - <property name="topMargin" > + <property name="topMargin"> <number>0</number> </property> - <property name="bottomMargin" > + <property name="bottomMargin"> <number>0</number> </property> <item> - <widget class="QLabel" name="minSpaceLabel" > - <property name="text" > + <widget class="QLabel" name="minSpaceLabel"> + <property name="text"> <string>TextLabel</string> </property> - <property name="buddy" > + <property name="buddy"> <cstring>minSpaceSpin</cstring> </property> </widget> </item> <item> - <widget class="SMScrSpinBox" name="minSpaceSpin" > - <property name="minimumSize" > + <widget class="SMScrSpinBox" name="minSpaceSpin"> + <property name="minimumSize"> <size> <width>0</width> <height>32</height> </size> </property> - <property name="baseSize" > + <property name="baseSize"> <size> <width>0</width> <height>0</height> @@ -481,11 +509,11 @@ </widget> </item> <item> - <spacer name="horizontalSpacer" > - <property name="orientation" > + <spacer name="horizontalSpacer"> + <property name="orientation"> <enum>Qt::Horizontal</enum> </property> - <property name="sizeHint" stdset="0" > + <property name="sizeHint" stdset="0"> <size> <width>40</width> <height>20</height> @@ -495,30 +523,30 @@ </item> </layout> </item> - <item row="1" column="0" > - <widget class="QLabel" name="glyphExtensionLabel" > - <property name="text" > + <item row="1" column="0"> + <widget class="QLabel" name="glyphExtensionLabel"> + <property name="text"> <string>TextLabel</string> </property> </widget> </item> - <item row="2" column="0" > - <layout class="QHBoxLayout" name="horizontalLayout_6" > + <item row="2" column="0"> + <layout class="QHBoxLayout" name="horizontalLayout_6"> <item> - <layout class="QHBoxLayout" name="horizontalLayout_2" > + <layout class="QHBoxLayout" name="horizontalLayout_2"> <item> - <widget class="QLabel" name="minGlyphExtLabel" > - <property name="text" > + <widget class="QLabel" name="minGlyphExtLabel"> + <property name="text"> <string>TextLabel</string> </property> - <property name="buddy" > + <property name="buddy"> <cstring>minGlyphExtSpin</cstring> </property> </widget> </item> <item> - <widget class="SMScrSpinBox" name="minGlyphExtSpin" > - <property name="minimumSize" > + <widget class="SMScrSpinBox" name="minGlyphExtSpin"> + <property name="minimumSize"> <size> <width>0</width> <height>32</height> @@ -529,20 +557,20 @@ </layout> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_3" > + <layout class="QHBoxLayout" name="horizontalLayout_3"> <item> - <widget class="QLabel" name="maxGlyphExtLabel" > - <property name="text" > + <widget class="QLabel" name="maxGlyphExtLabel"> + <property name="text"> <string>TextLabel</string> </property> - <property name="buddy" > + <property name="buddy"> <cstring>maxGlyphExtSpin</cstring> </property> </widget> </item> <item> - <widget class="SMScrSpinBox" name="maxGlyphExtSpin" > - <property name="minimumSize" > + <widget class="SMScrSpinBox" name="maxGlyphExtSpin"> + <property name="minimumSize"> <size> <width>0</width> <height>32</height> @@ -559,13 +587,13 @@ </item> <item> <spacer> - <property name="orientation" > + <property name="orientation"> <enum>Qt::Vertical</enum> </property> - <property name="sizeType" > + <property name="sizeType"> <enum>QSizePolicy::Expanding</enum> </property> - <property name="sizeHint" stdset="0" > + <property name="sizeHint" stdset="0"> <size> <width>270</width> <height>16</height> @@ -578,23 +606,23 @@ </layout> </item> <item> - <widget class="QGroupBox" name="tabsBox" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Expanding" hsizetype="Preferred" > + <widget class="QGroupBox" name="tabsBox"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="title" > + <property name="title"> <string>Tabulators and Indentation</string> </property> - <layout class="QVBoxLayout" > + <layout class="QVBoxLayout"> <item> - <layout class="QHBoxLayout" > + <layout class="QHBoxLayout"> <item> - <widget class="SMTabruler" native="1" name="tabList_" > - <property name="sizePolicy" > - <sizepolicy vsizetype="MinimumExpanding" hsizetype="MinimumExpanding" > + <widget class="SMTabruler" name="tabList_" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -603,10 +631,10 @@ </item> <item> <spacer> - <property name="orientation" > + <property name="orientation"> <enum>Qt::Horizontal</enum> </property> - <property name="sizeHint" stdset="0" > + <property name="sizeHint" stdset="0"> <size> <width>40</width> <height>20</height> @@ -620,11 +648,11 @@ </widget> </item> <item> - <spacer name="verticalSpacer" > - <property name="orientation" > + <spacer name="verticalSpacer"> + <property name="orientation"> <enum>Qt::Vertical</enum> </property> - <property name="sizeHint" stdset="0" > + <property name="sizeHint" stdset="0"> <size> <width>20</width> <height>0</height> @@ -634,34 +662,34 @@ </item> </layout> </widget> - <widget class="QWidget" name="TabPage" > - <attribute name="title" > + <widget class="QWidget" name="TabPage"> + <attribute name="title"> <string>Ch&aracter Style</string> </attribute> - <layout class="QVBoxLayout" > - <property name="spacing" > + <layout class="QVBoxLayout"> + <property name="spacing"> <number>5</number> </property> - <property name="margin" > + <property name="margin"> <number>0</number> </property> <item> - <widget class="QFrame" name="characterBox" > - <property name="enabled" > + <widget class="QFrame" name="characterBox"> + <property name="enabled"> <bool>true</bool> </property> - <property name="frameShape" > + <property name="frameShape"> <enum>QFrame::NoFrame</enum> </property> - <property name="frameShadow" > + <property name="frameShadow"> <enum>QFrame::Plain</enum> </property> - <property name="lineWidth" > + <property name="lineWidth"> <number>0</number> </property> - <layout class="QGridLayout" > - <item row="0" column="0" > - <widget class="SMCStyleWidget" native="1" name="cpage" /> + <layout class="QGridLayout"> + <item row="0" column="0"> + <widget class="SMCStyleWidget" name="cpage" native="true"/> </item> </layout> </widget> @@ -672,7 +700,7 @@ </item> </layout> </widget> - <layoutdefault spacing="5" margin="5" /> + <layoutdefault spacing="5" margin="5"/> <customwidgets> <customwidget> <class>SMScComboBox</class> Index: scribus/smtextstyles.cpp =================================================================== --- scribus/smtextstyles.cpp (wersja 17188) +++ scribus/smtextstyles.cpp (kopia robocza) @@ -515,6 +515,8 @@ connect(pwidget_->dropCapLines_, SIGNAL(valueChanged(int)), this, SLOT(slotDropCapLines(int))); connect(pwidget_->dropCapOffset_, SIGNAL(valueChanged(double)), this, SLOT(slotDropCapOffset())); + connect(pwidget_->hyphenationMode, SIGNAL(activated(int)), this, SLOT(slotHyphenationMode(int))); + connect(pwidget_->tabList_, SIGNAL(tabsChanged()), this, SLOT(slotTabRuler())); connect(pwidget_->tabList_, SIGNAL(mouseReleased()), this, SLOT(slotTabRuler())); connect(pwidget_->tabList_->left_, SIGNAL(valueChanged(double)), this, SLOT(slotLeftIndent())); @@ -587,6 +589,8 @@ disconnect(pwidget_->dropCapLines_, SIGNAL(valueChanged(int)), this, SLOT(slotDropCapLines(int))); disconnect(pwidget_->dropCapOffset_, SIGNAL(valueChanged(double)), this, SLOT(slotDropCapOffset())); + disconnect(pwidget_->hyphenationMode, SIGNAL(activated(int)), this, SLOT(slotHyphenationMode(int))); + disconnect(pwidget_->parentCombo, SIGNAL(activated(const QString&)), this, SLOT(slotParentChanged(const QString&))); @@ -900,6 +904,18 @@ } } +void SMParagraphStyle::slotHyphenationMode(int mh) +{ + for (int i = 0; i < selection_.count(); ++i) + selection_[i]->setHyphenationMode(mh); + + if (!selectionIsDirty_) + { + selectionIsDirty_ = true; + emit selectionDirty(); + } +} + void SMParagraphStyle::slotTabRuler() { if (pwidget_->tabList_->useParentTabs()) |
|
Too fast again... please delete my last patch I have upload. Must add some code to properly opening files where HyphenationMode property was not set in styles. |
|
OK, new patch bring compatibility with previous created files and set Hyphenation Mode for paragraph styles to doc default. Fortunately someone else done saving of Hyphenation Mode for paragraphs style in SLA file. I have change initial value for HyphenationMode property to -1 (HyphModeNotSet). If such value is found while checking paragraphs by ScribusDoc::redefineStyles then it is set to manual or automatic accordingly to doc prefs. Checking of HyphenationMode property for current paragraph style is added to hypenation controll conditions in PageItem_TextFrame::layout(). TODO: - read hyphenation setting for styles created while importing from ODT/DOC - add local control for hyphenation for selected paragraphs to PP |
|
hyph_control2.patch (48,803 bytes)
Index: scribus/scribusXml.cpp =================================================================== --- scribus/scribusXml.cpp (wersja 17188) +++ scribus/scribusXml.cpp (kopia robocza) @@ -2716,6 +2716,8 @@ style.setOpticalMargins(attrAsInt(attrs, "OpticalMargins")); if ( attrHasValue(attrs, "HyphenationMode")) style.setHyphenationMode(attrAsInt(attrs, "HyphenationMode")); + else + style.setHyphenationMode(ParagraphStyle::HyphModeNotSet); if ( attrHasValue(attrs, "MinWordTrack")) style.setMinWordTracking(attrAsDbl(attrs, "MinWordTrack")); if ( attrHasValue(attrs, "NormWordTrack")) Index: scribus/pageitem_textframe.cpp =================================================================== --- scribus/pageitem_textframe.cpp (wersja 17188) +++ scribus/pageitem_textframe.cpp (kopia robocza) @@ -1735,7 +1735,7 @@ double overflowWidth = 0.0; double hyphWidth = 0.0; bool inOverflow = false; - if (hl->effects() & ScStyle_HyphenationPossible || hl->ch == SpecialChars::SHYPHEN) + if ((style.hyphenationMode() != ParagraphStyle::NoHyphenation) && ((hl->effects() & ScStyle_HyphenationPossible) || hl->ch == SpecialChars::SHYPHEN)) hyphWidth = charStyle.font().charWidth('-', hlcsize10) * (charStyle.scaleH() / 1000.0); if ((current.isEndOfLine(style.rightMargin() + hyphWidth)) || current.isEndOfCol(realDesc) || SpecialChars::isBreak(hl->ch, Cols > 1) || (current.xPos - current.maxShrink + hyphWidth) >= current.mustLineEnd) { @@ -1803,10 +1803,12 @@ charEnd = static_cast<int>(ceil(current.xPos - current.maxShrink) + hyphWidth); } if (legacy && - (((hl->ch == '-' || (hl->effects() & ScStyle_HyphenationPossible)) && (current.hyphenCount < m_Doc->HyCount || m_Doc->HyCount == 0)) - || hl->ch == SpecialChars::SHYPHEN)) + (hl->ch == '-' + || ((style.hyphenationMode() != ParagraphStyle::NoHyphenation) + && ((hl->effects() & ScStyle_HyphenationPossible) + && ((current.hyphenCount < m_Doc->HyCount || m_Doc->HyCount == 0) || hl->ch == SpecialChars::SHYPHEN))))) { - if (hl->effects() & ScStyle_HyphenationPossible || hl->ch == SpecialChars::SHYPHEN) + if ((style.hyphenationMode() != ParagraphStyle::NoHyphenation) && (hl->effects() & ScStyle_HyphenationPossible || hl->ch == SpecialChars::SHYPHEN)) { pt1 = QPoint(charStart, maxYAsc); pt2 = QPoint(static_cast<int>(charEnd + hyphWidth), maxYDesc); @@ -1908,7 +1910,8 @@ } // hyphenation - if (((hl->effects() & ScStyle_HyphenationPossible) || (hl->ch == '-') || hl->ch == SpecialChars::SHYPHEN) && (!outs) && !itemText.text(a-1).isSpace() ) + if (((hl->ch == '-') || ((style.hyphenationMode() != ParagraphStyle::NoHyphenation) && ((hl->effects() & ScStyle_HyphenationPossible) || hl->ch == SpecialChars::SHYPHEN))) + && (!outs) && !itemText.text(a-1).isSpace() ) { breakPos = current.xPos; if (hl->ch != '-') @@ -1923,7 +1926,7 @@ if (legacy || (breakPos - rightHang < current.colRight - style.rightMargin())) { - if ((current.hyphenCount < m_Doc->HyCount) || (m_Doc->HyCount == 0) || hl->ch == SpecialChars::SHYPHEN) + if ((style.hyphenationMode() != ParagraphStyle::NoHyphenation) && ((current.hyphenCount < m_Doc->HyCount) || (m_Doc->HyCount == 0) || hl->ch == SpecialChars::SHYPHEN)) { current.rememberBreak(a, breakPos, style.rightMargin() + hyphWidth); } @@ -2074,7 +2077,7 @@ current.finishLine(EndX); hyphWidth = 0.0; - if ((hl->effects() & ScStyle_HyphenationPossible) || hl->ch == SpecialChars::SHYPHEN) + if ((style.hyphenationMode() != ParagraphStyle::NoHyphenation) && ((hl->effects() & ScStyle_HyphenationPossible) || hl->ch == SpecialChars::SHYPHEN)) { // insert hyphen if (current.lastInRowLine) Index: scribus/styles/paragraphstyle.attrdefs.cxx =================================================================== --- scribus/styles/paragraphstyle.attrdefs.cxx (wersja 17188) +++ scribus/styles/paragraphstyle.attrdefs.cxx (kopia robocza) @@ -20,7 +20,7 @@ ATTRDEF(double, lineSpacing, LineSpacing, 0.0) ATTRDEF(ParagraphStyle::AlignmentType, alignment, Alignment, Leftaligned) ATTRDEF(int, opticalMargins, OpticalMargins, 0) -ATTRDEF(int, hyphenationMode, HyphenationMode, 0) +ATTRDEF(int, hyphenationMode, HyphenationMode, -1) //default value is ParagraphStyle::HyphModeNotSet ATTRDEF(double, minWordTracking, MinWordTracking, 1.0) //ATTRDEF(double, maxWordTracking, MaxWordTracking, 1.0) ATTRDEF(double, minGlyphExtension, MinGlyphExtension, 1.0) Index: scribus/styles/paragraphstyle.h =================================================================== --- scribus/styles/paragraphstyle.h (wersja 17188) +++ scribus/styles/paragraphstyle.h (kopia robocza) @@ -48,6 +48,7 @@ OM_Default = OM_RightProtruding + OM_LeftHangingPunct + OM_RightHangingPunct }; enum HyphenationMode { + HyphModeNotSet = -1, NoHyphenation = 0, ManualHyphenation = 1, AutomaticHyphenation = 2 Index: scribus/smpstylewidget.h =================================================================== --- scribus/smpstylewidget.h (wersja 17188) +++ scribus/smpstylewidget.h (kopia robocza) @@ -47,6 +47,7 @@ void showCStyle(QList<ParagraphStyle*> &pstyles, QList<CharStyle> &cstyles, const QString &defLang, int unitIndex); void showParent(QList<ParagraphStyle*> &pstyles); void setOpticalMargins(int o, bool inhO=false, const ParagraphStyle *parent=NULL); + void showHyphenationMode(QList<ParagraphStyle*> &pstyles); friend class SMParagraphStyle; Index: scribus/smpstylewidget.cpp =================================================================== --- scribus/smpstylewidget.cpp (wersja 17188) +++ scribus/smpstylewidget.cpp (kopia robocza) @@ -7,6 +7,7 @@ #include <QEvent> +#include "styles/paragraphstyle.h" #include "smpstylewidget.h" #include "units.h" #include "util.h" @@ -40,6 +41,10 @@ spaceAbove_->setSuffix(unitGetSuffixFromIndex(0)); spaceBelow_->setSuffix(unitGetSuffixFromIndex(0)); + hyphenationMode->addItem(tr("No Hyphenation")); + hyphenationMode->addItem(tr("Manual Hyphenation")); + hyphenationMode->addItem(tr("Automatic Hyphenation")); + // optMarginCombo->addItem(tr("None"), ParagraphStyle::OM_None); // optMarginCombo->addItem(tr("Left Protruding"), ParagraphStyle::OM_LeftProtruding); // optMarginCombo->addItem(tr("Right Protruding"), ParagraphStyle::OM_RightProtruding); @@ -93,6 +98,7 @@ //dropCapsBox->setToolTip( tr("Enable or disable drop cap")); dropCapLines_->setToolTip( tr("Drop Cap Lines")); dropCapOffset_->setToolTip( tr("Drop Cap Offset")); + hyphenationMode->setToolTip( tr("Hyphenation Mode")); alignement_->setToolTip( tr("Alignment")); tabList_->first_->setToolTip( tr("First Line Indent")); tabList_->left_->setToolTip( tr("Left Indent")); @@ -117,6 +123,10 @@ lineSpacingMode_->addItem( tr("Automatic Linespacing")); lineSpacingMode_->addItem( tr("Align to Baseline Grid")); + hyphenationMode->addItem(tr("No Hyphenation")); + hyphenationMode->addItem(tr("Manual Hyphenation")); + hyphenationMode->addItem(tr("Automatic Hyphenation")); + // optMarginCombo->clear(); // optMarginCombo->addItem(tr("None"), ParagraphStyle::OM_None); // optMarginCombo->addItem(tr("Left Protruding"), ParagraphStyle::OM_LeftProtruding); @@ -140,6 +150,7 @@ glyphExtensionLabel->setText(tr("Glyph Extension")); minGlyphExtLabel->setText(tr("Min:", "Glyph Extension")); maxGlyphExtLabel->setText(tr("Max:", "Glyph Extension")); + hyphenationModeLabel->setText(tr("Hyphenation Mode")); } void SMPStyleWidget::unitChange(double oldRatio, double newRatio, int unitIndex) @@ -159,7 +170,13 @@ lineSpacingMode_->addItem( tr("Fixed Linespacing")); lineSpacingMode_->addItem( tr("Automatic Linespacing")); lineSpacingMode_->addItem( tr("Align to Baseline Grid")); + + hyphenationMode->clear(); + hyphenationMode->addItem(tr("No Hyphenation")); + hyphenationMode->addItem(tr("Manual Hyphenation")); + hyphenationMode->addItem(tr("Automatic Hyphenation")); + // optMarginCombo->clear(); // optMarginCombo->addItem(tr("None"), ParagraphStyle::OM_None); // optMarginCombo->addItem(tr("Left Protruding"), ParagraphStyle::OM_LeftProtruding); @@ -215,6 +232,8 @@ dropCapOffset_->setValue(pstyle->dropCapOffset() * unitRatio, pstyle->isInhDropCapOffset()); dropCapOffset_->setParentValue(parent->dropCapOffset() * unitRatio); + hyphenationMode->setCurrentItem(pstyle->hyphenationMode(), pstyle->isInhHyphenationMode()); + alignement_->setStyle(pstyle->alignment(), pstyle->isInhAlignment()); alignement_->setParentItem(parent->alignment()); @@ -255,6 +274,7 @@ dropCapLines_->setValue(pstyle->dropCapLines()); dropCapOffset_->setValue(pstyle->dropCapOffset() * unitRatio); parentDropCapButton->hide(); + hyphenationMode->setCurrentItem(pstyle->hyphenationMode()); alignement_->setStyle(pstyle->alignment()); tabList_->setTabs(pstyle->tabValues(), unitIndex); tabList_->setLeftIndentValue(pstyle->leftMargin() * unitRatio); @@ -759,6 +779,25 @@ } } +void SMPStyleWidget::showHyphenationMode(QList<ParagraphStyle*> &pstyles) +{ + if(pstyles.isEmpty()) + { + qDebug()<<"Warning showMaxGlyphExt called with an empty list of styles"; + return; + } + int hm = (pstyles[0]->hyphenationMode()); + for (int i = 0; i < pstyles.count(); ++i) + { + if (hm != (pstyles[i]->hyphenationMode())) + { + hyphenationMode->setCurrentItem(pstyles[i]->hyphenationMode()); + return; + } + } + hyphenationMode->setCurrentItem(hm); +} + void SMPStyleWidget::slotDefaultOpticalMargins() { // optMarginCheckLeftProtruding->setChecked(false); Index: scribus/smtextstyles.h =================================================================== --- scribus/smtextstyles.h (wersja 17188) +++ scribus/smtextstyles.h (kopia robocza) @@ -75,6 +75,7 @@ void slotDropCap(bool isOn); void slotDropCapLines(int lines); void slotDropCapOffset(); + void slotHyphenationMode(int hm); void slotSpaceAbove(); void slotSpaceBelow(); void slotAlignment(); Index: scribus/scribusdoc.cpp =================================================================== --- scribus/scribusdoc.cpp (wersja 17188) +++ scribus/scribusdoc.cpp (kopia robocza) @@ -477,7 +477,12 @@ pstyle.setDropCapLines(2); pstyle.setDropCapOffset(0); pstyle.charStyle().setParent(""); + if (AutoCheck) + pstyle.setHyphenationMode(ParagraphStyle::AutomaticHyphenation); + else + pstyle.setHyphenationMode(ParagraphStyle::ManualHyphenation); + CharStyle cstyle; cstyle.setDefaultStyle(true); cstyle.setName(CommonStrings::DefaultCharacterStyle); @@ -1123,10 +1128,10 @@ if (deletion.count() > 0) replaceStyles(deletion); } - // repair charstyle context: for (int i=0; i < docParagraphStyles.count(); ++i) { ParagraphStyle& sty(docParagraphStyles[i]); + // repair charstyle context: if (docParagraphStyles.isDefault(sty)) { sty.breakImplicitCharStyleInheritance(true); @@ -1136,6 +1141,14 @@ else { sty.breakImplicitCharStyleInheritance(false); } + //set HyphenationMode to doc default + if (sty.hyphenationMode() == ParagraphStyle::HyphModeNotSet) + { + if (AutoCheck) + sty.setHyphenationMode(ParagraphStyle::AutomaticHyphenation); + else + sty.setHyphenationMode(ParagraphStyle::ManualHyphenation); + } } docParagraphStyles.invalidate(); } Index: scribus/plugins/fileloader/scribus12format/scribus12format.cpp =================================================================== --- scribus/plugins/fileloader/scribus12format/scribus12format.cpp (wersja 17188) +++ scribus/plugins/fileloader/scribus12format/scribus12format.cpp (kopia robocza) @@ -1606,6 +1606,10 @@ vg->charStyle().setBaselineOffset(qRound(ScCLocale::toDoubleC(pg->attribute("BASEO"), 0.0) * 10)); vg->charStyle().setTracking(qRound(ScCLocale::toDoubleC(pg->attribute("KERN"), 0.0) * 10)); // vg->tabValues().clear(); + + //for feature of control of HyphenationMode + vg->setHyphenationMode(ParagraphStyle::HyphModeNotSet); + if ((pg->hasAttribute("NUMTAB")) && (pg->attribute("NUMTAB", "0").toInt() != 0)) { QList<ParagraphStyle::TabRecord> tbs; Index: scribus/plugins/fileloader/scribus13format/scribus13format.cpp =================================================================== --- scribus/plugins/fileloader/scribus13format/scribus13format.cpp (wersja 17188) +++ scribus/plugins/fileloader/scribus13format/scribus13format.cpp (kopia robocza) @@ -1456,6 +1456,8 @@ if (tbs.count() > 0) vg.setTabValues(tbs); } + //for feature of control of HyphenationMode + vg.setHyphenationMode(ParagraphStyle::HyphModeNotSet); } PageItem* Scribus13Format::PasteItem(QDomElement *obj, ScribusDoc *doc, const QString& baseDir, int pagenr) Index: scribus/plugins/fileloader/scribus134format/scribus134format.cpp =================================================================== --- scribus/plugins/fileloader/scribus134format/scribus134format.cpp (wersja 17188) +++ scribus/plugins/fileloader/scribus134format/scribus134format.cpp (kopia robocza) @@ -2077,6 +2077,8 @@ vg.setOpticalMargins(pg.attribute("OpticalMargins").toInt()); if (pg.hasAttribute("HyphenationMode")) vg.setHyphenationMode(pg.attribute("HyphenationMode").toInt()); + else + vg.setHyphenationMode(ParagraphStyle::HyphModeNotSet); if (pg.hasAttribute("MinWordTrack")) vg.setMinWordTracking(ScCLocale::toDoubleC(pg.attribute("MinWordTrack"))); if (pg.hasAttribute("NormWordTrack")) @@ -2390,6 +2392,8 @@ pstyle.setOpticalMargins(obj->attribute("OpticalMargins").toInt()); if (obj->hasAttribute("HyphenationMode")) pstyle.setHyphenationMode(obj->attribute("HyphenationMode").toInt()); + else + pstyle.setHyphenationMode(ParagraphStyle::HyphModeNotSet); if (obj->hasAttribute("leftMargin")) pstyle.setLeftMargin(ScCLocale::toDoubleC(obj->attribute("leftMargin"))); if (obj->hasAttribute("rightMargin")) Index: scribus/smpstylewidget.ui =================================================================== --- scribus/smpstylewidget.ui (wersja 17188) +++ scribus/smpstylewidget.ui (kopia robocza) @@ -1,7 +1,8 @@ -<ui version="4.0" > +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> <class>SMPStyleWidget</class> - <widget class="QWidget" name="SMPStyleWidget" > - <property name="geometry" > + <widget class="QWidget" name="SMPStyleWidget"> + <property name="geometry"> <rect> <x>0</x> <y>0</y> @@ -9,39 +10,39 @@ <height>533</height> </rect> </property> - <layout class="QVBoxLayout" > + <layout class="QVBoxLayout"> <item> - <widget class="QTabWidget" name="tabWidget" > - <property name="currentIndex" > + <widget class="QTabWidget" name="tabWidget"> + <property name="currentIndex"> <number>0</number> </property> - <widget class="QWidget" name="tab" > - <attribute name="title" > + <widget class="QWidget" name="tab"> + <attribute name="title"> <string>Properties</string> </attribute> - <layout class="QVBoxLayout" name="verticalLayout_4" > + <layout class="QVBoxLayout" name="verticalLayout_4"> <item> - <layout class="QHBoxLayout" > - <property name="spacing" > + <layout class="QHBoxLayout"> + <property name="spacing"> <number>5</number> </property> - <property name="margin" > + <property name="margin"> <number>0</number> </property> <item> - <widget class="QLabel" name="parentLabel" > - <property name="text" > + <widget class="QLabel" name="parentLabel"> + <property name="text"> <string>Based On:</string> </property> - <property name="wordWrap" > + <property name="wordWrap"> <bool>false</bool> </property> </widget> </item> <item> - <widget class="QComboBox" name="parentCombo" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="Minimum" > + <widget class="QComboBox" name="parentCombo"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <horstretch>5</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -51,49 +52,49 @@ </layout> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_5" > + <layout class="QHBoxLayout" name="horizontalLayout_5"> <item> - <layout class="QVBoxLayout" name="verticalLayout_2" > + <layout class="QVBoxLayout" name="verticalLayout_2"> <item> - <widget class="QGroupBox" name="distancesBox" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Minimum" hsizetype="Preferred" > + <widget class="QGroupBox" name="distancesBox"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="font" > + <property name="font"> <font> <weight>50</weight> <bold>false</bold> </font> </property> - <property name="title" > + <property name="title"> <string>Distances and Alignment</string> </property> - <layout class="QVBoxLayout" > + <layout class="QVBoxLayout"> <item> - <layout class="QHBoxLayout" > + <layout class="QHBoxLayout"> <item> - <widget class="QLabel" name="lineSpacingLabel" > - <property name="maximumSize" > + <widget class="QLabel" name="lineSpacingLabel"> + <property name="maximumSize"> <size> <width>22</width> <height>22</height> </size> </property> - <property name="text" > + <property name="text"> <string>TextLabel</string> </property> - <property name="buddy" > + <property name="buddy"> <cstring>lineSpacingMode_</cstring> </property> </widget> </item> <item> - <widget class="SMScComboBox" name="lineSpacingMode_" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" > + <widget class="SMScComboBox" name="lineSpacingMode_"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -101,21 +102,21 @@ </widget> </item> <item> - <widget class="SMScrSpinBox" name="lineSpacing_" > - <property name="minimum" > + <widget class="SMScrSpinBox" name="lineSpacing_"> + <property name="minimum"> <number>1</number> </property> - <property name="maximum" > + <property name="maximum"> <number>300</number> </property> </widget> </item> <item> <spacer> - <property name="orientation" > + <property name="orientation"> <enum>Qt::Horizontal</enum> </property> - <property name="sizeHint" stdset="0" > + <property name="sizeHint" stdset="0"> <size> <width>40</width> <height>20</height> @@ -126,36 +127,36 @@ </layout> </item> <item> - <layout class="QHBoxLayout" > + <layout class="QHBoxLayout"> <item> - <widget class="QLabel" name="spaceAboveLabel" > - <property name="maximumSize" > + <widget class="QLabel" name="spaceAboveLabel"> + <property name="maximumSize"> <size> <width>22</width> <height>22</height> </size> </property> - <property name="text" > + <property name="text"> <string>TextLabel</string> </property> - <property name="buddy" > + <property name="buddy"> <cstring>spaceAbove_</cstring> </property> </widget> </item> <item> - <widget class="SMScrSpinBox" name="spaceAbove_" > - <property name="maximum" > + <widget class="SMScrSpinBox" name="spaceAbove_"> + <property name="maximum"> <number>300</number> </property> </widget> </item> <item> <spacer> - <property name="orientation" > + <property name="orientation"> <enum>Qt::Horizontal</enum> </property> - <property name="sizeHint" stdset="0" > + <property name="sizeHint" stdset="0"> <size> <width>40</width> <height>20</height> @@ -166,36 +167,36 @@ </layout> </item> <item> - <layout class="QHBoxLayout" > + <layout class="QHBoxLayout"> <item> - <widget class="QLabel" name="spaceBelowLabel" > - <property name="maximumSize" > + <widget class="QLabel" name="spaceBelowLabel"> + <property name="maximumSize"> <size> <width>22</width> <height>22</height> </size> </property> - <property name="text" > + <property name="text"> <string>TextLabel</string> </property> - <property name="buddy" > + <property name="buddy"> <cstring>spaceBelow_</cstring> </property> </widget> </item> <item> - <widget class="SMScrSpinBox" name="spaceBelow_" > - <property name="maximum" > + <widget class="SMScrSpinBox" name="spaceBelow_"> + <property name="maximum"> <number>300</number> </property> </widget> </item> <item> <spacer> - <property name="orientation" > + <property name="orientation"> <enum>Qt::Horizontal</enum> </property> - <property name="sizeHint" stdset="0" > + <property name="sizeHint" stdset="0"> <size> <width>40</width> <height>20</height> @@ -206,11 +207,11 @@ </layout> </item> <item> - <layout class="QHBoxLayout" > + <layout class="QHBoxLayout"> <item> - <widget class="SMAlignSelect" native="1" name="alignement_" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Minimum" hsizetype="Minimum" > + <widget class="SMAlignSelect" name="alignement_" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -219,10 +220,10 @@ </item> <item> <spacer> - <property name="orientation" > + <property name="orientation"> <enum>Qt::Horizontal</enum> </property> - <property name="sizeHint" stdset="0" > + <property name="sizeHint" stdset="0"> <size> <width>211</width> <height>20</height> @@ -236,45 +237,45 @@ </widget> </item> <item> - <widget class="QGroupBox" name="dropCapsBox" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Minimum" hsizetype="Preferred" > + <widget class="QGroupBox" name="dropCapsBox"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="title" > + <property name="title"> <string>Drop Caps</string> </property> - <property name="checkable" > + <property name="checkable"> <bool>true</bool> </property> - <property name="checked" > + <property name="checked"> <bool>true</bool> </property> - <layout class="QVBoxLayout" > + <layout class="QVBoxLayout"> <item> - <layout class="QHBoxLayout" > + <layout class="QHBoxLayout"> <item> - <layout class="QVBoxLayout" > + <layout class="QVBoxLayout"> <item> - <layout class="QHBoxLayout" > + <layout class="QHBoxLayout"> <item> - <widget class="QLabel" name="label" > - <property name="text" > + <widget class="QLabel" name="label"> + <property name="text"> <string>&Lines:</string> </property> - <property name="buddy" > + <property name="buddy"> <cstring>dropCapLines_</cstring> </property> </widget> </item> <item> - <widget class="SMSpinBox" name="dropCapLines_" > - <property name="minimum" > + <widget class="SMSpinBox" name="dropCapLines_"> + <property name="minimum"> <number>2</number> </property> - <property name="maximum" > + <property name="maximum"> <number>20</number> </property> </widget> @@ -282,23 +283,23 @@ </layout> </item> <item> - <layout class="QHBoxLayout" > + <layout class="QHBoxLayout"> <item> - <widget class="QLabel" name="label_2" > - <property name="text" > + <widget class="QLabel" name="label_2"> + <property name="text"> <string>Distance from Text:</string> </property> - <property name="buddy" > + <property name="buddy"> <cstring>dropCapOffset_</cstring> </property> </widget> </item> <item> - <widget class="SMScrSpinBox" name="dropCapOffset_" > - <property name="minimum" > + <widget class="SMScrSpinBox" name="dropCapOffset_"> + <property name="minimum"> <number>-3000</number> </property> - <property name="maximum" > + <property name="maximum"> <number>3000</number> </property> </widget> @@ -309,10 +310,10 @@ </item> <item> <spacer> - <property name="orientation" > + <property name="orientation"> <enum>Qt::Horizontal</enum> </property> - <property name="sizeHint" stdset="0" > + <property name="sizeHint" stdset="0"> <size> <width>40</width> <height>20</height> @@ -326,24 +327,24 @@ </widget> </item> <item> - <widget class="QToolButton" name="parentDropCapButton" > - <property name="enabled" > + <widget class="QToolButton" name="parentDropCapButton"> + <property name="enabled"> <bool>true</bool> </property> - <property name="text" > + <property name="text"> <string>Use Parent Value</string> </property> </widget> </item> <item> <spacer> - <property name="orientation" > + <property name="orientation"> <enum>Qt::Vertical</enum> </property> - <property name="sizeType" > + <property name="sizeType"> <enum>QSizePolicy::MinimumExpanding</enum> </property> - <property name="sizeHint" stdset="0" > + <property name="sizeHint" stdset="0"> <size> <width>272</width> <height>0</height> @@ -351,70 +352,97 @@ </property> </spacer> </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_7"> + <item> + <widget class="QLabel" name="hyphenationModeLabel"> + <property name="text"> + <string>Hyphenation Mode</string> + </property> + </widget> + </item> + <item> + <widget class="SMScComboBox" name="hyphenationMode"/> + </item> + <item> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> </layout> </item> <item> - <layout class="QVBoxLayout" name="verticalLayout_3" > + <layout class="QVBoxLayout" name="verticalLayout_3"> <item> - <widget class="QGroupBox" name="groupBox" > - <property name="font" > + <widget class="QGroupBox" name="groupBox"> + <property name="font"> <font> <weight>50</weight> <bold>false</bold> </font> </property> - <property name="title" > + <property name="title"> <string>Optical Margins</string> </property> - <layout class="QFormLayout" name="formLayout" > - <property name="fieldGrowthPolicy" > + <layout class="QFormLayout" name="formLayout"> + <property name="fieldGrowthPolicy"> <enum>QFormLayout::AllNonFixedFieldsGrow</enum> </property> - <item row="4" column="1" > - <layout class="QHBoxLayout" name="horizontalLayout_4" > + <item row="4" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_4"> <item> - <widget class="QPushButton" name="optMarginDefaultButton" > - <property name="text" > + <widget class="QPushButton" name="optMarginDefaultButton"> + <property name="text"> <string>Reset to Default</string> </property> </widget> </item> <item> - <widget class="QPushButton" name="optMarginParentButton" > - <property name="text" > + <widget class="QPushButton" name="optMarginParentButton"> + <property name="text"> <string>Use Parent Value</string> </property> </widget> </item> </layout> </item> - <item row="0" column="1" > - <widget class="SMRadioButton" name="optMarginRadioNone" > - <property name="text" > + <item row="0" column="1"> + <widget class="SMRadioButton" name="optMarginRadioNone"> + <property name="text"> <string>None</string> </property> - <property name="checked" > + <property name="checked"> <bool>true</bool> </property> </widget> </item> - <item row="1" column="1" > - <widget class="SMRadioButton" name="optMarginRadioBoth" > - <property name="text" > + <item row="1" column="1"> + <widget class="SMRadioButton" name="optMarginRadioBoth"> + <property name="text"> <string>Both Sides</string> </property> </widget> </item> - <item row="2" column="1" > - <widget class="SMRadioButton" name="optMarginRadioLeft" > - <property name="text" > + <item row="2" column="1"> + <widget class="SMRadioButton" name="optMarginRadioLeft"> + <property name="text"> <string>Left Only</string> </property> </widget> </item> - <item row="3" column="1" > - <widget class="SMRadioButton" name="optMarginRadioRight" > - <property name="text" > + <item row="3" column="1"> + <widget class="SMRadioButton" name="optMarginRadioRight"> + <property name="text"> <string>Right Only</string> </property> </widget> @@ -423,56 +451,56 @@ </widget> </item> <item> - <widget class="QGroupBox" name="groupBox_2" > - <property name="enabled" > + <widget class="QGroupBox" name="groupBox_2"> + <property name="enabled"> <bool>true</bool> </property> - <property name="sizePolicy" > - <sizepolicy vsizetype="Minimum" hsizetype="Preferred" > + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize" > + <property name="minimumSize"> <size> <width>0</width> <height>163</height> </size> </property> - <property name="title" > + <property name="title"> <string>Advanced Settings</string> </property> - <layout class="QGridLayout" name="gridLayout" > - <item row="0" column="0" > - <layout class="QHBoxLayout" name="horizontalLayout" > - <property name="sizeConstraint" > + <layout class="QGridLayout" name="gridLayout"> + <item row="0" column="0"> + <layout class="QHBoxLayout" name="horizontalLayout"> + <property name="sizeConstraint"> <enum>QLayout::SetDefaultConstraint</enum> </property> - <property name="topMargin" > + <property name="topMargin"> <number>0</number> </property> - <property name="bottomMargin" > + <property name="bottomMargin"> <number>0</number> </property> <item> - <widget class="QLabel" name="minSpaceLabel" > - <property name="text" > + <widget class="QLabel" name="minSpaceLabel"> + <property name="text"> <string>TextLabel</string> </property> - <property name="buddy" > + <property name="buddy"> <cstring>minSpaceSpin</cstring> </property> </widget> </item> <item> - <widget class="SMScrSpinBox" name="minSpaceSpin" > - <property name="minimumSize" > + <widget class="SMScrSpinBox" name="minSpaceSpin"> + <property name="minimumSize"> <size> <width>0</width> <height>32</height> </size> </property> - <property name="baseSize" > + <property name="baseSize"> <size> <width>0</width> <height>0</height> @@ -481,11 +509,11 @@ </widget> </item> <item> - <spacer name="horizontalSpacer" > - <property name="orientation" > + <spacer name="horizontalSpacer"> + <property name="orientation"> <enum>Qt::Horizontal</enum> </property> - <property name="sizeHint" stdset="0" > + <property name="sizeHint" stdset="0"> <size> <width>40</width> <height>20</height> @@ -495,30 +523,30 @@ </item> </layout> </item> - <item row="1" column="0" > - <widget class="QLabel" name="glyphExtensionLabel" > - <property name="text" > + <item row="1" column="0"> + <widget class="QLabel" name="glyphExtensionLabel"> + <property name="text"> <string>TextLabel</string> </property> </widget> </item> - <item row="2" column="0" > - <layout class="QHBoxLayout" name="horizontalLayout_6" > + <item row="2" column="0"> + <layout class="QHBoxLayout" name="horizontalLayout_6"> <item> - <layout class="QHBoxLayout" name="horizontalLayout_2" > + <layout class="QHBoxLayout" name="horizontalLayout_2"> <item> - <widget class="QLabel" name="minGlyphExtLabel" > - <property name="text" > + <widget class="QLabel" name="minGlyphExtLabel"> + <property name="text"> <string>TextLabel</string> </property> - <property name="buddy" > + <property name="buddy"> <cstring>minGlyphExtSpin</cstring> </property> </widget> </item> <item> - <widget class="SMScrSpinBox" name="minGlyphExtSpin" > - <property name="minimumSize" > + <widget class="SMScrSpinBox" name="minGlyphExtSpin"> + <property name="minimumSize"> <size> <width>0</width> <height>32</height> @@ -529,20 +557,20 @@ </layout> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_3" > + <layout class="QHBoxLayout" name="horizontalLayout_3"> <item> - <widget class="QLabel" name="maxGlyphExtLabel" > - <property name="text" > + <widget class="QLabel" name="maxGlyphExtLabel"> + <property name="text"> <string>TextLabel</string> </property> - <property name="buddy" > + <property name="buddy"> <cstring>maxGlyphExtSpin</cstring> </property> </widget> </item> <item> - <widget class="SMScrSpinBox" name="maxGlyphExtSpin" > - <property name="minimumSize" > + <widget class="SMScrSpinBox" name="maxGlyphExtSpin"> + <property name="minimumSize"> <size> <width>0</width> <height>32</height> @@ -559,13 +587,13 @@ </item> <item> <spacer> - <property name="orientation" > + <property name="orientation"> <enum>Qt::Vertical</enum> </property> - <property name="sizeType" > + <property name="sizeType"> <enum>QSizePolicy::Expanding</enum> </property> - <property name="sizeHint" stdset="0" > + <property name="sizeHint" stdset="0"> <size> <width>270</width> <height>16</height> @@ -578,23 +606,23 @@ </layout> </item> <item> - <widget class="QGroupBox" name="tabsBox" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Expanding" hsizetype="Preferred" > + <widget class="QGroupBox" name="tabsBox"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="title" > + <property name="title"> <string>Tabulators and Indentation</string> </property> - <layout class="QVBoxLayout" > + <layout class="QVBoxLayout"> <item> - <layout class="QHBoxLayout" > + <layout class="QHBoxLayout"> <item> - <widget class="SMTabruler" native="1" name="tabList_" > - <property name="sizePolicy" > - <sizepolicy vsizetype="MinimumExpanding" hsizetype="MinimumExpanding" > + <widget class="SMTabruler" name="tabList_" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -603,10 +631,10 @@ </item> <item> <spacer> - <property name="orientation" > + <property name="orientation"> <enum>Qt::Horizontal</enum> </property> - <property name="sizeHint" stdset="0" > + <property name="sizeHint" stdset="0"> <size> <width>40</width> <height>20</height> @@ -620,11 +648,11 @@ </widget> </item> <item> - <spacer name="verticalSpacer" > - <property name="orientation" > + <spacer name="verticalSpacer"> + <property name="orientation"> <enum>Qt::Vertical</enum> </property> - <property name="sizeHint" stdset="0" > + <property name="sizeHint" stdset="0"> <size> <width>20</width> <height>0</height> @@ -634,34 +662,34 @@ </item> </layout> </widget> - <widget class="QWidget" name="TabPage" > - <attribute name="title" > + <widget class="QWidget" name="TabPage"> + <attribute name="title"> <string>Ch&aracter Style</string> </attribute> - <layout class="QVBoxLayout" > - <property name="spacing" > + <layout class="QVBoxLayout"> + <property name="spacing"> <number>5</number> </property> - <property name="margin" > + <property name="margin"> <number>0</number> </property> <item> - <widget class="QFrame" name="characterBox" > - <property name="enabled" > + <widget class="QFrame" name="characterBox"> + <property name="enabled"> <bool>true</bool> </property> - <property name="frameShape" > + <property name="frameShape"> <enum>QFrame::NoFrame</enum> </property> - <property name="frameShadow" > + <property name="frameShadow"> <enum>QFrame::Plain</enum> </property> - <property name="lineWidth" > + <property name="lineWidth"> <number>0</number> </property> - <layout class="QGridLayout" > - <item row="0" column="0" > - <widget class="SMCStyleWidget" native="1" name="cpage" /> + <layout class="QGridLayout"> + <item row="0" column="0"> + <widget class="SMCStyleWidget" name="cpage" native="true"/> </item> </layout> </widget> @@ -672,7 +700,7 @@ </item> </layout> </widget> - <layoutdefault spacing="5" margin="5" /> + <layoutdefault spacing="5" margin="5"/> <customwidgets> <customwidget> <class>SMScComboBox</class> Index: scribus/smtextstyles.cpp =================================================================== --- scribus/smtextstyles.cpp (wersja 17188) +++ scribus/smtextstyles.cpp (kopia robocza) @@ -515,6 +515,8 @@ connect(pwidget_->dropCapLines_, SIGNAL(valueChanged(int)), this, SLOT(slotDropCapLines(int))); connect(pwidget_->dropCapOffset_, SIGNAL(valueChanged(double)), this, SLOT(slotDropCapOffset())); + connect(pwidget_->hyphenationMode, SIGNAL(activated(int)), this, SLOT(slotHyphenationMode(int))); + connect(pwidget_->tabList_, SIGNAL(tabsChanged()), this, SLOT(slotTabRuler())); connect(pwidget_->tabList_, SIGNAL(mouseReleased()), this, SLOT(slotTabRuler())); connect(pwidget_->tabList_->left_, SIGNAL(valueChanged(double)), this, SLOT(slotLeftIndent())); @@ -587,6 +589,8 @@ disconnect(pwidget_->dropCapLines_, SIGNAL(valueChanged(int)), this, SLOT(slotDropCapLines(int))); disconnect(pwidget_->dropCapOffset_, SIGNAL(valueChanged(double)), this, SLOT(slotDropCapOffset())); + disconnect(pwidget_->hyphenationMode, SIGNAL(activated(int)), this, SLOT(slotHyphenationMode(int))); + disconnect(pwidget_->parentCombo, SIGNAL(activated(const QString&)), this, SLOT(slotParentChanged(const QString&))); @@ -900,6 +904,18 @@ } } +void SMParagraphStyle::slotHyphenationMode(int mh) +{ + for (int i = 0; i < selection_.count(); ++i) + selection_[i]->setHyphenationMode(mh); + + if (!selectionIsDirty_) + { + selectionIsDirty_ = true; + emit selectionDirty(); + } +} + void SMParagraphStyle::slotTabRuler() { if (pwidget_->tabList_->useParentTabs()) |
|
About "- add local control for hyphenation for selected paragraphs to PP " do you mean adding to PP what is in Extra at present time or adding to PP the hyphenation settings that are in the Prefs at present time? |
|
I mean in PP should be possibility to set "local" hyphenation mode for selected paragraphs which will override setting from style`s definition, so user can quickly enable/disable hyphenation not changing paragraph style (like other changes for paragraph properties done in PP - PP does it local, not changing style definition). Personally I want to see all paragraph`s properties changeable "localy" by PP - we still have missing Drop Caps control and paragraphs margins (gaps before and after and left/right margins) control in PP. But I am waiting for new PP to see what will done there. |
|
http://bugs.scribus.net/view.php?id=1279 |
|
Cezary.. where are you up to with the TODOs here? Can you please provide a diff to current trunk for the existing work.. (and only the existing change for this work, no other patches) |
|
Patch for current trunk is in 0011370. |
|
The hyphenation based on the language text property has been implemented by HOST. I think that we can close this... |
|
Yup. |
Date Modified | Username | Field | Change |
---|---|---|---|
2011-03-17 10:30 | cezaryece | New Issue | |
2011-03-17 10:30 | cezaryece | File Added: HyphenationModeinParStyle.patch | |
2011-03-17 10:48 | cezaryece | Note Added: 0025827 | |
2011-03-17 14:56 | cezaryece | Note Added: 0025833 | |
2011-03-21 07:03 | cbradney | Note Added: 0025866 | |
2011-04-06 08:26 | cezaryece | Note Added: 0026012 | |
2011-04-16 09:25 | cbradney | Target Version | => 1.4.1 |
2011-10-27 13:24 | louisdesjardins | Note Added: 0027117 | |
2011-10-27 13:26 | louisdesjardins | File Added: typographiccolour.ui | |
2011-10-31 20:41 | avox | Note Added: 0027138 | |
2011-10-31 21:44 | cezaryece | Note Added: 0027139 | |
2011-10-31 21:48 | cezaryece | Note Edited: 0027139 | |
2011-10-31 21:53 | cbradney | Note Added: 0027140 | |
2011-10-31 23:05 | louisdesjardins | Note Added: 0027141 | |
2011-10-31 23:56 | cezaryece | Note Added: 0027142 | |
2011-11-16 20:54 | louisdesjardins | Note Added: 0027215 | |
2011-11-17 10:32 | Mike | Note Added: 0027220 | |
2011-11-17 15:50 | louisdesjardins | Note Added: 0027223 | |
2011-11-17 18:50 | Mike | Note Added: 0027225 | |
2011-11-17 18:51 | Mike | File Added: hyphenationstyle.ui | |
2011-11-18 18:18 | louisdesjardins | Note Added: 0027232 | |
2011-11-20 19:34 | Mike | Note Added: 0027244 | |
2011-11-20 19:51 | Mike | Note Edited: 0027244 | |
2011-11-20 19:52 | Mike | Note Edited: 0027244 | |
2011-11-21 02:23 | louisdesjardins | Note Added: 0027246 | |
2011-11-21 02:24 | louisdesjardins | File Added: typographiccolourV2.ui | |
2011-11-21 02:32 | louisdesjardins | Note Added: 0027247 | |
2011-11-21 02:33 | louisdesjardins | Note Edited: 0027246 | |
2011-11-21 02:37 | louisdesjardins | Note Edited: 0027247 | |
2011-11-21 14:02 | louisdesjardins | Note Added: 0027250 | |
2011-11-22 03:37 | louisdesjardins | Note Edited: 0027246 | |
2012-01-03 20:29 | cbradney | Note Added: 0027445 | |
2012-01-04 09:43 | cezaryece | Note Added: 0027449 | |
2012-01-04 13:50 | Mike | Note Added: 0027450 | |
2012-01-04 18:33 | cbradney | Note Added: 0027452 | |
2012-01-05 21:19 | louisdesjardins | Note Added: 0027467 | |
2012-01-06 08:34 | StefanM | Note Added: 0027471 | |
2012-01-06 19:26 | louisdesjardins | Note Added: 0027475 | |
2012-01-06 21:28 | cbradney | Note Added: 0027477 | |
2012-01-09 02:01 | louisdesjardins | Note Added: 0027495 | |
2012-01-09 02:18 | louisdesjardins | Note Added: 0027496 | |
2012-01-09 14:37 | cezaryece | File Added: hyph_control.patch | |
2012-01-09 14:45 | cezaryece | Note Added: 0027499 | |
2012-01-10 09:26 | cezaryece | Note Added: 0027502 | |
2012-01-10 09:27 | cezaryece | File Added: hyph_control2.patch | |
2012-01-10 13:35 | louisdesjardins | Note Added: 0027504 | |
2012-01-10 14:25 | cezaryece | Note Added: 0027505 | |
2012-01-10 14:30 | cezaryece | Note Edited: 0027505 | |
2012-01-10 21:47 | louisdesjardins | Note Added: 0027509 | |
2012-01-10 21:48 | louisdesjardins | Relationship added | child of 0001279 |
2012-04-29 21:12 | cbradney | Target Version | 1.4.1 => 1.4.2 |
2012-06-14 21:20 | cbradney | Note Added: 0028136 | |
2012-10-03 13:18 | ale | Summary | [NEW FEATURE] add controll for Hyphenation Mode property of Pragraph Style => [PATCH] add controll for Hyphenation Mode property of Pragraph Style |
2013-01-13 21:32 | cbradney | Target Version | 1.4.2 => 1.4.3 |
2013-01-14 10:13 | cezaryece | Note Added: 0029702 | |
2013-07-04 20:24 | cbradney | Target Version | 1.4.3 => 1.5.0 |
2014-07-03 19:41 | Kunda | Target Version | 1.5.0 => 1.5.1 |
2014-10-24 23:00 | Kunda | Patch | => Yes |
2015-09-14 17:35 | Kunda | Summary | [PATCH] add controll for Hyphenation Mode property of Pragraph Style => [PATCH] Add control for Hyphenation Mode property of Paragraph Style |
2015-11-13 01:38 | Kunda | Relationship added | child of 0012496 |
2016-01-23 17:17 | cbradney | Target Version | 1.5.1 => 1.5.3 |
2016-12-08 22:04 | Kunda | Target Version | 1.5.3 => 1.5.4 |
2019-08-20 09:17 | ale | Note Added: 0046497 | |
2019-08-20 09:19 | ale | Summary | [PATCH] Add control for Hyphenation Mode property of Paragraph Style => [PATCH, OBSOLETE] Add control for Hyphenation Mode property of Paragraph Style |
2019-09-28 05:50 | jghali | Assigned To | => jghali |
2019-09-28 05:50 | jghali | Status | new => resolved |
2019-09-28 05:50 | jghali | Resolution | open => no change required |
2019-09-28 05:50 | jghali | Note Added: 0046707 | |
2019-09-28 05:51 | jghali | Status | resolved => closed |