summaryrefslogtreecommitdiffstats
path: root/kcontrol/tdefontinst/viewpart
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-02-01 17:25:42 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-02-01 17:25:42 -0600
commiteba183d4de47093c6e44a99c8d7fe313aa2834c9 (patch)
tree53f8d1a08bd16668cb9040b2aaf9a041314b2003 /kcontrol/tdefontinst/viewpart
parentf537c21b68e08f649b1b297bce8f3904603137e0 (diff)
downloadtdebase-eba183d4de47093c6e44a99c8d7fe313aa2834c9.tar.gz
tdebase-eba183d4de47093c6e44a99c8d7fe313aa2834c9.zip
Fix FTBFS
Diffstat (limited to 'kcontrol/tdefontinst/viewpart')
-rw-r--r--kcontrol/tdefontinst/viewpart/CMakeLists.txt55
-rw-r--r--kcontrol/tdefontinst/viewpart/FontPreview.cpp118
-rw-r--r--kcontrol/tdefontinst/viewpart/FontPreview.h83
-rw-r--r--kcontrol/tdefontinst/viewpart/FontViewPart.cpp282
-rw-r--r--kcontrol/tdefontinst/viewpart/FontViewPart.h85
-rw-r--r--kcontrol/tdefontinst/viewpart/FontViewPartFactory.cpp86
-rw-r--r--kcontrol/tdefontinst/viewpart/FontViewPartFactory.h60
-rw-r--r--kcontrol/tdefontinst/viewpart/FontViewerApp.cpp130
-rw-r--r--kcontrol/tdefontinst/viewpart/FontViewerApp.h68
-rw-r--r--kcontrol/tdefontinst/viewpart/KfiPrint.cpp193
-rw-r--r--kcontrol/tdefontinst/viewpart/KfiPrint.h49
-rw-r--r--kcontrol/tdefontinst/viewpart/Makefile.am30
-rw-r--r--kcontrol/tdefontinst/viewpart/tdefontview.desktop100
-rw-r--r--kcontrol/tdefontinst/viewpart/tdefontviewpart.desktop86
-rw-r--r--kcontrol/tdefontinst/viewpart/tdefontviewpart.rc9
-rw-r--r--kcontrol/tdefontinst/viewpart/tdefontviewui.rc4
16 files changed, 1438 insertions, 0 deletions
diff --git a/kcontrol/tdefontinst/viewpart/CMakeLists.txt b/kcontrol/tdefontinst/viewpart/CMakeLists.txt
new file mode 100644
index 000000000..7fb621fec
--- /dev/null
+++ b/kcontrol/tdefontinst/viewpart/CMakeLists.txt
@@ -0,0 +1,55 @@
+#################################################
+#
+# (C) 2010-2011 Serghei Amelian
+# serghei (DOT) amelian (AT) gmail.com
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+include_directories(
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_SOURCE_DIR}/kcontrol/kfontinst/lib
+ ${TDE_INCLUDE_DIR}
+ ${TQT_INCLUDE_DIRS}
+)
+
+link_directories(
+ ${TQT_LIBRARY_DIRS}
+)
+
+
+##### other data ################################
+
+install( FILES kfontviewpart.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
+install( FILES kfontview.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
+install( FILES kfontviewpart.rc kfontviewui.rc DESTINATION ${DATA_INSTALL_DIR}/kfontview )
+
+
+##### libkfontviewpart (module) #################
+
+tde_add_kpart( libkfontviewpart AUTOMOC
+ SOURCES FontViewPart.cpp FontViewPartFactory.cpp FontPreview.cpp
+ LINK kfontinstprint-static kfontinst-shared tdeparts-shared
+ DESTINATION ${PLUGIN_INSTALL_DIR}
+)
+
+
+##### kfontview (executable) ####################
+
+tde_add_executable( kfontview AUTOMOC
+ SOURCES FontViewerApp.cpp
+ LINK tdeparts-shared
+ DESTINATION ${BIN_INSTALL_DIR}
+)
+
+
+##### kfontinstprint (static) ###################
+
+tde_add_library( kfontinstprint STATIC_PIC
+ SOURCES KfiPrint.cpp
+ LINK tdeprint-shared
+)
diff --git a/kcontrol/tdefontinst/viewpart/FontPreview.cpp b/kcontrol/tdefontinst/viewpart/FontPreview.cpp
new file mode 100644
index 000000000..3679be252
--- /dev/null
+++ b/kcontrol/tdefontinst/viewpart/FontPreview.cpp
@@ -0,0 +1,118 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Class Name : KFI::CFontPreview
+// Author : Craig Drummond
+// Project : K Font Installer
+// Creation Date : 04/11/2001
+// Version : $Revision$ $Date$
+//
+////////////////////////////////////////////////////////////////////////////////
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+////////////////////////////////////////////////////////////////////////////////
+// (C) Craig Drummond, 2001, 2002, 2003, 2004
+////////////////////////////////////////////////////////////////////////////////
+
+#include "FontPreview.h"
+#include <kapplication.h>
+#include <klocale.h>
+#include <tqpainter.h>
+#include <tqimage.h>
+#include <stdlib.h>
+
+namespace KFI
+{
+
+CFontPreview::CFontPreview(TQWidget *parent, const char *name)
+ : TQWidget(parent, name),
+ itsCurrentFace(1),
+ itsLastWidth(0),
+ itsLastHeight(0),
+ itsBgndCol(eraseColor())
+{
+}
+
+void CFontPreview::showFont(const KURL &url)
+{
+ itsCurrentUrl=url;
+ showFace(1);
+}
+
+void CFontPreview::showFace(int face)
+{
+ itsCurrentFace=face;
+ showFont();
+}
+
+void CFontPreview::showFont()
+{
+ itsLastWidth=width();
+ itsLastHeight=height();
+
+ if(!itsCurrentUrl.isEmpty() &&
+ itsEngine.draw(itsCurrentUrl, itsLastWidth, itsLastHeight, itsPixmap, itsCurrentFace-1, false))
+ {
+ setEraseColor(Qt::white);
+ update();
+ emit status(true);
+ }
+ else
+ {
+ TQPixmap nullPix;
+
+ setEraseColor(itsBgndCol);
+ itsPixmap=nullPix;
+ update();
+ emit status(false);
+ }
+}
+
+void CFontPreview::paintEvent(TQPaintEvent *)
+{
+ TQPainter paint(this);
+
+ if(itsPixmap.isNull())
+ {
+ if(!itsCurrentUrl.isEmpty())
+ {
+ paint.setPen(kapp->palette().active().text());
+ paint.drawText(rect(), AlignCenter, i18n(" No preview available"));
+ }
+ }
+ else
+ {
+ static const int constStepSize=16;
+
+ if(abs(width()-itsLastWidth)>constStepSize || abs(height()-itsLastHeight)>constStepSize)
+ showFont();
+ else
+ paint.drawPixmap(0, 0, itsPixmap);
+ }
+}
+
+TQSize CFontPreview::sizeHint() const
+{
+ return TQSize(132, 132);
+}
+
+TQSize CFontPreview::minimumSizeHint() const
+{
+ return TQSize(32, 32);
+}
+
+}
+
+#include "FontPreview.moc"
diff --git a/kcontrol/tdefontinst/viewpart/FontPreview.h b/kcontrol/tdefontinst/viewpart/FontPreview.h
new file mode 100644
index 000000000..71916479e
--- /dev/null
+++ b/kcontrol/tdefontinst/viewpart/FontPreview.h
@@ -0,0 +1,83 @@
+#ifndef __FONT_PREVIEW_H__
+#define __FONT_PREVIEW_H__
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Class Name : KFI::CFontPreview
+// Author : Craig Drummond
+// Project : K Font Installer
+// Creation Date : 04/11/2001
+// Version : $Revision$ $Date$
+//
+////////////////////////////////////////////////////////////////////////////////
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+////////////////////////////////////////////////////////////////////////////////
+// (C) Craig Drummond, 2001, 2002, 2003, 2004
+////////////////////////////////////////////////////////////////////////////////
+
+#include <tqstring.h>
+#include <tqpixmap.h>
+#include <tqsize.h>
+#include <tqwidget.h>
+#include <tqcolor.h>
+#include <kurl.h>
+#include "FcEngine.h"
+
+namespace KFI
+{
+
+class CFontPreview : public TQWidget
+{
+ Q_OBJECT
+
+ public:
+
+ CFontPreview(TQWidget *parent, const char *name=NULL);
+ virtual ~CFontPreview() {}
+
+ void paintEvent(TQPaintEvent *);
+ TQSize sizeHint() const;
+ TQSize minimumSizeHint() const;
+
+ void showFont(const KURL &url);
+ void showFont();
+
+ CFcEngine & engine() { return itsEngine; }
+
+ public slots:
+
+ void showFace(int face);
+
+ signals:
+
+ void status(bool);
+
+ private:
+
+ CFcEngine itsEngine;
+ TQPixmap itsPixmap;
+ KURL itsCurrentUrl;
+ int itsCurrentFace,
+ itsLastWidth,
+ itsLastHeight;
+ TQColor itsBgndCol;
+ TQString itsFontName;
+};
+
+}
+
+#endif
diff --git a/kcontrol/tdefontinst/viewpart/FontViewPart.cpp b/kcontrol/tdefontinst/viewpart/FontViewPart.cpp
new file mode 100644
index 000000000..a95c4e4e6
--- /dev/null
+++ b/kcontrol/tdefontinst/viewpart/FontViewPart.cpp
@@ -0,0 +1,282 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Class Name : KFI::CFontViewPart
+// Author : Craig Drummond
+// Project : K Font Installer
+// Creation Date : 03/08/2002
+// Version : $Revision$ $Date$
+//
+////////////////////////////////////////////////////////////////////////////////
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+////////////////////////////////////////////////////////////////////////////////
+// (C) Craig Drummond, 2002, 2003, 2004
+////////////////////////////////////////////////////////////////////////////////
+
+#include "FontViewPart.h"
+#include "FontPreview.h"
+#include "Misc.h"
+#include "KfiConstants.h"
+#include "KfiPrint.h"
+#include <klocale.h>
+#include <tqlayout.h>
+#include <tqpushbutton.h>
+#include <tqframe.h>
+#include <tqfile.h>
+#include <tqlabel.h>
+#include <tqpainter.h>
+#include <tqpaintdevicemetrics.h>
+#include <tqvalidator.h>
+#include <tqregexp.h>
+#include <tqsettings.h>
+#include <tqstringlist.h>
+#include <tqtimer.h>
+#include <tdeio/netaccess.h>
+#include <kinstance.h>
+#include <kmessagebox.h>
+#include <knuminput.h>
+#include <kstdaction.h>
+#include <kaction.h>
+#include <kinputdialog.h>
+#include <kdialog.h>
+#include <kprinter.h>
+#include <fontconfig/fontconfig.h>
+
+static KURL getDest(const KURL &url, bool system)
+{
+ return KURL(KFI::Misc::root()
+ ? TQString("fonts:/") + url.fileName()
+ : TQString("fonts:/") + TQString(system ? i18n(KFI_KIO_FONTS_SYS) : i18n(KFI_KIO_FONTS_USER))
+ + TQChar('/') + url.fileName());
+}
+
+namespace KFI
+{
+
+CFontViewPart::CFontViewPart(TQWidget *parent, const char *name)
+{
+ bool kcm=0==strcmp(name, "kcmfontinst");
+
+ itsFrame=new TQFrame(parent, "frame");
+
+ TQFrame *previewFrame=new TQFrame(itsFrame);
+
+ itsToolsFrame=new TQFrame(itsFrame);
+
+ TQVBoxLayout *layout=new TQVBoxLayout(itsFrame, kcm ? 0 : KDialog::marginHint(), kcm ? 0 : KDialog::spacingHint());
+ TQGridLayout *previewLayout=new TQGridLayout(previewFrame, 1, 1, 1, 1);
+ TQHBoxLayout *toolsLayout=new TQHBoxLayout(itsToolsFrame, 0, KDialog::spacingHint());
+
+ itsFrame->setFrameShape(TQFrame::NoFrame);
+ itsFrame->setFocusPolicy(TQ_ClickFocus);
+ itsToolsFrame->setFrameShape(TQFrame::NoFrame);
+ previewFrame->setFrameShadow(kcm ? TQFrame::Sunken : TQFrame::Raised);
+ previewFrame->setFrameShape(TQFrame::Panel);
+ setInstance(new TDEInstance("kfontview"));
+
+ itsPreview=new CFontPreview(previewFrame, "FontViewPart::Preview");
+ itsPreview->setSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding);
+ itsFaceLabel=new TQLabel(i18n("Face:"), itsToolsFrame);
+ itsFaceSelector=new KIntNumInput(1, itsToolsFrame);
+ itsInstallButton=new TQPushButton(i18n("Install..."), itsToolsFrame, "button");
+ itsInstallButton->hide();
+ previewLayout->addWidget(itsPreview, 0, 0);
+ layout->addWidget(previewFrame);
+ layout->addWidget(itsToolsFrame);
+ toolsLayout->addWidget(itsFaceLabel);
+ toolsLayout->addWidget(itsFaceSelector);
+ itsFaceLabel->hide();
+ itsFaceSelector->hide();
+ toolsLayout->addItem(new TQSpacerItem(5, 5, TQSizePolicy::MinimumExpanding, TQSizePolicy::Minimum));
+ toolsLayout->addWidget(itsInstallButton);
+ itsToolsFrame->hide();
+ connect(itsPreview, TQT_SIGNAL(status(bool)), TQT_SLOT(previewStatus(bool)));
+ connect(itsInstallButton, TQT_SIGNAL(clicked()), TQT_SLOT(install()));
+ connect(itsFaceSelector, TQT_SIGNAL(valueChanged(int)), itsPreview, TQT_SLOT(showFace(int)));
+
+ itsChangeTextAction=new TDEAction(i18n("Change Text..."), "text", TDEShortcut(),
+ this, TQT_SLOT(changeText()), actionCollection(), "changeText");
+ itsChangeTextAction->setEnabled(false);
+ itsPrintAction=KStdAction::print(this, TQT_SLOT(print()), actionCollection(), "print");
+ itsPrintAction->setEnabled(false);
+
+ setXMLFile("kfontviewpart.rc");
+ setWidget(itsFrame);
+}
+
+bool CFontViewPart::openURL(const KURL &url)
+{
+ if (!url.isValid() || !closeURL())
+ return false;
+
+ if(KFI_KIO_FONTS_PROTOCOL==url.protocol() || url.isLocalFile())
+ {
+ m_url=url;
+ emit started(0);
+ m_file = m_url.path();
+ bool ret=openFile();
+ if (ret)
+ {
+ emit completed();
+ emit setWindowCaption(m_url.prettyURL());
+ }
+ return ret;
+ }
+ else
+ return ReadOnlyPart::openURL(url);
+}
+
+bool CFontViewPart::openFile()
+{
+ // NOTE: Cant do the real open here, as dont seem to be able to use TDEIO::NetAccess functions during initial start-up.
+ // Bug report 111535 indicates that calling "konqueror <font>" crashes.
+ TQTimer::singleShot(0, this, TQT_SLOT(timeout()));
+ return true;
+}
+
+void CFontViewPart::timeout()
+{
+ bool showFs=false,
+ isFonts=KFI_KIO_FONTS_PROTOCOL==m_url.protocol();
+
+ itsShowInstallButton=false;
+
+ if(isFonts)
+ FcInitReinitialize();
+ else
+ {
+ KURL destUrl;
+
+ //
+ // Not from fonts:/, so try to see if font is already installed...
+ if(Misc::root())
+ {
+ destUrl=TQString("fonts:/")+itsPreview->engine().getName(m_url);
+ itsShowInstallButton=!TDEIO::NetAccess::exists(destUrl, true, itsFrame->parentWidget());
+ }
+ else
+ {
+ destUrl=TQString("fonts:/")+i18n(KFI_KIO_FONTS_SYS)+TQChar('/')+itsPreview->engine().getName(m_url);
+ if(TDEIO::NetAccess::exists(destUrl, true, itsFrame->parentWidget()))
+ itsShowInstallButton=false;
+ else
+ {
+ destUrl=TQString("fonts:/")+i18n(KFI_KIO_FONTS_USER)+TQChar('/')+itsPreview->engine().getName(m_url);
+ itsShowInstallButton=!TDEIO::NetAccess::exists(destUrl, true, itsFrame->parentWidget());
+ }
+ }
+ }
+
+ itsPreview->showFont(isFonts ? m_url : m_file);
+
+ if(!isFonts && itsPreview->engine().getNumIndexes()>1)
+ {
+ showFs=true;
+ itsFaceSelector->setRange(1, itsPreview->engine().getNumIndexes(), 1, false);
+ }
+
+ itsFaceLabel->setShown(showFs);
+ itsFaceSelector->setShown(showFs);
+ itsToolsFrame->hide();
+}
+
+void CFontViewPart::previewStatus(bool st)
+{
+ itsInstallButton->setShown(st && itsShowInstallButton);
+ itsToolsFrame->setShown(itsInstallButton->isShown()||itsFaceSelector->isShown());
+ itsChangeTextAction->setEnabled(st);
+ itsPrintAction->setEnabled(st && KFI_KIO_FONTS_PROTOCOL==m_url.protocol());
+}
+
+void CFontViewPart::install()
+{
+ int resp=Misc::root() ? KMessageBox::Yes
+ : KMessageBox::questionYesNoCancel(itsFrame,
+ i18n("Where do you wish to install \"%1\" (%2)?\n"
+ "\"%3\" - only accessible to you, or\n"
+ "\"%4\" - accessible to all (requires administrator "
+ "password)")
+ .arg(itsPreview->engine().getName(m_url))
+ .arg(m_url.fileName())
+ .arg(i18n(KFI_KIO_FONTS_USER))
+ .arg(i18n(KFI_KIO_FONTS_SYS)),
+ i18n("Install"), i18n(KFI_KIO_FONTS_USER),
+ i18n(KFI_KIO_FONTS_SYS));
+
+ if(KMessageBox::Cancel!=resp)
+ {
+ KURL destUrl(getDest(m_url, KMessageBox::No==resp));
+
+ if(TDEIO::NetAccess::copy(m_url, destUrl, itsFrame->parentWidget()))
+ {
+ //
+ // OK file copied, now look for any AFM or PFM file...
+ KURL::List urls;
+
+ Misc::getAssociatedUrls(m_url, urls);
+
+ if(urls.count())
+ {
+ KURL::List::Iterator it,
+ end=urls.end();
+
+ for(it=urls.begin(); it!=end; ++it)
+ {
+ destUrl=getDest(*it, KMessageBox::No==resp);
+ TDEIO::NetAccess::copy(*it, destUrl, itsFrame->parentWidget());
+ }
+ }
+
+ KMessageBox::information(itsFrame, i18n("%1:%2 successfully installed.").arg(m_url.protocol())
+ .arg(m_url.path()), i18n("Success"),
+ "FontViewPart_DisplayInstallationSuccess");
+ itsShowInstallButton=false;
+ itsInstallButton->setShown(itsShowInstallButton);
+ }
+ else
+ KMessageBox::error(itsFrame, i18n("Could not install %1:%2").arg(m_url.protocol()).arg(m_url.path()),
+ i18n("Error"));
+ }
+}
+
+void CFontViewPart::changeText()
+{
+ bool status;
+ TQRegExpValidator validator(TQRegExp(".*"), 0L);
+ TQString oldStr(itsPreview->engine().getPreviewString()),
+ newStr(KInputDialog::getText(i18n("Preview String"), i18n("Please enter new string:"),
+ oldStr, &status, itsFrame,
+ "preview string dialog", &validator));
+
+ if(status && newStr!=oldStr)
+ {
+ itsPreview->engine().setPreviewString(newStr);
+ itsPreview->showFont();
+ }
+}
+
+void CFontViewPart::print()
+{
+ TQStringList items;
+
+ items.append(itsPreview->engine().getName(m_url));
+
+ Print::printItems(items, 0, itsFrame->parentWidget(), itsPreview->engine());
+}
+
+}
+
+#include "FontViewPart.moc"
diff --git a/kcontrol/tdefontinst/viewpart/FontViewPart.h b/kcontrol/tdefontinst/viewpart/FontViewPart.h
new file mode 100644
index 000000000..29ef28d6c
--- /dev/null
+++ b/kcontrol/tdefontinst/viewpart/FontViewPart.h
@@ -0,0 +1,85 @@
+#ifndef __FONT_VIEW_PART_H__
+#define __FONT_VIEW_PART_H__
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Class Name : KFI::CFontViewPart
+// Author : Craig Drummond
+// Project : K Font Installer (kfontinst-kcontrol)
+// Creation Date : 03/08/2002
+// Version : $Revision$ $Date$
+//
+////////////////////////////////////////////////////////////////////////////////
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+////////////////////////////////////////////////////////////////////////////////
+// (C) Craig Drummond, 2002, 2003, 2004
+////////////////////////////////////////////////////////////////////////////////
+
+#include <tdeparts/part.h>
+
+class TQPushButton;
+class TQFrame;
+class TQLabel;
+class KIntNumInput;
+class TDEAction;
+class KURL;
+
+namespace KFI
+{
+
+class CFontPreview;
+
+class CFontViewPart : public KParts::ReadOnlyPart
+{
+ Q_OBJECT
+
+ public:
+
+ CFontViewPart(TQWidget *parent=0, const char *name=0);
+ virtual ~CFontViewPart() {}
+
+ bool openURL(const KURL &url);
+
+ protected:
+
+ bool openFile();
+
+ private slots:
+
+ void previewStatus(bool st);
+ void timeout();
+ void install();
+ void changeText();
+ void print();
+
+ private:
+
+ CFontPreview *itsPreview;
+ TQPushButton *itsInstallButton;
+ TQFrame *itsFrame,
+ *itsToolsFrame;
+ TQLabel *itsFaceLabel;
+ KIntNumInput *itsFaceSelector;
+ TDEAction *itsChangeTextAction,
+ *itsPrintAction;
+ bool itsShowInstallButton;
+ int itsFace;
+};
+
+}
+
+#endif
diff --git a/kcontrol/tdefontinst/viewpart/FontViewPartFactory.cpp b/kcontrol/tdefontinst/viewpart/FontViewPartFactory.cpp
new file mode 100644
index 000000000..41d06984e
--- /dev/null
+++ b/kcontrol/tdefontinst/viewpart/FontViewPartFactory.cpp
@@ -0,0 +1,86 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Class Name : KFI::CFontViewPartFactory
+// Author : Craig Drummond
+// Project : K Font Installer
+// Creation Date : 03/08/2002
+// Version : $Revision$ $Date$
+//
+////////////////////////////////////////////////////////////////////////////////
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+////////////////////////////////////////////////////////////////////////////////
+// (C) Craig Drummond, 2002, 2003, 2004
+////////////////////////////////////////////////////////////////////////////////
+
+#include "FontViewPartFactory.h"
+#include "FontViewPart.h"
+#include <kdebug.h>
+#include <kaboutdata.h>
+#include <kinstance.h>
+#include <assert.h>
+
+extern "C"
+{
+ KDE_EXPORT void* init_libkfontviewpart()
+ {
+ TDEGlobal::locale()->insertCatalogue("kfontinst");
+ return new KFI::CFontViewPartFactory;
+ }
+}
+
+namespace KFI
+{
+
+TDEInstance * CFontViewPartFactory::theirInstance=NULL;
+TDEAboutData * CFontViewPartFactory::theirAbout=NULL;
+
+CFontViewPartFactory::CFontViewPartFactory()
+{
+}
+
+CFontViewPartFactory::~CFontViewPartFactory()
+{
+ delete theirAbout;
+ theirAbout=0L;
+ delete theirInstance;
+ theirInstance=0L;
+}
+
+TQObject * CFontViewPartFactory::createObject(TQObject *parent, const char *name, const char *, const TQStringList &)
+{
+ if(parent && !parent->isWidgetType())
+ {
+ kdDebug() << "CFontViewPartFactory: parent does not inherit TQWidget" << endl;
+ return 0L;
+ }
+
+ return new CFontViewPart((TQWidget*) parent, name);
+}
+
+TDEInstance* CFontViewPartFactory::instance()
+{
+ if(!theirInstance)
+ {
+ theirAbout = new TDEAboutData("fontviewpart", I18N_NOOP("CFontViewPart"), "0.1");
+ theirInstance = new TDEInstance(theirAbout);
+ }
+ return theirInstance;
+}
+
+}
+
+#include "FontViewPartFactory.moc"
diff --git a/kcontrol/tdefontinst/viewpart/FontViewPartFactory.h b/kcontrol/tdefontinst/viewpart/FontViewPartFactory.h
new file mode 100644
index 000000000..7ac96e9c8
--- /dev/null
+++ b/kcontrol/tdefontinst/viewpart/FontViewPartFactory.h
@@ -0,0 +1,60 @@
+#ifndef __FONT_VIEW_PART_FACTORY_H__
+#define __FONT_VIEW_PART_FACTORY_H__
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Class Name : KFI::CFontViewPartFactory
+// Author : Craig Drummond
+// Project : K Font Installer
+// Creation Date : 03/08/2002
+// Version : $Revision$ $Date$
+//
+////////////////////////////////////////////////////////////////////////////////
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+////////////////////////////////////////////////////////////////////////////////
+// (C) Craig Drummond, 2002, 2003, 2004
+////////////////////////////////////////////////////////////////////////////////
+
+#include <klibloader.h>
+
+class TDEInstance;
+class TDEAboutData;
+
+namespace KFI
+{
+
+class CFontViewPartFactory : public KLibFactory
+{
+ Q_OBJECT
+
+ public:
+
+ CFontViewPartFactory();
+ virtual ~CFontViewPartFactory();
+ virtual TQObject *createObject(TQObject *parent = 0, const char *name = 0, const char *classname = TQOBJECT_OBJECT_NAME_STRING, const TQStringList &args = TQStringList());
+
+ static TDEInstance * instance();
+
+ private:
+
+ static TDEInstance *theirInstance;
+ static TDEAboutData *theirAbout;
+};
+
+}
+
+#endif
diff --git a/kcontrol/tdefontinst/viewpart/FontViewerApp.cpp b/kcontrol/tdefontinst/viewpart/FontViewerApp.cpp
new file mode 100644
index 000000000..6690cc44b
--- /dev/null
+++ b/kcontrol/tdefontinst/viewpart/FontViewerApp.cpp
@@ -0,0 +1,130 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Class Names : KFI::CFontViewerApp, KFI::CFontViewerAppMainWindow
+// Author : Craig Drummond
+// Project : K Font Installer (kfontinst-kcontrol)
+// Creation Date : 30/04/2004
+// Version : $Revision$ $Date$
+//
+////////////////////////////////////////////////////////////////////////////////
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+////////////////////////////////////////////////////////////////////////////////
+// (C) Craig Drummond, 2004
+////////////////////////////////////////////////////////////////////////////////
+
+#include "FontViewerApp.h"
+#include "KfiConstants.h"
+#include <kaboutdata.h>
+#include <kcmdlineargs.h>
+#include <klibloader.h>
+#include <klocale.h>
+#include <kglobal.h>
+#include <tdefiledialog.h>
+#include <tdeconfig.h>
+
+#define CFG_GROUP "FontViewer Settings"
+#define CFG_SIZE_KEY "Window Size"
+
+namespace KFI
+{
+
+CFontViewerAppMainWindow::CFontViewerAppMainWindow()
+ : KParts::MainWindow((TQWidget *)0L)
+{
+ KLibFactory *factory=KLibLoader::self()->factory("libkfontviewpart");
+
+ if(factory)
+ {
+ KStdAction::open(TQT_TQOBJECT(this), TQT_SLOT(fileOpen()), actionCollection());
+ KStdAction::quit(TQT_TQOBJECT(kapp), TQT_SLOT(quit()), actionCollection());
+
+ itsPreview=(KParts::ReadOnlyPart *)factory->create(TQT_TQOBJECT(this), "fontvier", "KParts::ReadOnlyPart");
+
+ TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
+ KURL openURL;
+
+ if(args->count() > 0)
+ {
+ KURL url(args->url(args->count() - 1));
+
+ if(url.isValid())
+ openURL = url;
+ }
+
+ setCentralWidget(itsPreview->widget());
+ createGUI(itsPreview);
+
+ if(!openURL.isEmpty())
+ itsPreview->openURL(openURL);
+
+ TQSize defSize(450, 380);
+ TDEConfigGroupSaver saver(kapp->config(), CFG_GROUP);
+
+ resize(kapp->config()->readSizeEntry(CFG_SIZE_KEY, &defSize));
+ show();
+ }
+ else
+ exit(0);
+}
+
+CFontViewerAppMainWindow::~CFontViewerAppMainWindow()
+{
+ TDEConfigGroupSaver saver(kapp->config(), CFG_GROUP);
+ kapp->config()->writeEntry(CFG_SIZE_KEY, size());
+ kapp->config()->sync();
+}
+
+void CFontViewerAppMainWindow::fileOpen()
+{
+ KURL url(KFileDialog::getOpenURL(TQString::null, "application/x-font-ttf application/x-font-otf "
+ "application/x-font-ttc application/x-font-type1 "
+ "application/x-font-bdf application/x-font-pcf ",
+ this, i18n("Select Font to View")));
+ if(url.isValid())
+ itsPreview->openURL(url);
+}
+
+CFontViewerApp::CFontViewerApp()
+{
+ TDEGlobal::locale()->insertCatalogue(KFI_CATALOGUE);
+ setMainWidget(new CFontViewerAppMainWindow());
+}
+
+}
+
+static KCmdLineOptions options[] =
+{
+ { "+[URL]", I18N_NOOP("URL to open"), 0 },
+ KCmdLineLastOption
+};
+
+static TDEAboutData aboutData("kfontview", I18N_NOOP("Font Viewer"), 0, I18N_NOOP("Simple font viewer"),
+ TDEAboutData::License_GPL,
+ I18N_NOOP("(c) Craig Drummond, 2004"));
+
+int main(int argc, char **argv)
+{
+ TDECmdLineArgs::init(argc, argv, &aboutData);
+ TDECmdLineArgs::addCmdLineOptions(options);
+ KFI::CFontViewerApp::addCmdLineOptions();
+
+ KFI::CFontViewerApp app;
+
+ return app.exec();
+}
+
+#include "FontViewerApp.moc"
diff --git a/kcontrol/tdefontinst/viewpart/FontViewerApp.h b/kcontrol/tdefontinst/viewpart/FontViewerApp.h
new file mode 100644
index 000000000..150c8ccab
--- /dev/null
+++ b/kcontrol/tdefontinst/viewpart/FontViewerApp.h
@@ -0,0 +1,68 @@
+#ifndef __FONT_VIEWER_APP_H__
+#define __FONT_VIEWER_APP_H__
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Class Name : KFI::CFontViewerApp, KFI::CFontViewAppMainWindow
+// Author : Craig Drummond
+// Project : K Font Installer (kfontinst-kcontrol)
+// Creation Date : 30/04/2004
+// Version : $Revision$ $Date$
+//
+////////////////////////////////////////////////////////////////////////////////
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+////////////////////////////////////////////////////////////////////////////////
+// (C) Craig Drummond, 2004
+////////////////////////////////////////////////////////////////////////////////
+
+#include <kapplication.h>
+#include <tdeparts/part.h>
+#include <tdeparts/mainwindow.h>
+
+namespace KFI
+{
+
+class CFontViewerAppMainWindow : public KParts::MainWindow
+{
+ Q_OBJECT
+
+ public:
+
+ CFontViewerAppMainWindow();
+ virtual ~CFontViewerAppMainWindow();
+
+ public slots:
+
+ void fileOpen();
+
+ private:
+
+ KParts::ReadOnlyPart *itsPreview;
+
+};
+
+class CFontViewerApp : public TDEApplication
+{
+ public:
+
+ CFontViewerApp();
+ virtual ~CFontViewerApp() {}
+};
+
+}
+
+#endif
diff --git a/kcontrol/tdefontinst/viewpart/KfiPrint.cpp b/kcontrol/tdefontinst/viewpart/KfiPrint.cpp
new file mode 100644
index 000000000..5e2d9deeb
--- /dev/null
+++ b/kcontrol/tdefontinst/viewpart/KfiPrint.cpp
@@ -0,0 +1,193 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Namespace : KFI::Print
+// Author : Craig Drummond
+// Project : K Font Installer
+// Creation Date : 14/05/2005
+// Version : $Revision$ $Date$
+//
+////////////////////////////////////////////////////////////////////////////////
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+////////////////////////////////////////////////////////////////////////////////
+// (C) Craig Drummond, 2005
+////////////////////////////////////////////////////////////////////////////////
+
+#include "KfiPrint.h"
+#include "FcEngine.h"
+#include <tqpainter.h>
+#include <tqpaintdevicemetrics.h>
+#include <tqsettings.h>
+#include <tqstringlist.h>
+#include <kprinter.h>
+#include <tqapplication.h>
+#include <tqeventloop.h>
+#ifdef HAVE_LOCALE_H
+#include <locale.h>
+#endif
+
+namespace KFI
+{
+
+namespace Print
+{
+
+static const int constMarginLineBefore=1;
+static const int constMarginLineAfter=2;
+static const int constMarginFont=4;
+
+inline bool sufficientSpace(int y, int pageHeight, int size)
+{
+ return (y+constMarginFont+size)<pageHeight;
+}
+
+static bool sufficientSpace(int y, int titleFontHeight, const int *sizes, int pageHeight, int size)
+{
+ int required=titleFontHeight+constMarginLineBefore+constMarginLineAfter;
+
+ for(unsigned int s=0; sizes[s]; ++s)
+ {
+ required+=sizes[s];
+ if(sizes[s+1])
+ required+=constMarginFont;
+ }
+
+ if(0==size)
+ required+=(3*(constMarginFont+CFcEngine::constDefaultAlphaSize))+constMarginLineBefore+constMarginLineAfter;
+ return (y+required)<pageHeight;
+}
+
+bool printable(const TQString &mime)
+{
+ return "application/x-font-type1"==mime || "application/x-font-ttf"==mime || "application/x-font-otf"==mime ||
+ "application/x-font-ttc"==mime || "application/x-font-ghostscript"==mime;
+}
+
+void printItems(const TQStringList &items, int size, TQWidget *parent, CFcEngine &engine)
+{
+#ifdef HAVE_LOCALE_H
+ char *oldLocale=setlocale(LC_NUMERIC, "C"),
+#endif
+
+ KPrinter printer;
+
+ printer.setFullPage(true);
+
+ if(printer.setup(parent))
+ {
+ TQPainter painter;
+ TQFont sans("sans", 12, TQFont::Bold);
+ TQSettings settings;
+ bool entryExists,
+ embedFonts,
+ set=false;
+ TQString str(engine.getPreviewString());
+
+ //
+ // Cehck whether the user has enabled font embedding...
+ embedFonts=settings.readBoolEntry("/qt/embedFonts", false, &entryExists);
+
+ // ...if not, then turn on - we may have installed new fonts, without ghostscript being informed, etc.
+ if(!entryExists || !embedFonts)
+ settings.writeEntry("/qt/embedFonts", true);
+
+ printer.setResolution(72);
+ painter.begin(&printer);
+
+ TQPaintDeviceMetrics metrics(painter.device());
+ int margin=(int)((2/2.54)*metrics.logicalDpiY()), // 2 cm margins
+ pageWidth=metrics.width()-(2*margin),
+ pageHeight=metrics.height()-(2*margin),
+ y=margin,
+ oneSize[2]={size, 0};
+ const int *sizes=oneSize;
+ bool firstFont(true);
+
+ if(0==size)
+ sizes=CFcEngine::constScalableSizes;
+
+ painter.setClipping(true);
+ painter.setClipRect(margin, margin, pageWidth, pageHeight);
+
+ TQStringList::ConstIterator it(items.begin()),
+ end(items.end());
+
+ for(; it!=end; ++it)
+ {
+ unsigned int s=0;
+
+ painter.setFont(sans);
+ TQApplication::eventLoop()->processEvents(TQEventLoop::ExcludeUserInput, 0);
+
+ if(!firstFont && !sufficientSpace(y, painter.fontMetrics().height(), sizes, pageHeight, size))
+ {
+ printer.newPage();
+ y=margin;
+ }
+ painter.setFont(sans);
+ y+=painter.fontMetrics().height();
+ painter.drawText(margin, y, *it);
+ y+=constMarginLineBefore;
+ painter.drawLine(margin, y, margin+pageWidth, y);
+ y+=constMarginLineAfter;
+
+ if(0==size)
+ {
+ y+=CFcEngine::constDefaultAlphaSize;
+ painter.setFont(engine.getQFont(*it, CFcEngine::constDefaultAlphaSize));
+ painter.drawText(margin, y, CFcEngine::getLowercaseLetters());
+ y+=constMarginFont+CFcEngine::constDefaultAlphaSize;
+ painter.drawText(margin, y, CFcEngine::getUppercaseLetters());
+ y+=constMarginFont+CFcEngine::constDefaultAlphaSize;
+ painter.drawText(margin, y, CFcEngine::getPunctuation());
+ y+=constMarginFont+constMarginLineBefore;
+ painter.drawLine(margin, y, margin+pageWidth, y);
+ y+=constMarginLineAfter;
+ }
+ for(; sizes[s]; ++s)
+ {
+ y+=sizes[s];
+ painter.setFont(engine.getQFont(*it, sizes[s]));
+ if(sufficientSpace(y, pageHeight, sizes[s]))
+ {
+ painter.drawText(margin, y, str);
+ if(sizes[s+1])
+ y+=constMarginFont;
+ }
+ }
+ firstFont=false;
+ y+=(s<1 || sizes[s-1]<25 ? 14 : 28);
+ }
+
+ painter.end();
+
+ //
+ // Did we change the users font settings? If so, reset to their previous values...
+ if(set)
+ if(entryExists)
+ settings.writeEntry("/qt/embedFonts", false);
+ else
+ settings.removeEntry("/qt/embedFonts");
+ }
+#ifdef HAVE_LOCALE_H
+ if(oldLocale)
+ setlocale(LC_NUMERIC, oldLocale);
+#endif
+}
+
+}
+
+}
diff --git a/kcontrol/tdefontinst/viewpart/KfiPrint.h b/kcontrol/tdefontinst/viewpart/KfiPrint.h
new file mode 100644
index 000000000..d93744aa5
--- /dev/null
+++ b/kcontrol/tdefontinst/viewpart/KfiPrint.h
@@ -0,0 +1,49 @@
+#ifndef __PRINT_H__
+#define __PRINT_H__
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Namespace : KFI::Print
+// Author : Craig Drummond
+// Project : K Font Installer
+// Creation Date : 14/05/2005
+// Version : $Revision$ $Date$
+//
+////////////////////////////////////////////////////////////////////////////////
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+////////////////////////////////////////////////////////////////////////////////
+// (C) Craig Drummond, 2005
+////////////////////////////////////////////////////////////////////////////////
+
+class TQStringList;
+class TQString;
+class TQWidget;
+
+namespace KFI
+{
+
+class CFcEngine;
+
+namespace Print
+{
+extern void printItems(const TQStringList &items, int size, TQWidget *parent, CFcEngine &engine);
+extern bool printable(const TQString &mime);
+}
+
+}
+
+#endif
diff --git a/kcontrol/tdefontinst/viewpart/Makefile.am b/kcontrol/tdefontinst/viewpart/Makefile.am
new file mode 100644
index 000000000..dc6bbd115
--- /dev/null
+++ b/kcontrol/tdefontinst/viewpart/Makefile.am
@@ -0,0 +1,30 @@
+noinst_LTLIBRARIES = libkfontinstprint.la
+libkfontinstprint_la_SOURCES = KfiPrint.cpp
+libkfontinstprint_la_LDFLAGS = $(all_libraries)
+libkfontinstprint_la_LIBADD = $(LIB_TDEPRINT) ../lib/libkfontinst.la
+
+kde_module_LTLIBRARIES = libkfontviewpart.la
+
+libkfontviewpart_la_SOURCES = FontViewPart.cpp FontViewPartFactory.cpp FontPreview.cpp
+libkfontviewpart_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries)
+libkfontviewpart_la_LIBADD = $(LIB_KPARTS) libkfontinstprint.la ../lib/libkfontinst.la
+
+noinst_HEADERS = FontViewPart.h FontViewPartFactory.h FontPreview.h FontViewerApp.h KfiPrint.h
+
+kde_services_DATA = kfontviewpart.desktop
+
+AM_CPPFLAGS = -I$(srcdir)/../lib -I$(srcdir)/../../fonts $(all_includes) $(LIBFREETYPE_CFLAGS) $(LIBFONTCONFIG_CFLAGS)
+METASOURCES = AUTO
+
+kfontview_LDADD = $(LIB_KPARTS)
+kfontview_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor
+
+bin_PROGRAMS = kfontview
+xdg_apps_DATA = kfontview.desktop
+
+appdata_DATA = kfontviewpart.rc kfontviewui.rc
+appdatadir = $(kde_datadir)/kfontview
+
+kfontview_SOURCES = FontViewerApp.cpp
+
+
diff --git a/kcontrol/tdefontinst/viewpart/tdefontview.desktop b/kcontrol/tdefontinst/viewpart/tdefontview.desktop
new file mode 100644
index 000000000..88a964974
--- /dev/null
+++ b/kcontrol/tdefontinst/viewpart/tdefontview.desktop
@@ -0,0 +1,100 @@
+[Desktop Entry]
+Name=TDEFontView
+Name[be]=Прагляд шрыфтоў
+Name[bn]=কে-ফন্ট-ভিউ
+Name[cs]=Prohlížeč písem
+Name[eo]=Tiparorigardilo
+Name[eu]=TDEFontWiew
+Name[he]=מציג גופנים
+Name[hi]=के-फ़ॉन्ट-व्यू
+Name[mk]=КФонтПреглед
+Name[nb]=Skriftviser
+Name[nds]=Schriftoortkieker
+Name[ne]=K फन्ट दृश्य
+Name[nn]=Skriftvisar
+Name[rw]=K-IgaragazaImyandikire
+Name[se]=Fontačájeheaddji
+Name[sk]=Prehliadač písiem
+Name[sv]=Kfontview
+Name[tg]=Намоишгари КҲарф
+Name[vi]=Trình xem phông chữ TDE
+Name[wa]=Håyneu di fontes (TDEFontView)
+Name[zh_CN]=字体预览
+Exec=kfontview %i %u
+Icon=fonts
+X-TDE-StartupNotify=true
+Type=Application
+MimeType=application/x-font-ttf;application/x-font-type1;application/x-font-otf;application/x-font-ttc;application/x-font-pcf;application/x-font-bdf;fonts/package;
+GenericName=Font Viewer
+GenericName[af]=Skriftipe Besigter
+GenericName[ar]=معاين المحرف
+GenericName[be]=Праглядальнік шрыфтоў
+GenericName[bg]=Преглед на шрифтове
+GenericName[bn]=ফন্ট প্রদর্শক
+GenericName[br]=Gweler Nodrezhoù
+GenericName[bs]=Preglednik fontova
+GenericName[ca]=Visor de lletres
+GenericName[cs]=Prohlížeč písem
+GenericName[csb]=Przezérnik fòntów
+GenericName[cy]=Gwelydd Wynebfathau
+GenericName[da]=Skrifttype-fremviser
+GenericName[de]=Schriftartenbetrachter
+GenericName[el]=Προβολέας γραμματοσειρών
+GenericName[eo]=Tipara rigardilo
+GenericName[es]=Visor de tipos de letra
+GenericName[et]=Fontide vaataja
+GenericName[eu]=Letra-tipoen ikusgailua
+GenericName[fa]=مشاهده‌گر قلم
+GenericName[fi]=Kirjasinten näytin
+GenericName[fr]=Afficheur de polices
+GenericName[fy]=Lettertypewerjefte
+GenericName[ga]=Amharcán Clófhoirne
+GenericName[gl]=Visor de Fontes
+GenericName[he]=מציג גופנים
+GenericName[hr]=Preglednik fontova
+GenericName[hu]=Betűtípusböngésző
+GenericName[id]=Penampil Font
+GenericName[is]=Leturskoðari
+GenericName[it]=Visualizzatore di caratteri
+GenericName[ja]=フォントビューア
+GenericName[ka]=პროგრამა ფონტების სანახავად
+GenericName[kk]=Қаріпті қарап-шығу
+GenericName[km]=កម្មវិធី​មើល​ពុម្ពអក្សរ
+GenericName[ko]=글꼴 뷰어
+GenericName[lt]=Šriftų žiūryklė
+GenericName[lv]=Fontu Skatītājs
+GenericName[mk]=Прегледувач на фонтови
+GenericName[ms]=Pemapar Fon
+GenericName[mt]=Werrej tal-fonts
+GenericName[nb]=Skrifttypeviser
+GenericName[nds]=Schriftoortkieker
+GenericName[ne]=फन्ट दर्शक
+GenericName[nl]=Lettertypeweergave
+GenericName[nn]=Skriftvisar
+GenericName[pa]=ਫੋਂਟ ਦਰਸ਼ਕ
+GenericName[pl]=Przeglądarka czcionek
+GenericName[pt]=Visualizador de Tipos de Letra
+GenericName[pt_BR]=Visualizador de fontes
+GenericName[ro]=Vizualizor de fonturi
+GenericName[ru]=Программа просмотра шрифтов
+GenericName[rw]=Ikigaragaza Imyandikire
+GenericName[se]=Fontačájeheaddji
+GenericName[sk]=Prehliadač písiem
+GenericName[sl]=Pregledovalnik pisav
+GenericName[sr]=Приказивач фонтова
+GenericName[sr@Latn]=Prikazivač fontova
+GenericName[sv]=Teckensnittsvisning
+GenericName[tg]=Намоишгари ҳарфҳо
+GenericName[th]=โปรแกรมดูแบบอักษร
+GenericName[tr]=Yazıtipi Görüntüleyici
+GenericName[tt]=Yazu Kürsätkeç
+GenericName[uk]=Переглядач шрифтів
+GenericName[uz]=Shrift koʻruvchi
+GenericName[uz@cyrillic]=Шрифт кўрувчи
+GenericName[vi]=Trình xem Phông chữ
+GenericName[wa]=Håyneu di fontes
+GenericName[zh_CN]=字体查看器
+GenericName[zh_TW]=字型檢視器
+Terminal=false
+InitialPreference=1
+Categories=Qt;TDE;Graphics;
diff --git a/kcontrol/tdefontinst/viewpart/tdefontviewpart.desktop b/kcontrol/tdefontinst/viewpart/tdefontviewpart.desktop
new file mode 100644
index 000000000..1e624e00b
--- /dev/null
+++ b/kcontrol/tdefontinst/viewpart/tdefontviewpart.desktop
@@ -0,0 +1,86 @@
+[Desktop Entry]
+Name=Font Viewer
+Name[af]=Skriftipe Besigter
+Name[ar]=معاين المحرف
+Name[az]=Yazı Növü Nümayişçisi
+Name[be]=Праглядальнік шрыфтоў
+Name[bg]=Преглед на шрифт
+Name[bn]=ফন্ট প্রদর্শক
+Name[br]=Gweler Nodrezhoù
+Name[bs]=Preglednik fontova
+Name[ca]=Visor de lletres
+Name[cs]=Prohlížeč písem
+Name[csb]=Przezérnik fòntów
+Name[cy]=Gwelydd Ffont
+Name[da]=Skrifttypevisning
+Name[de]=Schriftartenbetrachter
+Name[el]=Προβολέας γραμματοσειρών
+Name[eo]=Tiparorigardilo
+Name[es]=Visor de tipos de letra
+Name[et]=Fontide vaataja
+Name[eu]=Letra-tipo ikustailea
+Name[fa]=مشاهده‌گر قلم
+Name[fi]=Kirjasinten näytin
+Name[fr]=Afficheur de polices
+Name[fy]=Lettertypewerjefteprogramma
+Name[ga]=Amharcán Clófhoirne
+Name[gl]=Visor de Fontes
+Name[he]=מציג גופנים
+Name[hi]=फ़ॉन्ट प्रदर्शक
+Name[hr]=Preglednik fontova
+Name[hu]=A betűtípusok áttekintése
+Name[id]=Penampil Font
+Name[is]=Leturskoðari
+Name[it]=Vista caratteri
+Name[ja]=フォントビューア
+Name[ka]=პროგრამა ფონტების სანახავად
+Name[kk]=Қаріпті қарап-шығу
+Name[km]=កម្មវិធី​មើល​ពុម្ពអក្សរ
+Name[ko]=글꼴 뷰어
+Name[lo]=ມຸມມອງແບບໄອຄອນ
+Name[lt]=Šrifto žiūriklis
+Name[lv]=Fontu Skatītājs
+Name[mk]=Прегледувач на фонтови
+Name[mn]=Бичиг харагч
+Name[ms]=Pemapar Fon
+Name[mt]=Werrej tal-fonts
+Name[nb]=Skrifttypeviser
+Name[nds]=Schriftoortkieker
+Name[ne]=फन्ट दर्शक
+Name[nl]=Lettertypeweergaveprogramma
+Name[nn]=Skriftvisar
+Name[nso]=Molebeledi wa Fonto
+Name[pa]=ਫੋਂਟ ਦਰਸ਼ਕ
+Name[pl]=Przeglądarka czcionek
+Name[pt]=Visualizador do Tipo de Letra
+Name[pt_BR]=Visualizador de Fontes
+Name[ro]=Vizualizor de fonturi
+Name[ru]=Просмотр шрифтов
+Name[rw]=Ikigaragaza Imyandikire
+Name[se]=Fontačájeheaddji
+Name[sk]=Prehliadač písiem
+Name[sl]=Prikazovalnik pisav
+Name[sr]=Приказивач фонтова
+Name[sr@Latn]=Prikazivač fontova
+Name[sv]=Teckensnittsvisning
+Name[ta]=எழுத்துரு காட்சி
+Name[tg]=Намоишгари ҳарф
+Name[th]=โปรแกรมดูแบบอักษร
+Name[tr]=Yazıtipi İzleyici
+Name[tt]=Yazu Kürsätkeç
+Name[uk]=Переглядач шрифтів
+Name[uz]=Shrift koʻruvchi
+Name[uz@cyrillic]=Шрифт кўрувчи
+Name[ven]=Muvhoni wa Fontu
+Name[vi]=Trình xem Phông chữ
+Name[wa]=Håyneu di fontes
+Name[xh]=Imboniselo Yohlobo lwegama
+Name[zh_CN]=字体查看器
+Name[zh_TW]=字型檢視器
+Name[zu]=Umbukisi Wohlobo lwamagama
+MimeType=application/x-font-ttf;application/x-font-type1;application/x-font-otf;application/x-font-ttc;application/x-font-pcf;application/x-font-bdf;fonts/package
+ServiceTypes=KParts/ReadOnlyPart,Browser/View
+X-TDE-Library=libkfontviewpart
+Type=Service
+InitialPreference=1
+Icon=fonts
diff --git a/kcontrol/tdefontinst/viewpart/tdefontviewpart.rc b/kcontrol/tdefontinst/viewpart/tdefontviewpart.rc
new file mode 100644
index 000000000..5df54a47c
--- /dev/null
+++ b/kcontrol/tdefontinst/viewpart/tdefontviewpart.rc
@@ -0,0 +1,9 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="kfontviewpart" version="1">
+<ToolBar name="mainToolBar">
+ <text>&amp;Main Toolbar</text>
+ <Action name="print"/>
+ <Action name="changeText"/>
+</ToolBar>
+</kpartgui>
+
diff --git a/kcontrol/tdefontinst/viewpart/tdefontviewui.rc b/kcontrol/tdefontinst/viewpart/tdefontviewui.rc
new file mode 100644
index 000000000..f2e4a86fa
--- /dev/null
+++ b/kcontrol/tdefontinst/viewpart/tdefontviewui.rc
@@ -0,0 +1,4 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="kfontviewui" version="1">
+</kpartgui>
+