author | llornkcor <llornkcor> | 2004-01-18 00:31:12 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2004-01-18 00:31:12 (UTC) |
commit | 933d897346745d3d51e41591c59387ef6d2bb917 (patch) (side-by-side diff) | |
tree | c3f0caba0922d2f9ce8f73c6a4d60eb48f3efcb3 /core/apps/embeddedkonsole/konsole.cpp | |
parent | e9700698b2d664a688af20008095551624c995ae (diff) | |
download | opie-933d897346745d3d51e41591c59387ef6d2bb917.zip opie-933d897346745d3d51e41591c59387ef6d2bb917.tar.gz opie-933d897346745d3d51e41591c59387ef6d2bb917.tar.bz2 |
add unifont from somewhere
Diffstat (limited to 'core/apps/embeddedkonsole/konsole.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/apps/embeddedkonsole/konsole.cpp | 103 |
1 files changed, 88 insertions, 15 deletions
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp index fff2f68..a5adc03 100644 --- a/core/apps/embeddedkonsole/konsole.cpp +++ b/core/apps/embeddedkonsole/konsole.cpp @@ -21,3 +21,5 @@ // enhancements added by L.J. Potter <ljp@llornkcor.com> -#define QT_QWS_OPIE +//#define QT_QWS_OPIE + +#include "signal.h" @@ -51,3 +53,3 @@ #include <sys/types.h> -#include <sys/wait.h> +//#include <sys/wait.h> #include <stdio.h> @@ -64,2 +66,6 @@ +#include <qfontdatabase.h> // U.B. +#include <qstringlist.h> // U.B. +#include <qvaluelist.h> // U.B. + class EKNumTabBar : public QTabBar { @@ -180,6 +186,7 @@ static void konsoleInit(const char** shell) { - +// signal (SIGSTOP, SIG_IGN); + // QPEApplication::grabKeyboard(); // for CTRL and ALT - qDebug("keyboard grabbed"); +// qDebug("keyboard grabbed"); #ifdef FAKE_CTRL_AND_ALT @@ -190,3 +197,3 @@ static void konsoleInit(const char** shell) { *shell = getenv("SHELL"); - qWarning("SHell initially is %s", *shell ); +// qWarning("SHell initially is %s", *shell ); @@ -207,3 +214,3 @@ static void konsoleInit(const char** shell) { - qWarning("SHELL now is %s", *shell ); +// qWarning("SHELL now is %s", *shell ); @@ -221,3 +228,3 @@ Konsole::Konsole(QWidget* parent, const char* name, WFlags fl) : konsoleInit( &shell); - qWarning("Using shell %s", shell); +// qWarning("Using shell %s", shell); init(shell,tmp); @@ -263,2 +270,3 @@ void Konsole::init(const char* _pgm, QStrList & _args) cfont = cfg.readNumEntry("FontID", 1); + QFont f = QFont("Micro", 4, QFont::Normal); @@ -275,3 +283,66 @@ void Konsole::init(const char* _pgm, QStrList & _args) - // create terminal emulation framework //////////////////////////////////// +// NEW STUFF + + QStringList ignfont = cfg.readListEntry("IgnFont", ','); + /* If there is no "IgnFont = ..." entry in "myonsole.conf", + * put some Japanese fonts of the SL-C7x0 to "ignfont". */ + + if (ignfont.isEmpty()) { + ignfont = QStringList::split (',',"jisupasp,mmkjg1,mmkjg4,mmkjg5"); + } + +// QFont + f = QFont("Fixed", 16, QFont::Normal); + f.setFixedPitch(true); + fonts.append(new VTFont(tr("Default"), f)); + + int fcount = 1; + + f.setCharSet(QFont::AnyCharSet); + f.setStyleHint(QFont::TypeWriter, QFont::PreferMatch); +// f.setWeight(QFont::Normal); + + /* + * Look for installed font families. If the family is not in + * the "ignfont" list, look for available sizes. + * If it is fixed pitch font, put the font and the size + * to the fontlist. + */ + QFontDatabase fdb; + QStringList ff = fdb.families(false); + + for (QStringList::Iterator it = ff.begin(); it != ff.end(); ++it ) { + QString fit = *it; + + if( fit != "fixed" && fit != "micro" ) { + if ( ignfont.contains(*it) == 0) { + QValueList<int> pt = fdb.pointSizes(*it); + + for (QValueList<int>::Iterator itv = pt.begin(); + itv != pt.end(); ++itv ) { + int size = (*itv)/10; + if(size > 0) { + f.setFamily(*it); + f.setPointSize(size); + } + + QFontMetrics fm(f); + +//qDebug("%s %d:\twidth('i')=%d, width('w')=%d", (*it).latin1(), (*itv)/10, fm.width('i'), fm.width('w')); + + if (fm.width('i') == fm.width('w') ) { + qDebug((*it)); + f.setFixedPitch(true); + fonts.append(new VTFont(*it + ' ' + QString::number(size), f)); + fcount++; + } + } + } + } + } + +// END NEW STUFF + + +// create terminal emulation framework //////////////////////////////////// nsessions = 0; @@ -294,2 +365,3 @@ void Konsole::init(const char* _pgm, QStrList & _args) } + fontChanged(cfont); @@ -627,9 +699,10 @@ void Konsole::setFont(int fontno) void Konsole::changeColumns(int columns) -{ //FIXME this seems to cause silliness when reset command is executed -// qDebug("change columns"); -// TEWidget* te = getTe(); -// if (te != 0) { -// setColLin(columns,te->Lines()); -// te->update(); -// } +{ + //FIXME this seems to cause silliness when reset command is executed +// qDebug("change columns"); +// TEWidget* te = getTe(); +// if (te != 0) { +// setColLin(columns,te->Lines()); +// te->update(); +// } } |