mirror of
https://abf.rosa.ru/djam/kdebase4-workspace.git
synced 2025-02-23 17:52:49 +00:00
191 lines
6.8 KiB
Diff
191 lines
6.8 KiB
Diff
Файл kde-workspace-4.9.4/build/testsock это сокет, тогда как файл kde-workspace-4.9.4-patched/build/testsock -- сокет
|
|
diff -urN kde-workspace-4.9.4/kcontrol/fonts/fonts.cpp kde-workspace-4.9.4-patched/kcontrol/fonts/fonts.cpp
|
|
--- kde-workspace-4.9.4/kcontrol/fonts/fonts.cpp 2012-12-02 23:48:15.000000000 +0000
|
|
+++ kde-workspace-4.9.4-patched/kcontrol/fonts/fonts.cpp 2012-12-05 20:12:06.581348560 +0000
|
|
@@ -278,6 +278,13 @@
|
|
QString hintingText(i18n("Hinting is a process used to enhance the quality of fonts at small sizes."));
|
|
hintingStyle->setWhatsThis( hintingText);
|
|
hintingLabel->setWhatsThis( hintingText);
|
|
+
|
|
+ useBCI=new QCheckBox(i18n("Use bytecode interpreter"), mw);
|
|
+ layout->addRow(useBCI);
|
|
+
|
|
+ QString bciWhatsThis(i18n("A method of hinting that often improves the appearance of TrueType fonts."));
|
|
+ useBCI->setWhatsThis( bciWhatsThis );
|
|
+
|
|
load();
|
|
enableWidgets();
|
|
setMainWidget(mw);
|
|
@@ -288,6 +295,7 @@
|
|
connect(excludeTo, SIGNAL(valueChanged(double)), SLOT(changed()));
|
|
connect(subPixelType, SIGNAL(activated(QString)), SLOT(changed()));
|
|
connect(hintingStyle, SIGNAL(activated(QString)), SLOT(changed()));
|
|
+ connect(useBCI, SIGNAL(toggled(bool)), SLOT(changed()));
|
|
}
|
|
|
|
bool FontAASettings::load()
|
|
@@ -340,6 +348,8 @@
|
|
|
|
hintingStyle->setCurrentIndex(getIndex(hStyle));
|
|
|
|
+ useBCI->setChecked(!xft.getAutohint());
|
|
+
|
|
enableWidgets();
|
|
|
|
return xft.getAntiAliasing();
|
|
@@ -378,6 +388,9 @@
|
|
grp.writeEntry("XftHintStyle", hs);
|
|
mod=true;
|
|
}
|
|
+
|
|
+ xft.setAutohint( !useBCI->isChecked() );
|
|
+
|
|
kglobals.sync();
|
|
|
|
if(!mod)
|
|
@@ -395,6 +408,7 @@
|
|
excludeTo->setValue(15.0);
|
|
useSubPixel->setChecked(false);
|
|
hintingStyle->setCurrentIndex(getIndex(KXftConfig::Hint::Medium));
|
|
+ useBCI->setChecked(true);
|
|
enableWidgets();
|
|
}
|
|
|
|
diff -urN kde-workspace-4.9.4/kcontrol/fonts/fonts.h kde-workspace-4.9.4-patched/kcontrol/fonts/fonts.h
|
|
--- kde-workspace-4.9.4/kcontrol/fonts/fonts.h 2012-12-02 23:48:15.000000000 +0000
|
|
+++ kde-workspace-4.9.4-patched/kcontrol/fonts/fonts.h 2012-12-05 20:01:43.790758887 +0000
|
|
@@ -78,6 +78,7 @@
|
|
|
|
QCheckBox *excludeRange;
|
|
QCheckBox *useSubPixel;
|
|
+ QCheckBox *useBCI;
|
|
KDoubleNumInput *excludeFrom;
|
|
KDoubleNumInput *excludeTo;
|
|
QComboBox *subPixelType;
|
|
diff -urN kde-workspace-4.9.4/kcontrol/fonts/kxftconfig.cpp kde-workspace-4.9.4-patched/kcontrol/fonts/kxftconfig.cpp
|
|
--- kde-workspace-4.9.4/kcontrol/fonts/kxftconfig.cpp 2012-12-02 23:48:15.000000000 +0000
|
|
+++ kde-workspace-4.9.4-patched/kcontrol/fonts/kxftconfig.cpp 2012-12-05 20:01:43.791258888 +0000
|
|
@@ -246,6 +246,7 @@
|
|
m_excludeRange.reset();
|
|
m_excludePixelRange.reset();
|
|
m_subPixel.reset();
|
|
+ m_autohint.reset();
|
|
|
|
QFile f(m_file);
|
|
|
|
@@ -313,6 +314,7 @@
|
|
newConfig.setSubPixelType(m_subPixel.type);
|
|
newConfig.setHintStyle(m_hint.style);
|
|
newConfig.setAntiAliasing(m_antiAliasing.set);
|
|
+ newConfig.setAutohint(m_autohint.set);
|
|
|
|
ok=newConfig.changed() ? newConfig.apply() : true;
|
|
if(ok)
|
|
@@ -340,6 +342,7 @@
|
|
applySubPixelType();
|
|
applyHintStyle();
|
|
applyAntiAliasing();
|
|
+ applyAutohint();
|
|
applyExcludeRange(false);
|
|
applyExcludeRange(true);
|
|
|
|
@@ -577,6 +580,12 @@
|
|
m_antiAliasing.node=n;
|
|
m_antiAliasing.set=str.toLower()!="false";
|
|
}
|
|
+ else if(!(str=getEntry(ene, "bool", 2, "name", "autohint", "mode",
|
|
+ "assign")).isNull())
|
|
+ {
|
|
+ m_autohint.node=n;
|
|
+ m_autohint.set=str.toLower()!="false";
|
|
+ }
|
|
}
|
|
}
|
|
break;
|
|
@@ -824,6 +833,41 @@
|
|
m_antiAliasing.node=matchNode;
|
|
}
|
|
|
|
+bool KXftConfig::getAutohint() const
|
|
+{
|
|
+ return m_autohint.set;
|
|
+}
|
|
+
|
|
+void KXftConfig::setAutohint( bool set )
|
|
+{
|
|
+ if(set!=m_autohint.set)
|
|
+ {
|
|
+ m_autohint.set = set;
|
|
+ m_madeChanges = true;
|
|
+ }
|
|
+}
|
|
+
|
|
+
|
|
+void KXftConfig::applyAutohint()
|
|
+{
|
|
+ QDomElement matchNode = m_doc.createElement("match"),
|
|
+ typeNode = m_doc.createElement("bool"),
|
|
+ editNode = m_doc.createElement("edit");
|
|
+ QDomText typeText = m_doc.createTextNode(m_autohint.set ? "true" : "false");
|
|
+
|
|
+ matchNode.setAttribute("target", "font");
|
|
+ editNode.setAttribute("mode", "assign");
|
|
+ editNode.setAttribute("name", "autohint");
|
|
+ editNode.appendChild(typeNode);
|
|
+ typeNode.appendChild(typeText);
|
|
+ matchNode.appendChild(editNode);
|
|
+ if(!m_autohint.node.isNull())
|
|
+ m_doc.documentElement().removeChild(m_autohint.node);
|
|
+ m_doc.documentElement().appendChild(matchNode);
|
|
+ m_autohint.node=matchNode;
|
|
+}
|
|
+
|
|
+
|
|
// KXftConfig only parses one config file, user's .fonts.conf usually.
|
|
// If that one doesn't exist, then KXftConfig doesn't know if antialiasing
|
|
// is enabled or not. So try to find out the default value from the default font.
|
|
diff -urN kde-workspace-4.9.4/kcontrol/fonts/kxftconfig.h kde-workspace-4.9.4-patched/kcontrol/fonts/kxftconfig.h
|
|
--- kde-workspace-4.9.4/kcontrol/fonts/kxftconfig.h 2012-12-02 23:48:15.000000000 +0000
|
|
+++ kde-workspace-4.9.4-patched/kcontrol/fonts/kxftconfig.h 2012-12-05 20:01:43.791258888 +0000
|
|
@@ -116,6 +116,16 @@
|
|
bool set;
|
|
};
|
|
|
|
+ struct Autohint : public Item
|
|
+ {
|
|
+ Autohint(bool s, QDomNode &n) : Item(n), set(s) {}
|
|
+ Autohint(bool s=false) : set(s) {}
|
|
+
|
|
+ void reset() { Item::reset(); set=false; }
|
|
+
|
|
+ bool set;
|
|
+ };
|
|
+
|
|
public:
|
|
|
|
explicit KXftConfig();
|
|
@@ -132,6 +142,8 @@
|
|
void setHintStyle(Hint::Style style);
|
|
void setAntiAliasing(bool set);
|
|
bool getAntiAliasing() const;
|
|
+ void setAutohint(bool set);
|
|
+ bool getAutohint() const;
|
|
bool changed() { return m_madeChanges; }
|
|
static QString description(SubPixel::Type t);
|
|
static const char * toStr(SubPixel::Type t);
|
|
@@ -144,6 +156,7 @@
|
|
void applySubPixelType();
|
|
void applyHintStyle();
|
|
void applyAntiAliasing();
|
|
+ void applyAutohint();
|
|
void setHinting(bool set);
|
|
void applyHinting();
|
|
void applyExcludeRange(bool pixel);
|
|
@@ -157,6 +170,7 @@
|
|
Hint m_hint;
|
|
Hinting m_hinting;
|
|
AntiAliasing m_antiAliasing;
|
|
+ Autohint m_autohint;
|
|
QDomDocument m_doc;
|
|
QString m_file;
|
|
bool m_madeChanges;
|