View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0016923 | Scribus | Typography | public | 2023-04-03 18:25 | 2023-05-29 18:56 |
Reporter | pmjdebruijn | Assigned To | jghali | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 1.6.0.svn | ||||
Fixed in Version | 1.6.0.svn | ||||
Summary | 0016923: OpenType c2sc not practically usable | ||||
Description | Currently OpenType features with regard to caps are exposed via a RadioGroup: (1) Default Capitals (2) Small Capitals [+smcp] (3) Small Capitals from Capitals [+c2sc] Meaning only one of these three can be selected. This is not however how +c2sc is meant to work, as it's intended to primarily work in tandem with +smcp. Enabling +smcp will leave regular large caps alone, and transform lower case into small caps. Merely enabling +c2sc will only smallcap the regular large caps, resulting in something that is bizarre looking, as regular lowercase remains. Enabling both +smcp +c2sc (currently not possible in Scribus) will smallcap both regular large caps and lowercase, which is how +c2sc is supposed to be used. There's two ways to resolve this: (1) Keep the RadioGroup and change 'Small Capitals from Capitals' to 'All Small Capitals' that enables both +smcp and +c2sc, this will remove the possibly of having on +c2sc enabled exclusively which I don't think is particularly useful. (2) Change it into a list of CheckBoxes, (thus Default Capitals can be removed), so maximum control remains. I'm guessing this issue also applies to Petite Capitals from Capitals as well. | ||||
Steps To Reproduce | Create a text box Select a font that properly supports both smcp and c2sc (like Alegreya) Only enable 'Small Capitals from Capitals to see useless behavior Enable 'Small Capitals' as well to see intended use of 'Small Capitals from Capitals' | ||||
Tags | No tags attached. | ||||
Patch | No | ||||
|
I could imagine, that for maximum compatibility with already saved files, solution (2) might be preferred? |
|
@jghali what's your view on this? |
|
Attached is a screenshot of how the UI would look with Checkboxes (for strategy 2), however, I'm not quite sure how Titling/Unicase would fit into this, so I'm not sure this would be an improvement from a UI perspective, even though it would fix this bug. |
|
Alternatively, here's a patch that at least on the surface seems to work for strategy (1), which I think is the right one. Looking at screenshots, this seems to be the way InDesign is handling it as well. Though in theory, this may cause issues for older files, as there could be files with merely c2sc enabled (though I doubt those files actually exist in real world use). The patch should be viewed as a prototype, as it's only had summary testing, and I don't fully grasp the relevant code in it's entirety. fix-opentype-allcaps.patch (4,654 bytes)
diff -Nurpd a/scribus/ui/propertywidget_fontfeaturesbase.ui b/scribus/ui/propertywidget_fontfeaturesbase.ui --- a/scribus/ui/propertywidget_fontfeaturesbase.ui 2023-04-04 19:21:32.000000000 +0200 +++ b/scribus/ui/propertywidget_fontfeaturesbase.ui 2023-04-04 20:15:54.487896458 +0200 @@ -116,7 +116,7 @@ <item> <widget class="QRadioButton" name="SmallRadio"> <property name="toolTip"> - <string>Small capitals (smcp)</string> + <string>Small Capitals (smcp)</string> </property> <property name="text"> <string>Small Capitals</string> @@ -129,10 +129,10 @@ <item> <widget class="QRadioButton" name="SmallFromCRadio"> <property name="toolTip"> - <string>Small capitals from capitals (c2sc)</string> + <string>All Small Capitals (smcp+c2sc)</string> </property> <property name="text"> - <string>Small Capitals from Capitals</string> + <string>All Small Capitals</string> </property> <attribute name="buttonGroup"> <string notr="true">CapitalsGroup</string> @@ -142,7 +142,7 @@ <item> <widget class="QRadioButton" name="PetiteRadio"> <property name="toolTip"> - <string>Petite capitals (pcap)</string> + <string>Petite Capitals (pcap)</string> </property> <property name="text"> <string>Petite Capitals</string> @@ -155,10 +155,10 @@ <item> <widget class="QRadioButton" name="PetiteCapRadio"> <property name="toolTip"> - <string>Petite capitals from capitals (c2pc)</string> + <string>All Petite Capitals (pcap+c2pc)</string> </property> <property name="text"> - <string>Petite Capitals from Capitals</string> + <string>All Petite Capitals</string> </property> <attribute name="buttonGroup"> <string notr="true">CapitalsGroup</string> diff -Nurpd a/scribus/ui/propertywidget_fontfeatures.cpp b/scribus/ui/propertywidget_fontfeatures.cpp --- a/scribus/ui/propertywidget_fontfeatures.cpp 2023-04-04 19:21:32.000000000 +0200 +++ b/scribus/ui/propertywidget_fontfeatures.cpp 2023-04-04 20:21:07.037722204 +0200 @@ -165,11 +165,11 @@ void PropertyWidget_FontFeatures::handle if (SmallRadio->isChecked()) font_feature << "+smcp"; if (SmallFromCRadio->isChecked()) - font_feature << "+c2sc"; + font_feature << "+smcp,+c2sc"; if (PetiteRadio->isChecked()) font_feature << "+pcap"; if (PetiteCapRadio->isChecked()) - font_feature << "+c2pc"; + font_feature << "+pcap,+c2pc"; if (UnicaseRadio->isChecked()) font_feature << "+unic"; if (TiltingRadio->isChecked()) diff -Nurpd a/scribus/ui/smfontfeaturesbase.ui b/scribus/ui/smfontfeaturesbase.ui --- a/scribus/ui/smfontfeaturesbase.ui 2023-04-04 19:21:32.000000000 +0200 +++ b/scribus/ui/smfontfeaturesbase.ui 2023-04-04 20:15:54.487896458 +0200 @@ -167,12 +167,12 @@ </item> <item> <property name="text"> - <string>Petite Capitals from Capitals</string> + <string>All Petite Capitals</string> </property> </item> <item> <property name="text"> - <string>Small Capitals from Capitals</string> + <string>All Small Capitals</string> </property> </item> </widget> diff -Nurpd a/scribus/ui/smfontfeatures.cpp b/scribus/ui/smfontfeatures.cpp --- a/scribus/ui/smfontfeatures.cpp 2023-04-04 19:21:32.000000000 +0200 +++ b/scribus/ui/smfontfeatures.cpp 2023-04-04 20:20:02.813262547 +0200 @@ -487,12 +487,12 @@ void SMFontFeatures::setupCapitalCombo(q if (featureFlags & FontFeatures::SmallCaps) capitalsComboBox->addItem(tr("Small Capitals"), QVariant("+smcp")); - if (featureFlags & FontFeatures::SmallCapsFromCaps) - capitalsComboBox->addItem(tr("Small Capitals from Capitals"), QVariant("+c2sc")); + if (featureFlags & (FontFeatures::SmallCaps | FontFeatures::SmallCapsFromCaps)) + capitalsComboBox->addItem(tr("All Small Capitals"), QVariant("+smcp,+c2sc")); if (featureFlags & FontFeatures::PetiteCaps) capitalsComboBox->addItem(tr("Petite Capitals"), QVariant("+pcap")); - if (featureFlags & FontFeatures::PetiteCapsFromCaps) - capitalsComboBox->addItem(tr("Petite Capitals from Capitals"), QVariant("+c2pc")); + if (featureFlags & (FontFeatures::PetiteCaps | FontFeatures::PetiteCapsFromCaps)) + capitalsComboBox->addItem(tr("All Petite Capitals"), QVariant("+pcap,+c2pc")); if (featureFlags & FontFeatures::UnicaseCaps) capitalsComboBox->addItem(tr("Unicase"), QVariant("+unic")); if (featureFlags & FontFeatures::TiltingCaps) |
|
The Unicase and Titling capitals options are not compatible with the Small and Petite capitals options so we have to keep radio buttons in some way. After some thought I think a solution could be to add the All Small Capitals and All Petite Capitals options as radio buttons. At that point the radio button list is beginning to be a bit long tho so come the question if we should keep the radio button list or use a combobox like in style manager. |
|
@jghali that's more or less what my patch does. At least in so far that replaces "Small Caps from Capitals" with "All Small Caps" and similar for Petite, given that the option isn't useful on it's own, so the UI isn't growing in any sense that way. |
|
If you insist on keeping "Small Caps from Capitals" and "Petite Caps from Capitals", presumably this is what you'll be looking for? (This is just a UI mockup, I don't have supporting code yet) Just taking a quick look, this would result in a much more involved patch, so I'd be willing to take a stab at it, if this is the approach you want. |
|
Here are some news : I have implemented the radio button solution and here is a patch for 1.5.9.svn. It needs more testing but my first tests look ok. 16923-ot-c2sc-not-practically-usable.patch (38,558 bytes)
Index: scribus/fonts/fontfeatures.cpp =================================================================== --- scribus/fonts/fontfeatures.cpp (revision 25428) +++ scribus/fonts/fontfeatures.cpp (working copy) @@ -54,6 +54,8 @@ quint64 FontFeatures::CapsMask = FontFeatures::SmallCaps + FontFeatures::SmallCapsFromCaps + FontFeatures::PetiteCaps + FontFeatures::PetiteCapsFromCaps + FontFeatures::UnicaseCaps + FontFeatures::TiltingCaps; +quint64 FontFeatures::AllSmallCapsMask = FontFeatures::SmallCaps + FontFeatures::SmallCapsFromCaps; +quint64 FontFeatures::AllPetiteCapsMask = FontFeatures::PetiteCaps + FontFeatures::PetiteCapsFromCaps; quint64 FontFeatures::GlyphPositionMask = FontFeatures::Subscript + FontFeatures::Superscript + FontFeatures::Ordinals; quint64 FontFeatures::NumeralStyleMask = FontFeatures::LiningNumerals + FontFeatures::OldStyleNumerals; @@ -266,3 +268,99 @@ return flags; } + + +QStringList FontFeatures::textFeaturesFromFlags(quint64 flags) +{ + QStringList features; + + if ((flags & FontFeatures::CommonLigatures) == 0) + features << "-liga"; + if ((flags & FontFeatures::ContextualLigatures) == 0) + features << "-clig"; + if (flags & FontFeatures::DiscretionaryLigatures) + features << "+dlig"; + if (flags & FontFeatures::HistoricalLigatures) + features << "+hlig"; + + if (flags & FontFeatures::SmallCaps) + features << "+smcp"; + if (flags & FontFeatures::SmallCapsFromCaps) + features << "+c2sc"; + if (flags & FontFeatures::PetiteCaps) + features << "+pcap"; + if (flags & FontFeatures::PetiteCapsFromCaps) + features << "+c2pc"; + if (flags & FontFeatures::UnicaseCaps) + features << "+unic"; + if (flags & FontFeatures::TiltingCaps) + features << "+titl"; + + if (flags & FontFeatures::LiningNumerals) + features << "+lnum"; + if (flags & FontFeatures::OldStyleNumerals) + features << "+onum"; + + if (flags & FontFeatures::ProportionalNumeralWidth) + features << "+pnum"; + if (flags & FontFeatures::TabularNumeralWidth) + features << "+tnum"; + + if (flags & FontFeatures::DiagonalFractions) + features << "+frac"; + if (flags & FontFeatures::StackedFractions) + features << "+afrc"; + + if (flags & FontFeatures::Subscript) + features << "+subs"; + if (flags & FontFeatures::Superscript) + features << "+sups"; + if (flags & FontFeatures::Ordinals) + features << "+ordn"; + + if (flags & FontFeatures::SlashedZero) + features << "+zero"; + + if (flags & FontFeatures::StyleSet01) + features << "+ss01"; + if (flags & FontFeatures::StyleSet02) + features << "+ss02"; + if (flags & FontFeatures::StyleSet03) + features << "+ss03"; + if (flags & FontFeatures::StyleSet04) + features << "+ss04"; + if (flags & FontFeatures::StyleSet05) + features << "+ss04"; + if (flags & FontFeatures::StyleSet06) + features << "+ss06"; + if (flags & FontFeatures::StyleSet07) + features << "+ss07"; + if (flags & FontFeatures::StyleSet08) + features << "+ss08"; + if (flags & FontFeatures::StyleSet09) + features << "+ss09"; + if (flags & FontFeatures::StyleSet10) + features << "+ss10"; + if (flags & FontFeatures::StyleSet11) + features << "+ss11"; + if (flags & FontFeatures::StyleSet12) + features << "+ss12"; + if (flags & FontFeatures::StyleSet13) + features << "+ss13"; + if (flags & FontFeatures::StyleSet14) + features << "+ss14"; + if (flags & FontFeatures::StyleSet15) + features << "+ss15"; + if (flags & FontFeatures::StyleSet16) + features << "+ss16"; + if (flags & FontFeatures::StyleSet17) + features << "+ss17"; + if (flags & FontFeatures::StyleSet18) + features << "+ss18"; + if (flags & FontFeatures::StyleSet19) + features << "+ss19"; + if (flags & FontFeatures::StyleSet20) + features << "+ss20"; + + return features; +} Index: scribus/fonts/fontfeatures.h =================================================================== --- scribus/fonts/fontfeatures.h (revision 25428) +++ scribus/fonts/fontfeatures.h (working copy) @@ -59,6 +59,8 @@ static quint64 LigaturesMask; static quint64 CapsMask; + static quint64 AllSmallCapsMask; + static quint64 AllPetiteCapsMask; static quint64 GlyphPositionMask; static quint64 NumeralStyleMask; static quint64 NumeralWidthMask; @@ -67,6 +69,7 @@ static quint64 fontFlagsFromList(const QStringList& features); static quint64 textFlagsFromList(const QStringList& features); + static QStringList textFeaturesFromFlags(quint64 flags); }; #endif Index: scribus/ui/propertywidget_fontfeatures.cpp =================================================================== --- scribus/ui/propertywidget_fontfeatures.cpp (revision 25428) +++ scribus/ui/propertywidget_fontfeatures.cpp (working copy) @@ -52,92 +52,104 @@ enableFeatures(availableFeatures); QStringList fontFeatures = s.split(','); + quint64 featureFlags = FontFeatures::textFlagsFromList(fontFeatures); + ContextualCheck->setChecked(true); CommonCheck->setChecked(true); SlashedZeroCheck->setEnabled(true); - for (int i = 0; i < fontFeatures.count(); i++) - { - if (fontFeatures[i] == "-clig") - ContextualCheck->setChecked(false); - else if (fontFeatures[i] == "-liga") - CommonCheck->setChecked(false); - else if (fontFeatures[i] == "+dlig") - DiscretionaryCheck->setChecked(true); - else if (fontFeatures[i] == "+hlig") - HistoricalCheck->setChecked(true); - else if (fontFeatures[i] == "+subs") - SubscriptRadio->setChecked(true); - else if (fontFeatures[i] == "+sups") - SuperscriptRadio->setChecked(true); - else if (fontFeatures[i] == "+smcp") - SmallRadio->setChecked(true); - else if (fontFeatures[i] == "+c2sc") - SmallFromCRadio->setChecked(true); - else if (fontFeatures[i] == "+pcap") - PetiteRadio->setChecked(true); - else if (fontFeatures[i] == "+c2pc") - PetiteCapRadio->setChecked(true); - else if (fontFeatures[i] == "+unic") - UnicaseRadio->setChecked(true); - else if (fontFeatures[i] == "+titl") - TiltingRadio->setChecked(true); - else if (fontFeatures[i] == "+lnum") - LiningRadio->setChecked(true); - else if (fontFeatures[i] == "+onum") - OldStyleRadio->setChecked(true); - else if (fontFeatures[i] == "+pnum") - ProportionalRadio->setChecked(true); - else if (fontFeatures[i] == "+tnum") - TabularRadio->setChecked(true); - else if (fontFeatures[i] == "+frac") - DiagonalRadio->setChecked(true); - else if (fontFeatures[i] == "+afrc") - StackedRadio->setChecked(true); - else if (fontFeatures[i] == "+ordn") - OrdinalCheck->setChecked(true); - else if (fontFeatures[i] == "+zero") - SlashedZeroCheck->setChecked(true); - else if (fontFeatures[i] == "+ss01") - StyleSet01->setChecked(true); - else if (fontFeatures[i] == "+ss02") - StyleSet02->setChecked(true); - else if (fontFeatures[i] == "+ss03") - StyleSet03->setChecked(true); - else if (fontFeatures[i] == "+ss04") - StyleSet04->setChecked(true); - else if (fontFeatures[i] == "+ss05") - StyleSet05->setChecked(true); - else if (fontFeatures[i] == "+ss06") - StyleSet06->setChecked(true); - else if (fontFeatures[i] == "+ss07") - StyleSet07->setChecked(true); - else if (fontFeatures[i] == "+ss08") - StyleSet08->setChecked(true); - else if (fontFeatures[i] == "+ss09") - StyleSet09->setChecked(true); - else if (fontFeatures[i] == "+ss10") - StyleSet10->setChecked(true); - else if (fontFeatures[i] == "+ss11") - StyleSet11->setChecked(true); - else if (fontFeatures[i] == "+ss12") - StyleSet12->setChecked(true); - else if (fontFeatures[i] == "+ss13") - StyleSet13->setChecked(true); - else if (fontFeatures[i] == "+ss14") - StyleSet14->setChecked(true); - else if (fontFeatures[i] == "+ss15") - StyleSet15->setChecked(true); - else if (fontFeatures[i] == "+ss16") - StyleSet16->setChecked(true); - else if (fontFeatures[i] == "+ss17") - StyleSet17->setChecked(true); - else if (fontFeatures[i] == "+ss18") - StyleSet18->setChecked(true); - else if (fontFeatures[i] == "+ss19") - StyleSet19->setChecked(true); - else if (fontFeatures[i] == "+ss20") - StyleSet20->setChecked(true); - } + + if ((featureFlags & FontFeatures::CommonLigatures) == 0) + CommonCheck->setChecked(false); + if ((featureFlags & FontFeatures::ContextualLigatures) == 0) + ContextualCheck->setChecked(false); + if (featureFlags & FontFeatures::DiscretionaryLigatures) + DiscretionaryCheck->setChecked(true); + if (featureFlags & FontFeatures::HistoricalLigatures) + HistoricalCheck->setChecked(true); + + if ((featureFlags & FontFeatures::AllSmallCapsMask) == FontFeatures::AllSmallCapsMask) + AllSmallCapsRadio->setChecked(true); + else if (featureFlags & FontFeatures::SmallCaps) + SmallRadio->setChecked(true); + else if (featureFlags & FontFeatures::SmallCapsFromCaps) + SmallFromCRadio->setChecked(true); + if ((featureFlags & FontFeatures::AllPetiteCapsMask) == FontFeatures::AllPetiteCapsMask) + AllPetiteCapsRadio->setChecked(true); + else if (featureFlags & FontFeatures::PetiteCaps) + PetiteRadio->setChecked(true); + else if (featureFlags & FontFeatures::PetiteCapsFromCaps) + PetiteCapRadio->setChecked(true); + if (featureFlags & FontFeatures::UnicaseCaps) + UnicaseRadio->setChecked(true); + if (featureFlags & FontFeatures::TiltingCaps) + TiltingRadio->setChecked(true); + + if (featureFlags & FontFeatures::LiningNumerals) + LiningRadio->setChecked(true); + if (featureFlags & FontFeatures::OldStyleNumerals) + OldStyleRadio->setChecked(true); + + if (featureFlags & FontFeatures::ProportionalNumeralWidth) + ProportionalRadio->setChecked(true); + if (featureFlags & FontFeatures::TabularNumeralWidth) + TabularRadio->setChecked(true); + + if (featureFlags & FontFeatures::DiagonalFractions) + DiagonalRadio->setChecked(true); + if (featureFlags & FontFeatures::StackedFractions) + StackedRadio->setChecked(true); + + if (featureFlags & FontFeatures::Subscript) + SubscriptRadio->setChecked(true); + if (featureFlags & FontFeatures::Superscript) + SuperscriptRadio->setChecked(true); + if (featureFlags & FontFeatures::Ordinals) + OrdinalCheck->setChecked(true); + + if (featureFlags & FontFeatures::SlashedZero) + SlashedZeroCheck->setChecked(true); + + if (featureFlags & FontFeatures::StyleSet01) + StyleSet01->setChecked(true); + if (featureFlags & FontFeatures::StyleSet02) + StyleSet02->setChecked(true); + if (featureFlags & FontFeatures::StyleSet03) + StyleSet03->setChecked(true); + if (featureFlags & FontFeatures::StyleSet04) + StyleSet04->setChecked(true); + if (featureFlags & FontFeatures::StyleSet05) + StyleSet05->setChecked(true); + if (featureFlags & FontFeatures::StyleSet06) + StyleSet06->setChecked(true); + if (featureFlags & FontFeatures::StyleSet07) + StyleSet07->setChecked(true); + if (featureFlags & FontFeatures::StyleSet08) + StyleSet08->setChecked(true); + if (featureFlags & FontFeatures::StyleSet09) + StyleSet09->setChecked(true); + if (featureFlags & FontFeatures::StyleSet10) + StyleSet10->setChecked(true); + if (featureFlags & FontFeatures::StyleSet11) + StyleSet11->setChecked(true); + if (featureFlags & FontFeatures::StyleSet12) + StyleSet12->setChecked(true); + if (featureFlags & FontFeatures::StyleSet13) + StyleSet13->setChecked(true); + if (featureFlags & FontFeatures::StyleSet14) + StyleSet14->setChecked(true); + if (featureFlags & FontFeatures::StyleSet15) + StyleSet15->setChecked(true); + if (featureFlags & FontFeatures::StyleSet16) + StyleSet16->setChecked(true); + if (featureFlags & FontFeatures::StyleSet17) + StyleSet17->setChecked(true); + if (featureFlags & FontFeatures::StyleSet18) + StyleSet18->setChecked(true); + if (featureFlags & FontFeatures::StyleSet19) + StyleSet19->setChecked(true); + if (featureFlags & FontFeatures::StyleSet20) + StyleSet20->setChecked(true); + if (OldStyleRadio->isChecked()) { SlashedZeroCheck->setChecked(false); @@ -162,13 +174,13 @@ font_feature << "+hlig"; //Capitals - if (SmallRadio->isChecked()) + if (SmallRadio->isChecked() || AllSmallCapsRadio->isChecked()) font_feature << "+smcp"; - if (SmallFromCRadio->isChecked()) + if (SmallFromCRadio->isChecked() || AllSmallCapsRadio->isChecked()) font_feature << "+c2sc"; - if (PetiteRadio->isChecked()) + if (PetiteRadio->isChecked() || AllPetiteCapsRadio->isChecked()) font_feature << "+pcap"; - if (PetiteCapRadio->isChecked()) + if (PetiteCapRadio->isChecked() || AllPetiteCapsRadio->isChecked()) font_feature << "+c2pc"; if (UnicaseRadio->isChecked()) font_feature << "+unic"; @@ -308,8 +320,10 @@ connect(NormalCapRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures()), Qt::UniqueConnection); connect(SmallRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures()), Qt::UniqueConnection); connect(SmallFromCRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures()), Qt::UniqueConnection); + connect(AllSmallCapsRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures()), Qt::UniqueConnection); connect(PetiteRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures()), Qt::UniqueConnection); connect(PetiteCapRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures()), Qt::UniqueConnection); + connect(AllPetiteCapsRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures()), Qt::UniqueConnection); connect(UnicaseRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures()), Qt::UniqueConnection); connect(TiltingRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures()), Qt::UniqueConnection); @@ -364,8 +378,10 @@ disconnect(NormalCapRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures())); disconnect(SmallRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures())); disconnect(SmallFromCRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures())); + disconnect(AllSmallCapsRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures())); disconnect(PetiteRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures())); disconnect(PetiteCapRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures())); + disconnect(AllPetiteCapsRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures())); disconnect(UnicaseRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures())); disconnect(TiltingRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures())); @@ -460,8 +476,10 @@ SmallRadio->setVisible(newFlags & FontFeatures::SmallCaps); SmallFromCRadio->setVisible(newFlags & FontFeatures::SmallCapsFromCaps); + AllSmallCapsRadio->setVisible((newFlags & FontFeatures::AllSmallCapsMask) == FontFeatures::AllSmallCapsMask); PetiteRadio->setVisible(newFlags & FontFeatures::PetiteCaps); PetiteCapRadio->setVisible(newFlags & FontFeatures::PetiteCapsFromCaps); + AllPetiteCapsRadio->setVisible((newFlags & FontFeatures::AllPetiteCapsMask) == FontFeatures::AllPetiteCapsMask); UnicaseRadio->setVisible(newFlags & FontFeatures::UnicaseCaps); TiltingRadio->setVisible(newFlags & FontFeatures::TiltingCaps); @@ -648,8 +666,10 @@ NormalCapRadio->setChecked(true); SmallRadio->setChecked(false); SmallFromCRadio->setChecked(false); + AllSmallCapsRadio->setChecked(false); PetiteRadio->setChecked(false); PetiteCapRadio->setChecked(false); + AllPetiteCapsRadio->setChecked(false); UnicaseRadio->setChecked(false); TiltingRadio->setChecked(false); Index: scribus/ui/propertywidget_fontfeaturesbase.ui =================================================================== --- scribus/ui/propertywidget_fontfeaturesbase.ui (revision 25428) +++ scribus/ui/propertywidget_fontfeaturesbase.ui (working copy) @@ -7,7 +7,7 @@ <x>0</x> <y>0</y> <width>509</width> - <height>837</height> + <height>758</height> </rect> </property> <layout class="QVBoxLayout" name="verticalLayout"> @@ -140,6 +140,16 @@ </widget> </item> <item> + <widget class="QRadioButton" name="AllSmallCapsRadio"> + <property name="text"> + <string>All Small Caps</string> + </property> + <attribute name="buttonGroup"> + <string notr="true">CapitalsGroup</string> + </attribute> + </widget> + </item> + <item> <widget class="QRadioButton" name="PetiteRadio"> <property name="toolTip"> <string>Petite capitals (pcap)</string> @@ -166,6 +176,16 @@ </widget> </item> <item> + <widget class="QRadioButton" name="AllPetiteCapsRadio"> + <property name="text"> + <string>All Petite Caps</string> + </property> + <attribute name="buttonGroup"> + <string notr="true">CapitalsGroup</string> + </attribute> + </widget> + </item> + <item> <widget class="QRadioButton" name="UnicaseRadio"> <property name="toolTip"> <string>Unicase (unic)</string> @@ -628,8 +648,8 @@ <buttongroups> <buttongroup name="PositionGroup"/> <buttongroup name="CapitalsGroup"/> + <buttongroup name="FractionsGroup"/> + <buttongroup name="NumeralStyleGroup"/> <buttongroup name="NumeralWidthGroup"/> - <buttongroup name="NumeralStyleGroup"/> - <buttongroup name="FractionsGroup"/> </buttongroups> </ui> Index: scribus/ui/smfontfeatures.cpp =================================================================== --- scribus/ui/smfontfeatures.cpp (revision 25428) +++ scribus/ui/smfontfeatures.cpp (working copy) @@ -64,11 +64,11 @@ QSignalBlocker blocker10(this->fractionComboBox); QSignalBlocker blocker11(this->styleSetsMenu); - QStringList capitalFeatures = comboboxFeatures(capitalsComboBox); - QStringList positionFeatures = comboboxFeatures(positionComboBox); - QStringList numeralFeatures = comboboxFeatures(numeralComboBox); - QStringList widthFeatures = comboboxFeatures(widthComboBox); - QStringList fractionFeatures = comboboxFeatures(fractionComboBox); + quint64 capitalFeatures = comboboxFeatures(capitalsComboBox); + quint64 positionFeatures = comboboxFeatures(positionComboBox); + quint64 numeralFeatures = comboboxFeatures(numeralComboBox); + quint64 widthFeatures = comboboxFeatures(widthComboBox); + quint64 fractionFeatures = comboboxFeatures(fractionComboBox); int oldCapitalIndex = capitalsComboBox->currentIndex(); int oldPositionIndex = positionComboBox->currentIndex(); @@ -78,11 +78,11 @@ retranslateUi(this); - setupCapitalCombo(FontFeatures::textFlagsFromList(capitalFeatures)); - setupPositionCombo(FontFeatures::textFlagsFromList(positionFeatures)); - setupNumeralStyleCombo(FontFeatures::textFlagsFromList(numeralFeatures)); - setupNumeralWidthCombo(FontFeatures::textFlagsFromList(widthFeatures)); - setupNumeralFractionCombo(FontFeatures::textFlagsFromList(fractionFeatures)); + setupCapitalCombo(capitalFeatures); + setupPositionCombo(positionFeatures); + setupNumeralStyleCombo(numeralFeatures); + setupNumeralWidthCombo(widthFeatures); + setupNumeralFractionCombo(fractionFeatures); capitalsComboBox->setCurrentIndex(oldCapitalIndex); positionComboBox->setCurrentIndex(oldPositionIndex); @@ -91,15 +91,14 @@ fractionComboBox->setCurrentIndex(oldFractionIndex); } -QStringList SMFontFeatures::comboboxFeatures(QComboBox* combo) const +quint64 SMFontFeatures::comboboxFeatures(QComboBox* combo) const { - QStringList features; + quint64 features = 0; for (int i = 0; i < combo->count(); ++i) { QVariant varVal = combo->itemData(i); - QString value = varVal.toString(); - if (value.length() > 0) - features.append(value); + quint64 value = varVal.toULongLong(); + features |= value; } return features; } @@ -115,99 +114,85 @@ SlashedZeroCheck->setEnabled(true); QStringList fontFeatures = s.split(','); - for (int i = 0; i < fontFeatures.count(); i++) - { - // Ligatures - if (fontFeatures[i] == "-clig") - ContextualCheck->setChecked(false); - else if (fontFeatures[i] == "-liga") - CommonCheck->setChecked(false); - else if (fontFeatures[i] == "+dlig") - DiscretionaryCheck->setChecked(true); - else if (fontFeatures[i] == "+hlig") - HistoricalCheck->setChecked(true); - // position comboBox - else if (fontFeatures[i] == "+subs" || - fontFeatures[i] == "+sups" || - fontFeatures[i] == "+ordn") - { - setCurrentComboItemFromData(positionComboBox, fontFeatures[i]); - } - // Capitals ComboBox - else if (fontFeatures[i] == "+smcp" || - fontFeatures[i] == "+c2sc" || - fontFeatures[i] == "+pcap" || - fontFeatures[i] == "+c2pc" || - fontFeatures[i] == "+unic" || - fontFeatures[i] == "+titl") - { - setCurrentComboItemFromData(capitalsComboBox, fontFeatures[i]); - } - // Numerals style - else if (fontFeatures[i] == "+lnum" || - fontFeatures[i] == "+onum") - { - setCurrentComboItemFromData(numeralComboBox, fontFeatures[i]); - } - // Numerals width - else if (fontFeatures[i] == "+pnum" || - fontFeatures[i] == "+tnum") - { - setCurrentComboItemFromData(widthComboBox, fontFeatures[i]); - } - // Numerals Fraction - else if (fontFeatures[i] == "+frac" || - fontFeatures[i] == "+afrc") - { - setCurrentComboItemFromData(fractionComboBox, fontFeatures[i]); - } - // Numerals Zero - else if (fontFeatures[i] == "+zero") - SlashedZeroCheck->setChecked(true); - // Style Sets - else if (fontFeatures[i] == "+ss01") - styleSetsMenu->actions().at(0)->setChecked(true); - else if (fontFeatures[i] == "+ss02") - styleSetsMenu->actions().at(1)->setChecked(true); - else if (fontFeatures[i] == "+ss03") - styleSetsMenu->actions().at(2)->setChecked(true); - else if (fontFeatures[i] == "+ss04") - styleSetsMenu->actions().at(3)->setChecked(true); - else if (fontFeatures[i] == "+ss05") - styleSetsMenu->actions().at(4)->setChecked(true); - else if (fontFeatures[i] == "+ss06") - styleSetsMenu->actions().at(5)->setChecked(true); - else if (fontFeatures[i] == "+ss07") - styleSetsMenu->actions().at(6)->setChecked(true); - else if (fontFeatures[i] == "+ss08") - styleSetsMenu->actions().at(7)->setChecked(true); - else if (fontFeatures[i] == "+ss09") - styleSetsMenu->actions().at(8)->setChecked(true); - else if (fontFeatures[i] == "+ss10") - styleSetsMenu->actions().at(9)->setChecked(true); - else if (fontFeatures[i] == "+ss11") - styleSetsMenu->actions().at(10)->setChecked(true); - else if (fontFeatures[i] == "+ss12") - styleSetsMenu->actions().at(11)->setChecked(true); - else if (fontFeatures[i] == "+ss13") - styleSetsMenu->actions().at(12)->setChecked(true); - else if (fontFeatures[i] == "+ss14") - styleSetsMenu->actions().at(13)->setChecked(true); - else if (fontFeatures[i] == "+ss15") - styleSetsMenu->actions().at(14)->setChecked(true); - else if (fontFeatures[i] == "+ss16") - styleSetsMenu->actions().at(15)->setChecked(true); - else if (fontFeatures[i] == "+ss17") - styleSetsMenu->actions().at(16)->setChecked(true); - else if (fontFeatures[i] == "+ss18") - styleSetsMenu->actions().at(17)->setChecked(true); - else if (fontFeatures[i] == "+ss19") - styleSetsMenu->actions().at(18)->setChecked(true); - else if (fontFeatures[i] == "+ss20") - styleSetsMenu->actions().at(19)->setChecked(true); - } + quint64 featureFlags = FontFeatures::textFlagsFromList(fontFeatures); - if (numeralComboBox->currentData().toString() == "+onum") + // Ligatures + if ((featureFlags & FontFeatures::CommonLigatures) == 0) + CommonCheck->setChecked(false); + if ((featureFlags & FontFeatures::ContextualLigatures) == 0) + ContextualCheck->setChecked(false); + if (featureFlags & FontFeatures::DiscretionaryLigatures) + DiscretionaryCheck->setChecked(true); + if (featureFlags & FontFeatures::HistoricalLigatures) + HistoricalCheck->setChecked(true); + + // Position comboBox + if (featureFlags & FontFeatures::GlyphPositionMask) + setCurrentComboItemFromData(positionComboBox, featureFlags & FontFeatures::GlyphPositionMask); + + // Capitals ComboBox + if (featureFlags & FontFeatures::CapsMask) + setCurrentComboItemFromData(capitalsComboBox, featureFlags & FontFeatures::CapsMask); + + // Numerals style + if (featureFlags & FontFeatures::NumeralStyleMask) + setCurrentComboItemFromData(numeralComboBox, featureFlags & FontFeatures::NumeralStyleMask); + + // Numerals width + if (featureFlags & FontFeatures::NumeralWidthMask) + setCurrentComboItemFromData(widthComboBox, featureFlags & FontFeatures::NumeralWidthMask); + + // Numerals Fraction + if (featureFlags & FontFeatures::NumeralFractionsMask) + setCurrentComboItemFromData(fractionComboBox, featureFlags & FontFeatures::NumeralFractionsMask); + + // Numerals Zero + if (featureFlags & FontFeatures::SlashedZero) + SlashedZeroCheck->setChecked(true); + + // Style Sets + if (featureFlags & FontFeatures::StyleSet01) + styleSetsMenu->actions().at(0)->setChecked(true); + if (featureFlags & FontFeatures::StyleSet02) + styleSetsMenu->actions().at(1)->setChecked(true); + if (featureFlags & FontFeatures::StyleSet03) + styleSetsMenu->actions().at(2)->setChecked(true); + if (featureFlags & FontFeatures::StyleSet04) + styleSetsMenu->actions().at(3)->setChecked(true); + if (featureFlags & FontFeatures::StyleSet05) + styleSetsMenu->actions().at(4)->setChecked(true); + if (featureFlags & FontFeatures::StyleSet06) + styleSetsMenu->actions().at(5)->setChecked(true); + if (featureFlags & FontFeatures::StyleSet07) + styleSetsMenu->actions().at(6)->setChecked(true); + if (featureFlags & FontFeatures::StyleSet08) + styleSetsMenu->actions().at(7)->setChecked(true); + if (featureFlags & FontFeatures::StyleSet09) + styleSetsMenu->actions().at(8)->setChecked(true); + if (featureFlags & FontFeatures::StyleSet10) + styleSetsMenu->actions().at(9)->setChecked(true); + if (featureFlags & FontFeatures::StyleSet11) + styleSetsMenu->actions().at(10)->setChecked(true); + if (featureFlags & FontFeatures::StyleSet12) + styleSetsMenu->actions().at(11)->setChecked(true); + if (featureFlags & FontFeatures::StyleSet13) + styleSetsMenu->actions().at(12)->setChecked(true); + if (featureFlags & FontFeatures::StyleSet14) + styleSetsMenu->actions().at(13)->setChecked(true); + if (featureFlags & FontFeatures::StyleSet15) + styleSetsMenu->actions().at(14)->setChecked(true); + if (featureFlags & FontFeatures::StyleSet16) + styleSetsMenu->actions().at(15)->setChecked(true); + if (featureFlags & FontFeatures::StyleSet17) + styleSetsMenu->actions().at(16)->setChecked(true); + if (featureFlags & FontFeatures::StyleSet18) + styleSetsMenu->actions().at(17)->setChecked(true); + if (featureFlags & FontFeatures::StyleSet19) + styleSetsMenu->actions().at(18)->setChecked(true); + if (featureFlags & FontFeatures::StyleSet20) + styleSetsMenu->actions().at(19)->setChecked(true); + + if (numeralComboBox->currentData().toULongLong() == FontFeatures::OldStyleNumerals) { SlashedZeroCheck->setChecked(false); SlashedZeroCheck->setEnabled(false); @@ -227,86 +212,91 @@ QString SMFontFeatures::fontFeatures() { - QStringList font_feature ; - if (!ContextualCheck->isChecked()) - font_feature << "-clig"; - if (!CommonCheck->isChecked()) - font_feature << "-liga"; + quint64 featureFlags = 0; + + // Ligatures + if (CommonCheck->isChecked()) + featureFlags |= FontFeatures::CommonLigatures; + if (ContextualCheck->isChecked()) + featureFlags |= FontFeatures::ContextualLigatures; if (DiscretionaryCheck->isChecked()) - font_feature << "+dlig"; + featureFlags |= FontFeatures::DiscretionaryLigatures; if (HistoricalCheck->isChecked()) - font_feature << "+hlig"; + featureFlags |= FontFeatures::HistoricalLigatures; + //Position QVariant varVal = positionComboBox->currentData(); - QString value = varVal.toString(); - if (value.length() > 0) - font_feature << value; + quint64 value = varVal.toULongLong(); + featureFlags |= value; + //Capitals varVal = capitalsComboBox->currentData(); - value = varVal.toString(); - if (value.length() > 0) - font_feature << value; + value = varVal.toULongLong(); + featureFlags |= value; + //Numerals style varVal = numeralComboBox->currentData(); - value = varVal.toString(); - if (value.length() > 0) - font_feature << value; + value = varVal.toULongLong(); + featureFlags |= value; + //Numerals width varVal = widthComboBox->currentData(); - value = varVal.toString(); - if (value.length() > 0) - font_feature << value; + value = varVal.toULongLong(); + featureFlags |= value; + //Numerals Fraction varVal = fractionComboBox->currentData(); - value = varVal.toString(); - if (value.length() > 0) - font_feature << value; + value = varVal.toULongLong(); + featureFlags |= value; + // Numerals Zero if (SlashedZeroCheck->isChecked()) - font_feature << "+zero"; + featureFlags |= FontFeatures::SlashedZero; // Stylistic sets if (styleSetsMenu->actions().at(0)->isChecked()) - font_feature << "+ss01"; + featureFlags |= FontFeatures::StyleSet01; if (styleSetsMenu->actions().at(1)->isChecked()) - font_feature << "+ss02"; + featureFlags |= FontFeatures::StyleSet02; if (styleSetsMenu->actions().at(2)->isChecked()) - font_feature << "+ss03"; + featureFlags |= FontFeatures::StyleSet03; if (styleSetsMenu->actions().at(3)->isChecked()) - font_feature << "+ss04"; + featureFlags |= FontFeatures::StyleSet04; if (styleSetsMenu->actions().at(4)->isChecked()) - font_feature << "+ss05"; + featureFlags |= FontFeatures::StyleSet05; if (styleSetsMenu->actions().at(5)->isChecked()) - font_feature << "+ss06"; + featureFlags |= FontFeatures::StyleSet06; if (styleSetsMenu->actions().at(6)->isChecked()) - font_feature << "+ss07"; + featureFlags |= FontFeatures::StyleSet07; if (styleSetsMenu->actions().at(7)->isChecked()) - font_feature << "+ss08"; + featureFlags |= FontFeatures::StyleSet08; if (styleSetsMenu->actions().at(8)->isChecked()) - font_feature << "+ss09"; + featureFlags |= FontFeatures::StyleSet09; if (styleSetsMenu->actions().at(9)->isChecked()) - font_feature << "+ss10"; + featureFlags |= FontFeatures::StyleSet10; if (styleSetsMenu->actions().at(10)->isChecked()) - font_feature << "+ss11"; + featureFlags |= FontFeatures::StyleSet11; if (styleSetsMenu->actions().at(11)->isChecked()) - font_feature << "+ss12"; + featureFlags |= FontFeatures::StyleSet12; if (styleSetsMenu->actions().at(12)->isChecked()) - font_feature << "+ss13"; + featureFlags |= FontFeatures::StyleSet13; if (styleSetsMenu->actions().at(13)->isChecked()) - font_feature << "+ss14"; + featureFlags |= FontFeatures::StyleSet14; if (styleSetsMenu->actions().at(14)->isChecked()) - font_feature << "+ss15"; + featureFlags |= FontFeatures::StyleSet15; if (styleSetsMenu->actions().at(15)->isChecked()) - font_feature << "+ss16"; + featureFlags |= FontFeatures::StyleSet16; if (styleSetsMenu->actions().at(16)->isChecked()) - font_feature << "+ss17"; + featureFlags |= FontFeatures::StyleSet17; if (styleSetsMenu->actions().at(17)->isChecked()) - font_feature << "+ss18"; + featureFlags |= FontFeatures::StyleSet18; if (styleSetsMenu->actions().at(18)->isChecked()) - font_feature << "+ss19"; + featureFlags |= FontFeatures::StyleSet19; if (styleSetsMenu->actions().at(19)->isChecked()) - font_feature << "+ss20"; - return font_feature.join(","); + featureFlags |= FontFeatures::StyleSet20; + + QStringList font_features = FontFeatures::textFeaturesFromFlags(featureFlags); + return font_features.join(","); } void SMFontFeatures::setParentValue(const QString& val) @@ -483,20 +473,24 @@ QSignalBlocker blocker(capitalsComboBox); capitalsComboBox->clear(); - capitalsComboBox->addItem( tr("Default Capitals")); + capitalsComboBox->addItem( tr("Default Capitals"), QVariant(0)); if (featureFlags & FontFeatures::SmallCaps) - capitalsComboBox->addItem(tr("Small Capitals"), QVariant("+smcp")); + capitalsComboBox->addItem(tr("Small Capitals"), QVariant(FontFeatures::SmallCaps)); if (featureFlags & FontFeatures::SmallCapsFromCaps) - capitalsComboBox->addItem(tr("Small Capitals from Capitals"), QVariant("+c2sc")); + capitalsComboBox->addItem(tr("Small Capitals from Capitals"), QVariant(FontFeatures::SmallCapsFromCaps)); + if ((featureFlags & FontFeatures::AllSmallCapsMask) == FontFeatures::AllSmallCapsMask) + capitalsComboBox->addItem(tr("All Small Capitals"), QVariant(FontFeatures::AllSmallCapsMask)); if (featureFlags & FontFeatures::PetiteCaps) - capitalsComboBox->addItem(tr("Petite Capitals"), QVariant("+pcap")); + capitalsComboBox->addItem(tr("Petite Capitals"), QVariant(FontFeatures::PetiteCaps)); if (featureFlags & FontFeatures::PetiteCapsFromCaps) - capitalsComboBox->addItem(tr("Petite Capitals from Capitals"), QVariant("+c2pc")); + capitalsComboBox->addItem(tr("Petite Capitals from Capitals"), QVariant(FontFeatures::PetiteCapsFromCaps)); + if ((featureFlags & FontFeatures::AllPetiteCapsMask) == FontFeatures::AllPetiteCapsMask) + capitalsComboBox->addItem(tr("All Petite Capitals"), QVariant(FontFeatures::AllPetiteCapsMask)); if (featureFlags & FontFeatures::UnicaseCaps) - capitalsComboBox->addItem(tr("Unicase"), QVariant("+unic")); + capitalsComboBox->addItem(tr("Unicase"), QVariant(FontFeatures::UnicaseCaps)); if (featureFlags & FontFeatures::TiltingCaps) - capitalsComboBox->addItem(tr("Titling"), QVariant("+titl")); + capitalsComboBox->addItem(tr("Titling"), QVariant(FontFeatures::TiltingCaps)); } void SMFontFeatures::setupPositionCombo(quint64 featureFlags) @@ -504,14 +498,14 @@ QSignalBlocker blocker(positionComboBox); positionComboBox->clear(); - positionComboBox->addItem( tr("Default Position")); + positionComboBox->addItem( tr("Default Position"), QVariant(0)); if (featureFlags & FontFeatures::Subscript) - positionComboBox->addItem(tr("Subscript"), QVariant("+subs")); + positionComboBox->addItem(tr("Subscript"), QVariant(FontFeatures::Subscript)); if (featureFlags & FontFeatures::Superscript) - positionComboBox->addItem(tr("Superscript"), QVariant("+sups")); + positionComboBox->addItem(tr("Superscript"), QVariant(FontFeatures::Superscript)); if (featureFlags & FontFeatures::Ordinals) - positionComboBox->addItem(tr("Ordinals"), QVariant("+ordn")); + positionComboBox->addItem(tr("Ordinals"), QVariant(FontFeatures::Ordinals)); } void SMFontFeatures::setupNumeralStyleCombo(quint64 featureFlags) @@ -519,12 +513,12 @@ QSignalBlocker blocker(numeralComboBox); numeralComboBox->clear(); - numeralComboBox->addItem( tr("Default Numerals")); + numeralComboBox->addItem( tr("Default Numerals"), QVariant(0)); if (featureFlags & FontFeatures::LiningNumerals) - numeralComboBox->addItem(tr("Lining"), QVariant("+lnum")); + numeralComboBox->addItem(tr("Lining"), QVariant(FontFeatures::LiningNumerals)); if (featureFlags & FontFeatures::OldStyleNumerals) - numeralComboBox->addItem(tr("Old Style"), QVariant("+onum")); + numeralComboBox->addItem(tr("Old Style"), QVariant(FontFeatures::OldStyleNumerals)); } void SMFontFeatures::setupNumeralWidthCombo(quint64 featureFlags) @@ -532,12 +526,12 @@ QSignalBlocker blocker(widthComboBox); widthComboBox->clear(); - widthComboBox->addItem( tr("Default Numeral Width")); + widthComboBox->addItem( tr("Default Numeral Width"), QVariant(0)); if (featureFlags & FontFeatures::ProportionalNumeralWidth) - widthComboBox->addItem(tr("Proportional"), QVariant("+pnum")); + widthComboBox->addItem(tr("Proportional"), QVariant(FontFeatures::ProportionalNumeralWidth)); if (featureFlags & FontFeatures::TabularNumeralWidth) - widthComboBox->addItem(tr("Tabular"), QVariant("+tnum")); + widthComboBox->addItem(tr("Tabular"), QVariant(FontFeatures::TabularNumeralWidth)); } void SMFontFeatures::setupNumeralFractionCombo(quint64 featureFlags) @@ -545,12 +539,12 @@ QSignalBlocker blocker(fractionComboBox); fractionComboBox->clear(); - fractionComboBox->addItem( tr("No Fractions")); + fractionComboBox->addItem( tr("No Fractions"), QVariant(0)); if (featureFlags & FontFeatures::DiagonalFractions) - fractionComboBox->addItem(tr("Diagonal Fractions"), QVariant("+frac")); + fractionComboBox->addItem(tr("Diagonal Fractions"), QVariant(FontFeatures::DiagonalFractions)); if (featureFlags & FontFeatures::StackedFractions) - fractionComboBox->addItem(tr("Stacked Fractions"), QVariant("+afrc")); + fractionComboBox->addItem(tr("Stacked Fractions"), QVariant(FontFeatures::StackedFractions)); } void SMFontFeatures::slotChange() @@ -628,7 +622,7 @@ } // Old Style numerals do not support slashed zero - bool oldStyleNumeral = (numeralComboBox->currentData().toString() == "+onum"); + bool oldStyleNumeral = (numeralComboBox->currentData().toULongLong() == FontFeatures::OldStyleNumerals); if (oldStyleNumeral) SlashedZeroCheck->setChecked(false); SlashedZeroCheck->setEnabled(!oldStyleNumeral); Index: scribus/ui/smfontfeatures.h =================================================================== --- scribus/ui/smfontfeatures.h (revision 25428) +++ scribus/ui/smfontfeatures.h (working copy) @@ -64,7 +64,7 @@ void setupNumeralWidthCombo(quint64 featureFlags); void setupNumeralFractionCombo(quint64 featureFlags); - QStringList comboboxFeatures(QComboBox* combo) const; + quint64 comboboxFeatures(QComboBox* combo) const; bool m_hasParent = false; bool m_useParentValue = false; Index: scribus/util.cpp =================================================================== --- scribus/util.cpp (revision 25428) +++ scribus/util.cpp (working copy) @@ -885,6 +885,14 @@ box->setCurrentIndex(ind); } +void setCurrentComboItemFromData(QComboBox* box, quint64 data) +{ + QSignalBlocker signalBlocker(box); + int ind = box->findData(data); + if (ind > -1) + box->setCurrentIndex(ind); +} + void removeComboItem(QComboBox *box, const QString& text) { QSignalBlocker signalBlocker(box); Index: scribus/util.h =================================================================== --- scribus/util.h (revision 25428) +++ scribus/util.h (working copy) @@ -145,6 +145,7 @@ QString SCRIBUS_API readLineFromDataStream(QDataStream &s); void SCRIBUS_API setCurrentComboItem(QComboBox *box, const QString& text); void SCRIBUS_API setCurrentComboItemFromData(QComboBox *box, const QString& data); +void SCRIBUS_API setCurrentComboItemFromData(QComboBox *box, quint64 data); void SCRIBUS_API removeComboItem(QComboBox *box, const QString& text); QString SCRIBUS_API readAdobeUniCodeString(QDataStream &s); |
|
Inkscape's similar solution is also very nice. |
|
I finished my tests and committed the patch. Interestingly i found some fonts which had only the "Small Caps from Caps" feature. However these fonts look to be usually broken. I'm looking for more examples of this kind of fonts, but I'm currently thinking we may have to disable "Small Caps" feature completely if this kind of font is consistently broken. |
Date Modified | Username | Field | Change |
---|---|---|---|
2023-04-03 18:25 | pmjdebruijn | New Issue | |
2023-04-03 18:28 | pmjdebruijn | Note Added: 0050070 | |
2023-04-03 18:34 | pmjdebruijn | Note Added: 0050071 | |
2023-04-04 18:30 | pmjdebruijn | Note Added: 0050073 | |
2023-04-04 18:30 | pmjdebruijn | File Added: scribus_15x_c2sc_ascheckboxes.png | |
2023-04-04 18:33 | pmjdebruijn | Note Added: 0050074 | |
2023-04-04 18:33 | pmjdebruijn | File Added: fix-opentype-allcaps.patch | |
2023-04-05 12:49 | jghali | Note Added: 0050078 | |
2023-04-05 19:34 | pmjdebruijn | Note Added: 0050084 | |
2023-04-06 12:43 | pmjdebruijn | Note Added: 0050097 | |
2023-04-06 12:43 | pmjdebruijn | File Added: scribus_propertywidget_fontfeaturesbase_comboboxes.png | |
2023-04-19 19:08 | jghali | Note Added: 0050127 | |
2023-04-19 19:08 | jghali | File Added: 16923-ot-c2sc-not-practically-usable.patch | |
2023-04-21 10:02 | PeterBenedek | Note Added: 0050128 | |
2023-04-21 10:02 | PeterBenedek | File Added: Clipboard 1.png | |
2023-04-25 21:47 | jghali | Assigned To | => jghali |
2023-04-25 21:47 | jghali | Status | new => resolved |
2023-04-25 21:47 | jghali | Resolution | open => fixed |
2023-04-25 21:47 | jghali | Fixed in Version | => 1.6.0.svn |
2023-04-25 21:47 | jghali | Note Added: 0050137 | |
2023-05-29 18:56 | cbradney | Status | resolved => closed |