Konsole
Go to the documentation of this file.
27 #include <QtCore/QFile>
28 #include <QtCore/QTextStream>
44 QString line = input.readLine();
45 while (line.length() < 5)
48 quint32 val =
charVal(line[0]) |
65 int main(
int argc,
char **argv)
68 qWarning(
"usage: fontembedder LineFont.src > LineFont.h");
71 QFile inFile(argv[1]);
72 if (!inFile.open(QIODevice::ReadOnly)) {
73 qWarning(
"Can not open %s", argv[1]);
77 QTextStream input(&inFile);
79 quint32 glyphStates[128];
80 QMap<quint32, int> glyphMap;
82 for (
int i = 0; i < 128; ++i)
85 while (!input.atEnd()) {
86 QString line = input.readLine();
87 line = line.trimmed();
94 int glyph = line.toInt(0, 16);
95 if ((glyph < 0x2500) || (glyph > 0x257f))
96 qFatal(
"Invalid glyph number");
98 glyph = glyph - 0x2500;
103 if (glyphMap.contains(glyphStates[glyph])) {
104 kWarning()<<
"Code "<<glyph<<
" and "<<glyphMap.value(glyphStates[glyph])<<
"have the same glyph state"<<glyphStates[glyph];
106 glyphMap[glyphStates[glyph]] = glyph;
111 cout <<
"// WARNING: Autogenerated by \"fontembedder " << argv[1] <<
"\".\n";
112 cout <<
"// You probably do not want to hand-edit this!\n\n";
113 cout <<
"static const quint32 LineChars[] = {\n";
116 for (
int line = 0; line < 128; line += 8) {
118 for (
int col = line; col < line + 8; ++col) {
119 cout <<
"0x" << hex << setw(8) << setfill(
'0') << glyphStates[col];
int main(int argc, char **argv)
static quint32 readGlyph(QTextStream &input)
static quint32 charVal(QChar val)
static quint32 readGlyphLine(QTextStream &input)
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:31:24 by
doxygen 1.8.7 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.