1
0
mirror of https://github.com/gryf/wmdocklib.git synced 2025-12-19 20:38:03 +01:00

1575762: initialization of pixmask

this is an important modification.  I hope it won't break too many programs
based on this library, or at least not in such a way that will make you
upset with me and my work...

well: the library offers now three charsets and a 16 colours palette.
but: you must use them.

there is no support yet for named colours.

the only working examples are pywmdatetime and pywmhdmon.
This commit is contained in:
mfrasca
2006-10-12 17:29:17 +00:00
parent c1508bdbcd
commit ed4b557ab0
4 changed files with 338 additions and 274 deletions

View File

@@ -49,8 +49,6 @@ import os
import wmdocklib import wmdocklib
from wmdocklib import char_width, char_height
width = 64 width = 64
height = 64 height = 64
@@ -72,6 +70,9 @@ def addString(s, x, y):
width, height) width, height)
except ValueError, e: except ValueError, e:
sys.stderr.write('Error when painting string:\n' + str(e) + '\n') sys.stderr.write('Error when painting string:\n' + str(e) + '\n')
sys.stderr.write('test %s' % ((s, x, y, xOffset, yOffset,
width, height),))
raise
sys.exit(3) sys.exit(3)
def clearLine(y): def clearLine(y):
@@ -186,33 +187,6 @@ def mainLoop(timeFmt, dateFmt, dayFmt, weekFmt):
wmdocklib.redraw() wmdocklib.redraw()
time.sleep(0.1) time.sleep(0.1)
def parseColors(defaultRGBFileNames, config, xpm):
rgbFileName = ''
for fn in defaultRGBFileNames:
if os.access(fn, os.R_OK):
rgbFileName = fn
break
rgbFileName = config.get('rgbfile', rgbFileName)
useColors = 1
if not os.access(rgbFileName, os.R_OK):
sys.stderr.write(
"Can't read the RGB file, try setting it differently using -r,\n")
sys.stderr.write(
"Ignoring your color settings, using the defaults.\n")
useColors = 0
if useColors:
# Colors is a list with (<config_key>, <xpm-key>) pairs.
colors = (('foreground', 'text'),
('background', 'background'))
for key, value in colors:
col = config.get(key)
if not col is None:
code = wmdocklib.getColorCode(col, rgbFileName)
if code is None:
sys.stderr.write('Bad colorcode for %s, ignoring.\n' % key)
else:
wmdocklib.setColor(xpm, value, code)
def main(): def main():
clConfig = parseCommandLine(sys.argv) clConfig = parseCommandLine(sys.argv)
configFile = clConfig.get('configfile', defaultConfigFile) configFile = clConfig.get('configfile', defaultConfigFile)
@@ -224,8 +198,6 @@ def main():
for i in clConfig.iteritems(): for i in clConfig.iteritems():
config[i[0]] = i[1] config[i[0]] = i[1]
parseColors(defaultRGBFiles, config, xpm)
wmdocklib.setDefaultPixmap(xpm)
timeFmt = config.get('timeformat', timeDefaultFormat) timeFmt = config.get('timeformat', timeDefaultFormat)
dateFmt = config.get('dateformat', dateDefaultFormat) dateFmt = config.get('dateformat', dateDefaultFormat)
dayFmt = config.get('weekdayformat', dayDefaultFormat) dayFmt = config.get('weekdayformat', dayDefaultFormat)
@@ -241,84 +213,8 @@ def main():
wmdocklib.openXwindow(sys.argv, width, height) wmdocklib.openXwindow(sys.argv, width, height)
mainLoop(timeFmt, dateFmt, dayFmt, weekFmt) mainLoop(timeFmt, dateFmt, dayFmt, weekFmt)
xpm = \ char_width, char_height = wmdocklib.initPixmap(font_name='6x8',
['160 100 11 1', bg='f', fg='9')
' \tc #208120812081',
'.\tc #00000000FFFF',
'o\tc #C71BC30BC71B',
'O\tc #861782078E38',
'+\tc #EFBEF3CEEFBE',
'@\tc #618561856185',
'#\tc #9E79A2899E79',
'$\tc #410341034103',
'/\tc #2020b2b2aaaa s graph',
'_\tc #000000000000 s background',
'%\tc #2081B2CAAEBA s text',
' ________________________________________________________________________________________________',
' __///___________________________________________________________________________________________',
' __///___________________________________________________________________________________________',
' __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///___________________________________________________________________________________________',
' ________________________________________________________ __///////////////////////////////////////////////////////////////////////////////////////////___',
' ________________________________________________________ __///////////////////////////////////////////////////////////////////////////////////////////___',
' __///////////////////////////////////////////////////////////////////////////////////////////___',
' ________________________________________________________________________________________________',
' ________________________________________________________________________________________________',
' ________________________________________________________________________________________________',
] + wmdocklib.char_map
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View File

