Patch by Maksim Orlovich BUG: 61637 svn path=/trunk/kdebase/konsole/; revision=382259wilder-portage
parent
29f0ead7d2
commit
5062b40dd6
5 changed files with 1061 additions and 7 deletions
@ -0,0 +1,98 @@ |
||||
#include <qfile.h> |
||||
#include <qtextstream.h> |
||||
#include <iostream> |
||||
#include <iomanip> |
||||
|
||||
using namespace std; |
||||
|
||||
Q_UINT32 charVal(QChar val) |
||||
{ |
||||
if (val == ' ') |
||||
return 0; |
||||
else |
||||
return 1; |
||||
} |
||||
|
||||
Q_UINT32 readGlyphLine(QTextStream& input) |
||||
{ |
||||
QString line = input.readLine(); |
||||
while (line.length() < 5) |
||||
line += ' '; |
||||
|
||||
Q_UINT32 val = charVal(line[0]) | |
||||
(charVal(line[1]) << 1) | |
||||
(charVal(line[2]) << 2) | |
||||
(charVal(line[3]) << 3) | |
||||
(charVal(line[4]) << 4); |
||||
return val; |
||||
} |
||||
|
||||
Q_UINT32 readGlyph(QTextStream& input) |
||||
{ |
||||
return readGlyphLine(input) | |
||||
(readGlyphLine(input) << 5) | |
||||
(readGlyphLine(input) << 10) | |
||||
(readGlyphLine(input) << 15) | |
||||
(readGlyphLine(input) << 20); |
||||
} |
||||
|
||||
int main(int argc, char **argv) |
||||
{ |
||||
if (argc < 1) |
||||
{ |
||||
qWarning("usage: fontembedder font.src > font.h"); |
||||
exit(1); |
||||
} |
||||
QFile inFile(argv[1]); |
||||
if (!inFile.open(IO_ReadOnly)) |
||||
{ |
||||
qFatal("Can not open %s", argv[1]); |
||||
} |
||||
|
||||
QTextStream input(&inFile); |
||||
|
||||
Q_UINT32 glyphStates[128]; |
||||
for (int i = 0; i < 128; ++i) |
||||
glyphStates[i] = 0; //nothing..
|
||||
|
||||
while (!input.atEnd()) |
||||
{ |
||||
QString line = input.readLine(); |
||||
line = line.stripWhiteSpace(); |
||||
if (line.isEmpty()) |
||||
continue; //Skip empty lines
|
||||
if (line[0] == '#') |
||||
continue; //Skip comments
|
||||
|
||||
//Must be a glyph ID.
|
||||
int glyph = line.toInt(0, 16); |
||||
if ((glyph < 0x2500) || (glyph > 0x257f)) |
||||
qFatal("Invalid glyph number"); |
||||
|
||||
glyph = glyph - 0x2500; |
||||
|
||||
glyphStates[glyph] = readGlyph(input); |
||||
} |
||||
|
||||
//Output.
|
||||
cout<<"// WARNING: Autogenerated by \"fontembedder " << argv[1] << "\".\n"; |
||||
cout<<"// You probably do not want to hand-edit this!\n\n"; |
||||
cout<<"static const Q_UINT32 LineChars[] = {\n"; |
||||
|
||||
//Nicely formatted: 8 per line, 16 lines
|
||||
for (int line = 0; line < 128; line += 8) |
||||
{ |
||||
cout<<"\t"; |
||||
for (int col = line; col < line + 8; ++col) |
||||
{ |
||||
cout<<"0x"<<hex<<setw(8)<<setfill('0')<<glyphStates[col]; |
||||
if (col != 127) |
||||
cout<<", "; |
||||
} |
||||
cout<<"\n"; |
||||
} |
||||
cout<<"};\n"; |
||||
return 0; |
||||
} |
||||
|
||||
//kate: indent-width 4; tab-width 4; space-indent on;
|
||||
@ -0,0 +1,21 @@ |
||||
// WARNING: Autogenerated by "fontembedder ./linefont.src".
|
||||
// You probably do not want to hand-edit this!
|
||||
|
||||
static const Q_UINT32 LineChars[] = { |
||||
0x00007c00, 0x000fffe0, 0x00421084, 0x00e739ce, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00427000, 0x004e7380, 0x00e77800, 0x00ef7bc0,
|
||||
0x00421c00, 0x00439ce0, 0x00e73c00, 0x00e7bde0, 0x00007084, 0x000e7384, 0x000079ce, 0x000f7bce,
|
||||
0x00001c84, 0x00039ce4, 0x00003dce, 0x0007bdee, 0x00427084, 0x004e7384, 0x004279ce, 0x00e77884,
|
||||
0x00e779ce, 0x004f7bce, 0x00ef7bc4, 0x00ef7bce, 0x00421c84, 0x00439ce4, 0x00423dce, 0x00e73c84,
|
||||
0x00e73dce, 0x0047bdee, 0x00e7bde4, 0x00e7bdee, 0x00427c00, 0x0043fce0, 0x004e7f80, 0x004fffe0,
|
||||
0x004fffe0, 0x00e7fde0, 0x006f7fc0, 0x00efffe0, 0x00007c84, 0x0003fce4, 0x000e7f84, 0x000fffe4,
|
||||
0x00007dce, 0x0007fdee, 0x000f7fce, 0x000fffee, 0x00427c84, 0x0043fce4, 0x004e7f84, 0x004fffe4,
|
||||
0x00427dce, 0x00e77c84, 0x00e77dce, 0x0047fdee, 0x004e7fce, 0x00e7fde4, 0x00ef7f84, 0x004fffee,
|
||||
0x00efffe4, 0x00e7fdee, 0x00ef7fce, 0x00efffee, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x000f83e0, 0x00a5294a, 0x004e1380, 0x00a57800, 0x00ad0bc0, 0x004390e0, 0x00a53c00, 0x00a5a1e0,
|
||||
0x000e1384, 0x0000794a, 0x000f0b4a, 0x000390e4, 0x00003d4a, 0x0007a16a, 0x004e1384, 0x00a5694a,
|
||||
0x00ad2b4a, 0x004390e4, 0x00a52d4a, 0x00a5a16a, 0x004f83e0, 0x00a57c00, 0x00ad83e0, 0x000f83e4,
|
||||
0x00007d4a, 0x000f836a, 0x004f93e4, 0x00a57d4a, 0x00ad836a, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001c00, 0x00001084, 0x00007000, 0x00421000,
|
||||
0x00039ce0, 0x000039ce, 0x000e7380, 0x00e73800, 0x000e7f80, 0x00e73884, 0x0003fce0, 0x004239ce |
||||
}; |
||||
@ -0,0 +1,786 @@ |
||||
#2500: single horizontal line |
||||
2500 |
||||
|
||||
|
||||
----- |
||||
|
||||
|
||||
|
||||
#2501: triple horizontal line |
||||
2501 |
||||
|
||||
----- |
||||
----- |
||||
----- |
||||
|
||||
|
||||
#2502: single vertical line |
||||
2502 |
||||
| |
||||
| |
||||
| |
||||
| |
||||
| |
||||
|
||||
#2503: triple vertical line |
||||
2503 |
||||
||| |
||||
||| |
||||
||| |
||||
||| |
||||
||| |
||||
|
||||
#2504-250B are dashed - not handled |
||||
|
||||
#250C: top-left corner (lines on bottom + right) |
||||
250C |
||||
|
||||
|
||||
.-- |
||||
| |
||||
| |
||||
|
||||
#250D: as above, but top line triple-width |
||||
250D |
||||
|
||||
.-- |
||||
.-- |
||||
|-- |
||||
| |
||||
|
||||
#250E: now the vert line triple-width |
||||
250E |
||||
|
||||
|
||||
..-- |
||||
||| |
||||
||| |
||||
|
||||
#250F: and now both lines triple-width |
||||
250F |
||||
|
||||
.___ |
||||
|.-- |
||||
||._ |
||||
||| |
||||
|
||||
#2510: top-right corner |
||||
2510 |
||||
|
||||
|
||||
--. |
||||
| |
||||
| |
||||
|
||||
2511 |
||||
|
||||
==. |
||||
==. |
||||
==| |
||||
| |
||||
|
||||
2512 |
||||
|
||||
|
||||
==.. |
||||
||| |
||||
||| |
||||
|
||||
2513 |
||||
|
||||
===. |
||||
==.| |
||||
=.|| |
||||
||| |
||||
|
||||
#2514: bottom-left corner |
||||
2514 |
||||
| |
||||
| |
||||
.== |
||||
|
||||
|
||||
|
||||
2515 |
||||
| |
||||
|== |
||||
|== |
||||
=== |
||||
|
||||
|
||||
|
||||
2516 |
||||
||| |
||||
||| |
||||
|.== |
||||
|
||||
|
||||
|
||||
2517 |
||||
||| |
||||
||.= |
||||
|.== |
||||
.=== |
||||
|
||||
|
||||
#2518: bottm-right corner |
||||
2518 |
||||
| |
||||
| |
||||
==. |
||||
|
||||
|
||||
|
||||
2519 |
||||
| |
||||
==| |
||||
==| |
||||
=== |
||||
|
||||
|
||||
|
||||
251A |
||||
||| |
||||
||| |
||||
==== |
||||
|
||||
|
||||
|
||||
251B |
||||
||| |
||||
=.|| |
||||
==.| |
||||
===. |
||||
|
||||
|
||||
#251C: Join of vertical line and one from the right |
||||
251C |
||||
| |
||||
| |
||||
|== |
||||
| |
||||
| |
||||
|
||||
251D |
||||
| |
||||
|== |
||||
|== |
||||
|== |
||||
| |
||||
|
||||
251E |
||||
||| |
||||
||| |
||||
||== |
||||
| |
||||
| |
||||
|
||||
251F |
||||
| |
||||
| |
||||
||== |
||||
||| |
||||
||| |
||||
|
||||
|
||||
2520 |
||||
||| |
||||
||| |
||||
||== |
||||
||| |
||||
||| |
||||
|
||||
2521 |
||||
||| |
||||
|||= |
||||
||== |
||||
.|== |
||||
| |
||||
|
||||
2522 |
||||
| |
||||
.|== |
||||
||== |
||||
|||= |
||||
||| |
||||
|
||||
2523 |
||||
||| |
||||
||.= |
||||
||== |
||||
||.= |
||||
||| |
||||
|
||||
#2524: Join of vertical line and one from the left |
||||
2524 |
||||
| |
||||
| |
||||
==| |
||||
| |
||||
| |
||||
|
||||
2525 |
||||
| |
||||
==| |
||||
==| |
||||
==| |
||||
| |
||||
|
||||
2526 |
||||
||| |
||||
||| |
||||
==+| |
||||
| |
||||
| |
||||
|
||||
2527 |
||||
| |
||||
| |
||||
==+| |
||||
||| |
||||
||| |
||||
|
||||
2528 |
||||
||| |
||||
||| |
||||
==+| |
||||
||| |
||||
||| |
||||
|
||||
2529 |
||||
||| |
||||
=+|| |
||||
==+| |
||||
===+ |
||||
| |
||||
|
||||
252A |
||||
| |
||||
=+|| |
||||
==+| |
||||
===+ |
||||
||| |
||||
|
||||
252B |
||||
||| |
||||
=+|| |
||||
==+| |
||||
=+|| |
||||
||| |
||||
|
||||
#252C: horizontal line joined to from below |
||||
252C |
||||
|
||||
|
||||
===== |
||||
| |
||||
| |
||||
|
||||
252D |
||||
|
||||
=== |
||||
==|== |
||||
==| |
||||
| |
||||
|
||||
252E |
||||
|
||||
=== |
||||
==|== |
||||
|== |
||||
| |
||||
|
||||
252F |
||||
|
||||
==+== |
||||
==|== |
||||
==|== |
||||
| |
||||
|
||||
2530 |
||||
|
||||
===== |
||||
===== |
||||
==|== |
||||
| |
||||
|
||||
2531 |
||||
|
||||
===| |
||||
==||= |
||||
=||| |
||||
||| |
||||
|
||||
2532 |
||||
|
||||
|=== |
||||
=||== |
||||
||== |
||||
|| |
||||
|
||||
2533 |
||||
|
||||
===== |
||||
==|== |
||||
=+|+= |
||||
||| |
||||
|
||||
#2534: bottom line, connected to from top |
||||
2534 |
||||
| |
||||
| |
||||
===== |
||||
|
||||
|
||||
|
||||
2535 |
||||
| |
||||
==| |
||||
===== |
||||
=== |
||||
|
||||
|
||||
2536 |
||||
| |
||||
|== |
||||
===== |
||||
=== |
||||
|
||||
|
||||
2537 |
||||
| |
||||
==|== |
||||
===== |
||||
===== |
||||
|
||||
|
||||
2538 |
||||
||| |
||||
||| |
||||
===== |
||||
|
||||
|
||||
|
||||
2539 |
||||
||| |
||||
==|| |
||||
===== |
||||
===| |
||||
|
||||
|
||||
|
||||
253A |
||||
||| |
||||
||== |
||||
=|=== |
||||
|=== |
||||
|
||||
|
||||
253B |
||||
||| |
||||
==|== |
||||
===== |
||||
===== |
||||
|
||||
|
||||
#253C: vertical + horizontal lines intersecting |
||||
253C |
||||
| |
||||
| |
||||
===== |
||||
| |
||||
| |
||||
|
||||
253D |
||||
| |
||||
==| |
||||
===== |
||||
==| |
||||
| |
||||
|
||||
253E |
||||
| |
||||
|== |
||||
===== |
||||
|== |
||||
| |
||||
|
||||
253F |
||||
| |
||||
==|== |
||||
===== |
||||
==|== |
||||
| |
||||
|
||||
2540 |
||||
||| |
||||
||| |
||||
===== |
||||
| |
||||
| |
||||
|
||||
2541 |
||||
| |
||||
| |
||||
===== |
||||
||| |
||||
||| |
||||
|
||||
2542 |
||||
||| |
||||
||| |
||||
===== |
||||
||| |
||||
||| |
||||
|
||||
2543 |
||||
||| |
||||
=||| |
||||
===== |
||||
==|+ |
||||
| |
||||
|
||||
2544 |
||||
||| |
||||
||== |
||||
===== |
||||
|== |
||||
| |
||||
|
||||
2545 |
||||
| |
||||
==|+ |
||||
===== |
||||
=||| |
||||
||| |
||||
|
||||
2546 |
||||
| |
||||
|== |
||||
===== |
||||
||== |
||||
||| |
||||
|
||||
2547 |
||||
||| |
||||
=|||= |
||||
===== |
||||
=|||= |
||||
| |
||||
|
||||
2548 |
||||
| |
||||
=|||= |
||||
===== |
||||
=|||= |
||||
||| |
||||
|
||||
2549 |
||||
||| |
||||
=||| |
||||
===== |
||||
=||| |
||||
||| |
||||
|
||||
254A |
||||
||| |
||||
|||= |
||||
===== |
||||
|||= |
||||
||| |
||||
|
||||
254B |
||||
||| |
||||
=|||= |
||||
===== |
||||
=|||= |
||||
||| |
||||
|
||||
#254C-254F are dashed |
||||
2550 |
||||
|
||||
_____ |
||||
|
||||
_____ |
||||
|
||||
|
||||
2551 |
||||
| | |
||||
| | |
||||
| | |
||||
| | |
||||
| | |
||||
|
||||
2552 |
||||
|
||||
|-- |
||||
| |
||||
|-- |
||||
| |
||||
|
||||
2553 |
||||
|
||||
|
||||
---- |
||||
| | |
||||
| | |
||||
|
||||
2554 |
||||
|
||||
+--- |
||||
| |
||||
+ +- |
||||
| | |
||||
|
||||
2555 |
||||
|
||||
--+ |
||||
| |
||||
--+ |
||||
| |
||||
|
||||
2556 |
||||
|
||||
|
||||
-+-+ |
||||
| | |
||||
| | |
||||
|
||||
2557 |
||||
|
||||
---+ |
||||
| |
||||
-+ | |
||||
| | |
||||
|
||||
2558 |
||||
| |
||||
+-- |
||||
| |
||||
+-- |
||||
|
||||
2559 |
||||
| | |
||||
| | |
||||
+-+- |
||||
|
||||
|
||||
|
||||
255A |
||||
| | |
||||
| +- |
||||
| |
||||
+--- |
||||
|
||||
|
||||
255B |
||||
| |
||||
--+ |
||||
| |
||||
--+ |
||||
|
||||
|
||||
255C |
||||
| | |
||||
| | |
||||
-+-+ |
||||
|
||||
|
||||
255D |
||||
| | |
||||
-+ | |
||||
| |
||||
---+ |
||||
|
||||
|
||||
255E |
||||
| |
||||
+-- |
||||
| |
||||
+-- |
||||
| |
||||
|
||||
255F |
||||
| | |
||||
| | |
||||
| +- |
||||
| | |
||||
| | |
||||
|
||||
2560 |
||||
| | |
||||
| +- |
||||
| | |
||||
| +- |
||||
| | |
||||
|
||||
2561 |
||||
| |
||||
--+ |
||||
| |
||||
--+ |
||||
| |
||||
|
||||
2562 |
||||
| | |
||||
| | |
||||
-+ + |
||||
| | |
||||
| | |
||||
|
||||
2563 |
||||
| | |
||||
-+ | |
||||
| |
||||
-+ | |
||||
| | |
||||
|
||||
2564 |
||||
|
||||
----- |
||||
|
||||
--+-- |
||||
| |
||||
|
||||
2565 |
||||
|
||||
|
||||
-+-+- |
||||
| | |
||||
| | |
||||
|
||||
2566 |
||||
|
||||
----- |
||||
|
||||
-+ +- |
||||
| | |
||||
|
||||
2567 |
||||
| |
||||
--+-- |
||||
|
||||
----- |
||||
|
||||
|
||||
2568 |
||||
| | |
||||
| | |
||||
-+-+- |
||||
|
||||
|
||||
|
||||
2569 |
||||
| | |
||||
-+ +- |
||||
|
||||
----- |
||||
|
||||
|
||||
256A |
||||
| |
||||
--+-- |
||||
| |
||||
--+-- |
||||
| |
||||
|
||||
256B |
||||
| | |
||||
| | |
||||
-+-+- |
||||
| | |
||||
| | |
||||
|
||||
256C |
||||
| | |
||||
-+ +- |
||||
|
||||
-+ +- |
||||
| | |
||||
|
||||
#256F-2570 are curly, |
||||
#2571-2573 are slashes and X |
||||
|
||||
2574 |
||||
|
||||
|
||||
___ |
||||
|
||||
|
||||
|
||||
2575 |
||||
| |
||||
| |
||||
| |
||||
|
||||
|
||||
|
||||
2576 |
||||
|
||||
|
||||
___ |
||||
|
||||
|
||||
|
||||
2577 |
||||
|
||||
|
||||
| |
||||
| |
||||
| |
||||
|
||||
2578 |
||||
|
||||
___ |
||||
___ |
||||
___ |
||||
|
||||
|
||||
2579 |
||||
||| |
||||
||| |
||||
||| |
||||
|
||||
|
||||
|
||||
257A |
||||
|
||||
___ |
||||
___ |
||||
___ |
||||
|
||||
|
||||
257B |
||||
|
||||
|
||||
||| |
||||
||| |
||||
||| |
||||
|
||||
257C |
||||
|
||||
___ |
||||
_____ |
||||
___ |
||||
|
||||
|
||||
257D |
||||
| |
||||
| |
||||
||| |
||||
||| |
||||
||| |
||||
|
||||
257E |
||||
|
||||
___ |
||||
_____ |
||||
___ |
||||
|
||||
|
||||
257F |
||||
||| |
||||
||| |
||||
||| |
||||
| |
||||
| |
||||
Loading…
Reference in new issue