@@ -57,8 +57,6 @@ import os
import wmdocklib import wmdocklib
from wmdocklib import char_width, char_height
width = 64 width = 64
height = 64 height = 64
@@ -425,7 +423,7 @@ def main():
config = fileConfig config = fileConfig
for i in clConfig.iteritems(): for i in clConfig.iteritems():
config[i[0]] = i[1] config[i[0]] = i[1]
parseColors(defaultRGBFiles, config, xpm) #parseColors(defaultRGBFiles, config, xpm)
pathsToMonitor = [] pathsToMonitor = []
for i in range(1,1000): for i in range(1,1000):
@@ -450,7 +448,7 @@ def main():
58, 4 + i * (char_height + 1)) 58, 4 + i * (char_height + 1))
procStat = config.get('procstat', defaultProcStat) procStat = config.get('procstat', defaultProcStat)
skipping = int(config.get('skipconf', 0)) skipping = int(config.get('skipconf', 0))
actMonEnabled = int(config.get('monitoring')) actMonEnabled = int(config.get('monitoring',0))
if not os.access(procStat, os.R_OK): if not os.access(procStat, os.R_OK):
sys.stderr.write( sys.stderr.write(
"Can't read your procstat file, try setting it with -p. ") "Can't read your procstat file, try setting it with -p. ")
@@ -461,7 +459,6 @@ def main():
except IndexError: except IndexError:
programName = '' programName = ''
sys.argv[0] = programName sys.argv[0] = programName
wmdocklib.setDefaultPixmap(xpm)
wmdocklib.openXwindow(sys.argv, width, height) wmdocklib.openXwindow(sys.argv, width, height)
signal.signal(signal.SIGCHLD, handler) signal.signal(signal.SIGCHLD, handler)
@@ -472,86 +469,76 @@ def main():
hdmon = PywmHDMon(pathsToMonitor, procStat, actMonEnabled, skipping) hdmon = PywmHDMon(pathsToMonitor, procStat, actMonEnabled, skipping)
hdmon.mainLoop() hdmon.mainLoop()
xpm = \ background = \
['160 100 13 1', ['0000000000000000000000000000000000000000000000000000000000000000',
' \tc #208120812081', '0044400555002220055500555000000000000000000000000000000000000000',
'.\tc #00000000FFFF', '0044400555002220055500555000000000000000000000000000000000000000',
'o\tc #C71BC30BC71B', '0044400555002220055500555000000000000000000000000000000000000000',
'O\tc #861782078E38', '0044400555005550055500555000000000000000000000000000000000000000',
'+\tc #EFBEF3CEEFBE', '0044400555005550055500555000000000000000000000000000000000000000',
'@\tc #618561856185', '0044400555005550055500555000000000000000000000000000000000000000',
'#\tc #9E79A2899E79', '0044400555005550022200555000000000000000000000000000000000000000',
'$\tc #410341034103', '0044400555005550022200555000000000000000000000000000000000000000',
'o\tc #2020b2b2aaaa s indicator', '0044400555005550022200555000000000000000000000000000000000000000',
'/\tc #2020b2b2aaaa s graph', '0044400555005550055500555000000000000000000000000000000000000000',
'-\tc #707070707070 s graphbg', '0044400555005550055500555000000000000000000000000000000000000000',
'_\tc #000000000000 s background', '0044400555005550055500555000000000000000000000000000000000000000',
'%\tc #2081B2CAAEBA s text', '0044400555005550055500222000000000000000000000000000000000000000',
' ...............................................................................................', '0044400555005550055500222000000000000000000000000000000000000000',
' .///..___..ooo..___..___.......................................................................', '0044400555005550055500222000000000000000000000000000000000000000',
' .///..___..ooo..___..___.......................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' .///..___..ooo..___..___.......................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///..___..___..___..___.......................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///..___..___..___..___.......................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///..___..___..___..___.......................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///..___..___..ooo..___.......................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///..___..___..ooo..___.......................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///..___..___..ooo..___.......................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///..___..___..___..___.......................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///..___..___..___..___.......................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///..___..___..___..___.......................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///..___..___..___..ooo.......................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///..___..___..___..ooo.......................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///..___..___..___..ooo.......................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///...........................................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///...........................................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///...........................................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///...........................................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///...........................................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///...........................................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///...........................................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///...........................................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///...........................................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///...........................................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///...........................................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///...........................................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///...........................................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///...........................................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///...........................................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///...........................................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///...........................................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///...........................................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///...........................................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///...........................................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///...........................................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///...........................................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///...........................................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///...........................................................................................', '0044400077777777777777777777777777777777777777777777777777777777',
' ________________________________________________________ .///...........................................................................................', '0044400077777777777777777777777777777777777777777777777777777777',
' ________________________________________________________ .///...........................................................................................', '0044400077777777777777777777777777777777777777777777777777777777',
' ________________________________________________________ .///...........................................................................................', '0044400077777777777777777777777777777777777777777777777777777777',
' ________________________________________________________ .///...........................................................................................', '0044400000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///...........................................................................................', '0044444444444444444444444444444444444444444444444444444444444444',
' ________________________________________________________ .///...........................................................................................', '0044444444444444444444444444444444444444444444444444444444444444',
' ________________________________________________________ .///...........................................................................................', '0044444444444444444444444444444444444444444444444444444444444444',
' ________________________________________________________ .///...........................................................................................', '0044444444444444444444444444444444444444444444444444444444444444',
' ________________________________________________________ .///...........................................................................................', '0000000000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///...........................................................................................', '0000000000000000000000000000000000000000000000000000000000000000',
' ________________________________________________________ .///...........................................................................................', ]
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///...........................................................................................', char_width, char_height = wmdocklib.initPixmap(background,
' ________________________________________________________ .///...-------------------------------------------------------------------------------------...', font_name='6x8',
' ________________________________________________________ .///...-------------------------------------------------------------------------------------...', bg='7', fg='a')
' ________________________________________________________ .///...-------------------------------------------------------------------------------------...',
' ________________________________________________________ .///...-------------------------------------------------------------------------------------...',
' ________________________________________________________ .///...........................................................................................',
' ________________________________________________________ .///////////////////////////////////////////////////////////////////////////////////////////...',
' ________________________________________________________ .///////////////////////////////////////////////////////////////////////////////////////////...',
' .///////////////////////////////////////////////////////////////////////////////////////////...',
' .///////////////////////////////////////////////////////////////////////////////////////////...',
' ...............................................................................................',
' ...............................................................................................',
] + wmdocklib.char_map
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View File

@@ -285,7 +285,7 @@ static void GetXPM(XpmIcon *wmgen, char *pixmap_bytes[]) {
&(wmgen->mask), &(wmgen->attributes)); &(wmgen->mask), &(wmgen->attributes));
if (err != XpmSuccess) { if (err != XpmSuccess) {
fprintf(stderr, "Not enough free colorcells.\n"); fprintf(stderr, "Not enough free colorcells. %d\n", err);
exit(1); exit(1);
} }
} }

View File

@@ -12,6 +12,10 @@ Licensed under the GNU General Public License
Changes: Changes:
2006-10-10 Mario Frasca
redesigned xpm initialization
2003-06-25 Kristoffer Erlandsson 2003-06-25 Kristoffer Erlandsson
Updated documentation Updated documentation
@@ -66,33 +70,24 @@ def getCenterStartPos(s, areaWidth, offset):
def addChar(ch, x, y, xOffset, yOffset, width, height): def addChar(ch, x, y, xOffset, yOffset, width, height):
"""Paint the character ch at position x, y in the window. """Paint the character ch at position x, y in the window.
Return the (width, height) of the character painted. Raise Return the (width, height) of the character painted. (will be useful if
ValueError if we try to paint a char not in letters or digits we implement proportional char sets)
or if we get out of bounds during painting. digits is really
just another line of chars, it's unlucky called digits everywhere the library only supports lower ascii: 32-127. any other will cause a
I used it since it contained only digits in the start. However, ValueError exception.
now it contains various special chars too everywhere I use it. But
the name remains in too many places so I haven't gotten to change if the character being painted falls partly out of the boundary, it will
it. be clipped without causing an exception. this works even if the
character starts out of the boundary.
""" """
chX = None
for line in range(3): if not (32 <= ord(ch) <= 127):
chIndex = char_list[line].find(ch) raise ValueError, "Unsupported Char: '%s'(%d)" % (ch, ord(ch))
if chIndex != -1: stringsize = 128 - (128 % char_width)
chX = char_startx + chIndex * char_width pos = (ord(ch)-32) * char_width
chY = char_starty + line * char_height chY, chX = (pos / stringsize) * char_height + 64, pos % stringsize
break
if chX is None:
raise ValueError, "Unsupported char: '%s'" % ch
targX = x + xOffset targX = x + xOffset
targY = y + yOffset targY = y + yOffset
if targX + char_width > width - xOffset or targY + char_height > height - yOffset\
or targX < 0 or targY < 0:
raise ValueError, "Out of bounds. %s %s %s %s" % (
targX + char_width > width - xOffset,
targY + char_height > height - yOffset,
targX < 0,
targY < 0)
pywmgeneral.copyXPMArea(chX, chY, char_width, char_height, targX, targY) pywmgeneral.copyXPMArea(chX, chY, char_width, char_height, targX, targY)
return (char_width, char_height) return (char_width, char_height)
@@ -158,16 +153,78 @@ def setColor(xpm, name, newColor):
xpm[index] = '%s\tc %s s %s' % (letter, color, comment) xpm[index] = '%s\tc %s s %s' % (letter, color, comment)
index += 1 index += 1
def setDefaultPixmap(xpm): def initPixmap(xpm_background=None,
"""Set the pixmap of the program. font_name='6x8',
bg='0', fg='7',
width=64, height=64,
palette=None):
"""builds and sets the pixmap of the program.
xpm is an XPM represented as a list of strings, possible gotten a wmdockapp has a 128x112 pixmap
from readXPM(). This is what we use all the time later. The XBM
mask is created out of the XPM. If I understand correctly how it the 64x64 upper left area is the work area in which we put what we want
works we use the upper left rectangle as mask. This is the to be displayed.
simplest way to do it and is the desired behaviour in most cases.
the 64x64 upper right area contains the pattern for blanking the area.
this is initialized using the xpm_background parameter. xpm_background
must contain a list of 64 strings of length 64.
the remaining lower area defines the character set. this is initialized
using the corresponding named character set. a file with this name must
be found somewhere in the path.
xpm_background and the font must share the same palette. the font must
be black/white.
The XBM mask is created out of the XPM.
""" """
if xpm_background is None:
xpm_background = [bg*width]*height
if palette is None:
palette = {
0: ('#000000','black'),
1: ('#000080','blue'),
2: ('#008080','cyan'),
3: ('#008000','green'),
4: ('#808000','yellow'),
5: ('#800000','red'),
6: ('#800080','purple'),
7: ('#c0c0c0','light_gray'),
8: ('#808080','dark_gray'),
9: ('#0000ff','light_blue'),
10: ('#00ffff','light_cyan'),
11: ('#00ff00','light_green'),
12: ('#ffff00','light_yellow'),
13: ('#ff0000','light_red'),
14: ('#ff00ff','light_purple'),
15: ('#ffffff','white'),
}
global char_width, char_height, char_map
global tile_width, tile_height
char_width = char_defs[font_name]['width']
char_height = char_defs[font_name]['height']
char_map = char_defs[font_name]['map']
tile_width = width
tile_height = height
xpm = [
'128 112 %d 1' % len(palette),
] + [
'%x\tc %s s %s' % (k, v[0], v[-1])
for k,v in palette.items()
] + [
bg*64 + item for item in xpm_background
] + [
line.replace('%', fg).replace(' ', bg)
for line in char_map
]
pywmgeneral.includePixmap(xpm) pywmgeneral.includePixmap(xpm)
return char_width, char_height
def openXwindow(argv, w, h): def openXwindow(argv, w, h):
"""Open the X window of given width and height. """Open the X window of given width and height.
@@ -242,52 +299,176 @@ def getColorCode(colorName, rgbFileName):
return rgbstr return rgbstr
return None return None
char_list = [ char_defs = {
'0123456789:/-%. ', '5x7': {
'abcdefghijklmnopqrstuvwxyz', 'width': 5,
'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'height': 7,
] 'map': [
" % % % % % % % % % %% %%%% % %%%% %% %%%% %% ",
" % % % % % %%% % % % % % % % % % % % % %% % % % %% % % % % % ",
" % % % %%%%%% % % % % % % % % % % % % % % %% % % %%% %%% % %% ",
" % % % %%% % % % % %%% %%%%% %%%% % % % % % % %%%% % % % % % % ",
" %%%%% % %% % % % % % % % %% %% % % % % % % % % % % % % % % % ",
" % % % %%% % % % % % % % % % %% % %%% %%%% %% % %% %% % %% ",
" % ",
" %% % %% %% %%% %% %%% %%%% %%%% %% % % %%% % % % % % % % % %% %%% %% ",
"% % %% %% % % % % % % % % % % % % % % % % % % % % % % % % % %%%% %% % % % % % % % ",
"% % %% %% % %%%% % % % %% % % %%% % % % %%% %%% % %%%% % % %% % %%%% %% % % % % % % % ",
" %%% % % % % %% %%%% % % % % % % % % %% % % % % %% % % % % %% % % %%% % % ",
" % %% %% % %%%% % % % % % % % % % % % % % % % % % % % % % % % % % %% % % % %% % ",
" %% %% % % % % %% % % %%% %% %%% %%%% % %%% % % %%% %% % % %%%% % % % % %% % %% ",
" % % ",
"%%% %% %%% % % % % % % % % % % %%%% %%% %%% % % % % % % % % ",
"% % % % % % % % % % % % % % % % % % % % % % % % % % % ",
"% % % % % % % % % % %% % % % % % % %%% %%% %% %%% %% % %%% %%% %% % ",
"%%% % % % % % % %%%% %% % % % % % % % % % % % % % %% %%% % % % % % % ",
"% % % % % % % %% %%%% % % % % % % % % %% % % % % % %% % %% % % % % ",
"% % %% % %% %% % % % % % %%%% %%% %%% %%%% % % %%% %% %%% %% % % % % %%% % % ",
" %%% % ",
"% %% % % % % % % ",
"% % % % % % % % % % % ",
"% % % % % %%% %% %%% %%% %%% %%% %%% % % % % % % % % % % %%%% %% % %% ",
"%% % %%%% % % % % % % % % % % %% % % % % % % % %% % % % % % % % % ",
"% % % % % % % % % % % % % % %% % % % % % %%%% %% % % % % % % ",
"% % %%% % % % % %% %%% %%% % %%% %% %%% % %%%% % % % %%%% % % % % % % ",
" % % % ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
]
},
'6x8': {
'width': 6,
'height': 8,
'map': [
" % % % % % % % % %% % % % %%% % %%% %%% % ",
" % % % % % %%%% % % % % % % % % % % % % %% % % % % %% ",
" % % % %%%%% % % %% % % % % % % % % %% % % % % % ",
" % % % %%% % % % % %%%%% %%%%% %%%%% % % % % % %% %% % % ",
" %%%%% % % % % % % % % % % % %% % % % % %%%%% ",
" % % %%%% % % % % % % % % % % %% % % % % % % % % ",
" % % % % % % %% % % % % %% % %%% %%% %%%%% %%% % ",
" % ",
"%%%%% %%% %%%%% %%% %%% %% %% %%% %%% % %%%% %%% %%% %%%%% %%%%% %%% % % %%% ",
"% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ",
"%%%% % % % % % % % % % %%%%% % % % %%% % % % % % % % % % % % % % ",
" % %%%% % %%% %%%% % % % % % % %%%%% %%%% % % % %%%% %%% % %% %%%%% % ",
" % % % % % % % % %%%%% % % % %%% % % % % % % % % % % % % % % ",
"% % % % % % % % % % % % % % % % % % % % % % % % % % % % % ",
" %%% %%% % %%% %%% % %% %% % %%% % % %%%% %%% %%% %%%%% % %%% % % %%% ",
" % ",
" %%% % % % % % % % %%% %%%% %%% %%%% %%% %%%%% % % % % % % % % % % %%%%% %%% %%% % ",
" % % % % %% %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % ",
" % % % % % % % %% % % % % % % % % % % % % % % % % % % % % % % % % % % % ",
" % %% % % % % % % % % %%%% % % %%%% %%% % % % % % % % % % % % % % % ",
" % % % % % % % %% % % % % % % % % % % % % % % % % % % % % % % % ",
"% % % % % % % % % % % % %%% % % % % % % % % % %% %% % % % % % % % ",
" %% % % %%%%% % % % % %%% % %% % % %%% % %%% % % % % % % %%%%% %%% % %%% ",
" ",
" % % % %% % % % %% ",
" % % % % % % % ",
" % %%% % %%%% % %%% % %%%% % %% %% % % %% % %%%% %%% %%%% %%%% %%%% %%%% ",
" % %%%% % %%%% % % %%%% % % %%%% % % % %% % % % % % % % % % % % % % % % ",
" %%%% % % % % % %%%%% % % % % % % % %% % % % % % % % % % % % % % %%% ",
" % % % % % % % % % %%%% % % % % % % % % % % % % % % %%%% %%%% % % ",
" %%%% %%%% %%%% %%%% %%% % % % % %%% % % %% %%% % % % % % %%% % % % %%%% ",
"%%%%% %%%% %%% % % ",
" %%% % %%% ",
" % % % % ",
"%%%%% % % % % % % % % % % %%%%% % % % ",
" % % % % % % % % % % % % % % % % %% % ",
" % % % % % % % % % % % % % % % % %% ",
" % % % % % % % % % % %%%% % % % % ",
" %% %%%% % % % % % % %%%%% %%% % %%% ",
" %%% ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
]
},
'8x8': {
'width': 8,
'height': 8,
'map': [
" %% %% %% %% %% %% %% % %%%% %% %% %% ",
" %% %% %% %% %% %%%%% %% %% %% %% %% %% %% %% %% %% %%",
" %% %% %% %%%%%%%% %% %% %%%% %% %% %% %%%% %% %% ",
" %% %% %% %%%% %% %%% %% %% %%%%%%%% %%%%%% %%%%%% %% ",
" %%%%%%%% %% %% %% %%% %% %% %%%% %% %% ",
" %% %% %%%%% %% %% %% %% %% %% %% %% %% %% %% %% ",
" %% %% %% %% % %% %%%%%% %% %% %% %% %% ",
" %% ",
" %%%% %% %%%% %%%% %% %%%%%% %%%% %%%%%% %%%% %%%% %%% %%% %%%% ",
" %% %% %% %% %% %% %% %%% %% %% %% %% %% %% %% %% %% %% %% %% %% ",
" %% %%% %%% %% %% %%%% %%%%% %% %% %% %% %% %% %% %% %% %%%%%% %% %% ",
" %%% %% %% %% %%% %% %% %% %%%%% %% %%%% %%%%% %% %% %% ",
" %% %% %% %% %% %%%%%%% %% %% %% %% %% %% %% %% %%%%%% %% %% ",
" %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% ",
" %%%% %%%%%% %%%%%% %%%% %% %%%% %%%% %% %%%% %%%% %% %%% %%% %% ",
" %% ",
" %%%% %% %%%%% %%%% %%%% %%%%%% %%%%%% %%%% %% %% %%%% %%%% %% %% %% %% %% %% %% %%%% ",
" %% %% %%%% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %%% %%% %%% %% %% %% ",
" %% %%% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %%%% %% %%%%%%% %%%%%% %% %% ",
" %% %%% %%%%%% %%%%% %% %% %% %%%% %%%% %% %%% %%%%%% %% %% %%% %% %% % %% %%%%%% %% %% ",
" %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %%%% %% %% %% %% %%% %% %% ",
" %% % %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% ",
" %%%% %% %% %%%%% %%%% %%%% %%%%%% %% %%%% %% %% %%%% %%% %% %% %%%%%% %% %% %% %% %%%% ",
" ",
" %%%%% %%%% %%%%% %%%% %%%%%% %% %% %% %% %% %% %% %% %% %% %%%%%% %%% %%% ",
" %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% ",
" %% %% %% %% %% %% %% %% %% %% %% %% %% %% %%%% %% %% %% %% %% %% ",
" %%%%% %% %% %%%%% %%%% %% %% %% %% %% %% % %% %% %%%% %% %% %% %% %%% %% ",
" %% %% %% %%%% %% %% %% %% %% %% %%%%%%% %%%% %% %% %% %% %% %% %%% ",
" %% %%%% %% %% %% %% %% %% %% %%%% %%% %%% %% %% %% %% %% %% %% ",
" %% %%% %% %% %%%% %% %%%% %% %% %% %% %% %% %%%%%% %%% %% %%% ",
" ",
" %% ",
" %% %% %% %%% %% %% %% %% %%% ",
" %% %%%% %% %%%% %% %%%% %% %%%%% %% %% %% %% %% %%%%% %%%% ",
" %% %%%%% %% %%%%% %% %% %%%%% %% %% %%%%% %%% %% %% %% %% %%%%%%% %% %% %% %% ",
" %%%%% %% %% %% %% %% %%%%%% %% %% %% %% %% %% %% %%%% %% %%%%%%% %% %% %% %% ",
" %% %% %% %% %% %% %% %% %% %%%%% %% %% %% %% %% %% %% %% % %% %% %% %% %% ",
" %%%%% %%%%% %%%% %%%%% %%%% %% %% %% %% %%%% %% %% %% %%%% %% %% %% %% %%%% ",
" %%%%% %%%% ",
" %%%% %%%% ",
" %% %% %% %% %% ",
" %%%%% %%%%% %%%%% %%%%% %%%%%% %% %% %% %% %% %% %% %% %% %% %%%%%% %% %% %% %%%% ",
" %% %% %% %% %% %% %% %% %% %% %% %% %% % %% %%%% %% %% %% %% %% %% %% %% ",
" %% %% %% %% %% %%%% %% %% %% %% %% %%%%%%% %% %% %% %% %% %% %% ",
" %%%%% %%%%% %% %% %% %% %% %%%% %%%%% %%%% %%%%% %% %% %% %% ",
" %% %% %% %%%%% %%% %%%%% %% %% %% %% %% %% %%%%%% %%%% %% %%%% %%%%%%%%",
" %% %% %%%% ",
]
},
}
char_startx = 0 default_xpm_header = [
char_starty = 64 '128 112 4 1',
char_width = 6 '_\tc #7f260a',
char_height = 9 ' \tc #000000 s background',
'/\tc #2020b2 s graph',
'%\tc #2081B2 s text',
]
char_map = [
'____________________________________________________________________________________________________________________________________............................',
'__%%%____%____%%%___%%%_____%__%%%%%__%%%__%%%%%__%%%___%%%___________%________%%__%________________________________________________............................',
'_%___%__%%___%___%_%___%___%%__%_____%___%_%___%_%___%_%___%__%%______%________%%_%%________________________________________________............................',
'_%___%___%_______%_____%__%_%__%%%%__%________%__%___%_%___%__%%_____%%__________%%_________________________________________________............................',
'_%___%___%______%____%%__%__%______%_%%%%____%____%%%___%%%%_________%___%%%%%___%__________________________________________________............................',
'_%___%___%_____%_______%_%%%%%_____%_%___%___%___%___%_____%________%%__________%%__________________________________________________............................',
'_%___%___%____%____%___%____%__%___%_%___%___%___%___%_%___%__%%____%__________%%_%%__%%____________________________________________............................',
'__%%%___%%%__%%%%%__%%%_____%___%%%___%%%____%____%%%___%%%___%%____%__________%__%%__%%____________________________________________............................',
'____________________________________________________________________________________________________________________________________............................',
'________________________________________________________________________________________________________________________________________________________________',
'_______%______________%__________%%________%______%_______%__%______%___________________________________________________________________________________________',
'_______%______________%_________%__________%_________________%______%_______________________________________________%___________________________________________',
'__%%___%%%____%%____%%%___%%____%_____%%%__%%%____%_______%__%__%___%____%%_%__%%%____%%___%%%____%%%__%%%____%%%__%%%___%__%__%__%__%___%_%___%_%__%__%%%%%____',
'____%__%__%__%_____%__%__%__%___%%___%__%__%__%___%_______%__%_%____%____%_%_%_%__%__%__%__%__%__%__%__%__%__%______%____%__%__%__%__%_%_%__%_%__%__%_____%_____',
'__%%%__%__%__%_____%__%__%%%%___%____%__%__%__%___%_______%__%%_____%____%_%_%_%__%__%__%__%__%__%__%__%______%%____%____%__%__%__%__%_%_%___%___%__%____%______',
'_%__%__%__%__%_____%__%__%______%_____%%%__%__%___%_______%__%_%____%____%_%_%_%__%__%__%__%%%____%%%__%________%___%____%__%___%%___%_%_%__%_%___%%%___%_______',
'__%%%__%%%____%%____%%%___%%____%_______%__%__%___%_______%__%__%___%____%_%_%_%__%___%%___%________%__%_____%%%_____%%___%%%___%%____%_%__%___%___%___%%%%%____',
'_____________________________________%%%________________%%_________________________________%________%____________________________________________%%_____________',
'____________________________________________________________________________________________________________________________________............................',
'___%___%%%%___%%%__%%%%__%%%%%_%%%%%__%%%__%___%__%%%____%%%_%___%_%_____%___%_%___%__%%%__%%%%___%%%__%%%%___%%%__%%%%%_%___%_%___%_%___%_%___%_%___%_%%%%%____',
'__%_%__%___%_%___%_%___%_%_____%_____%___%_%___%___%______%__%__%__%_____%%_%%_%%__%_%___%_%___%_%___%_%___%_%___%___%___%___%_%___%_%___%_%___%_%___%_____%____',
'_%___%_%___%_%_____%___%_%_____%_____%_____%___%___%______%__%_%___%_____%_%_%_%%%_%_%___%_%___%_%___%_%___%_%_______%___%___%_%___%_%___%__%_%__%___%____%_____',
'_%___%_%%%%__%_____%___%_%%%___%%%___%__%%_%%%%%___%______%__%%____%_____%_%_%_%_%%%_%___%_%%%%__%___%_%%%%___%%%____%___%___%_%___%_%_%_%___%____%_%____%______',
'_%%%%%_%___%_%_____%___%_%_____%_____%___%_%___%___%______%__%_%___%_____%___%_%__%%_%___%_%_____%_%_%_%_%_______%___%___%___%_%___%_%_%_%__%_%____%____%_______',
'_%___%_%___%_%___%_%___%_%_____%_____%___%_%___%___%___%__%__%__%__%_____%___%_%___%_%___%_%_____%__%__%__%__%___%___%___%___%__%_%__%%_%%_%___%___%___%________',
'_%___%_%%%%___%%%__%%%%__%%%%%_%______%%%__%___%__%%%___%%___%___%_%%%%%_%___%_%___%__%%%__%______%%_%_%___%__%%%____%____%%%____%___%___%_%___%___%___%%%%%____',
'________________________________________________________________________________________________________________________________________________________________',
'________________________________________________________________________________________________________________________________________________________________',
'________________________________________________________________________________________________________________________________________________________________',
'____________________________________________________________________________________________________________________________________............................',
'................................................................................................................................................................',
'................................................................................................................................................................',
'................................................................................................................................................................',
'................................................................................................................................................................',
'................................................................................................................................................................',
'................................................................................................................................................................',
]