mirror of
https://github.com/rvtr/TwlIPL.git
synced 2025-10-31 06:01:12 -04:00
初版
git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@2305 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
parent
d1e27c56a4
commit
591c0b6568
211
build/tools/iconMaker/TwlIcon.rb
Executable file
211
build/tools/iconMaker/TwlIcon.rb
Executable file
@ -0,0 +1,211 @@
|
||||
require 'bmp.rb'
|
||||
|
||||
# フォントテーブルを用いて、文字列から32*32のアイコンbmpを出力するスクリプト
|
||||
# 入力は文字列か、それを格納したテキストファイルから行う
|
||||
# BLACK//WHITE//0A01//test//tools とかそんな感じになるかなー
|
||||
|
||||
class TwlIcon < BitMap
|
||||
|
||||
# ファイルサイズ
|
||||
SIZE_X = 32
|
||||
SIZE_Y = 32
|
||||
|
||||
# フォント幅の定義
|
||||
FONT_HEIGHT = 9
|
||||
|
||||
FONT_KIND = 3
|
||||
|
||||
FONTWIDTH = [
|
||||
# FONTWIDTH_LOWERCASE
|
||||
# a b c d e f g h i j k l m n
|
||||
[ 4, 4, 4, 4, 4, 3, 4, 4, 1, 3, 3, 3, 5, 4,
|
||||
# o p q r s t u v w x y z
|
||||
4, 4, 4, 3, 4, 3, 4, 5, 5, 5, 5, 4 ],
|
||||
|
||||
# FONTWIDTH_UPPERCASE
|
||||
# a b c d e f g h i j k l m n
|
||||
[ 5, 4, 5, 5, 4, 4, 5, 4, 3, 5, 4, 4, 5, 5,
|
||||
# o p q r s t u v w x y z
|
||||
5, 4, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5 ],
|
||||
|
||||
# FONTWIDTH_NUMERIC
|
||||
# 0 1 2 3 4 5 6 7 8 9
|
||||
[ 5, 3, 4, 4, 5, 4, 5, 5, 5, 5 ]
|
||||
]
|
||||
|
||||
|
||||
def initialize( fg = 0x0, bg = 0xf )
|
||||
super( SIZE_X, SIZE_Y )
|
||||
clear( 0xF )
|
||||
@str = [ "", "", "" ]
|
||||
@fgColor = fg
|
||||
@bgColor = bg
|
||||
end
|
||||
|
||||
def setColor( fgColor, bgColor )
|
||||
@fgColor = fgColor
|
||||
@bgColor = bgColor
|
||||
end
|
||||
|
||||
def setFg( clr )
|
||||
@fgColor = clr
|
||||
end
|
||||
|
||||
def setBg( clr )
|
||||
@bgColor = clr
|
||||
end
|
||||
|
||||
def setFilename( name )
|
||||
@filename = name
|
||||
end
|
||||
|
||||
attr_accessor :filename
|
||||
|
||||
def setString( line, str )
|
||||
@str[line] = str
|
||||
end
|
||||
|
||||
def write( filename )
|
||||
|
||||
retFlag = true
|
||||
|
||||
for i in 0..2
|
||||
putStr( self, @@fontbmp, @str[i], 1, ( FONT_HEIGHT + 1 ) * i + 2 )
|
||||
retFlag = false if getWidthS(@str[i]) >= SIZE_X
|
||||
end
|
||||
|
||||
self.changeColor( @bgColor, @fgColor )
|
||||
super( filename )
|
||||
|
||||
return retFlag
|
||||
end
|
||||
|
||||
|
||||
# 初期化作業
|
||||
# 基本的に呼ばれないと死ぬ
|
||||
# フォントデータのインデクスを作ったりする
|
||||
def TwlIcon.init
|
||||
@@fontbmp = BitMap.read( "./font.bmp" )
|
||||
|
||||
sFontinfo = Struct.new(:width, :index)
|
||||
sFont = Struct.new(:lowercase, :uppercase, :numeric)
|
||||
|
||||
@@fonts = sFont.new
|
||||
for fontidx in 0...FONT_KIND
|
||||
# フォント幅を元に、ファイル内でのインデクスデータを作っていく
|
||||
indexlist = [0]
|
||||
sum = 0
|
||||
|
||||
for charidx in 0...FONTWIDTH[fontidx].size do
|
||||
sum += FONTWIDTH[fontidx][charidx] + 1
|
||||
indexlist.push sum
|
||||
end
|
||||
|
||||
obj = sFontinfo.new( FONTWIDTH[fontidx], indexlist )
|
||||
@@fonts[fontidx] = obj
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# 受け取った文字列strのピクセル幅を計算する
|
||||
def getWidthS( str )
|
||||
width = 0
|
||||
|
||||
str.each_byte do |c|
|
||||
# 文字間に1ピクセルスペースが入る
|
||||
width += 1 + getWidthC(c)
|
||||
end
|
||||
|
||||
# 最後の一文字のあとのスペースは不要
|
||||
width -= 1
|
||||
end
|
||||
|
||||
# 受け取った文字のピクセル幅をテーブルから呼んで返す
|
||||
def getWidthC(char)
|
||||
|
||||
case char
|
||||
when ?a..?z
|
||||
return @@fonts.lowercase.width[ char - ?a ]
|
||||
when ?A..?Z
|
||||
# 今は小文字で統一
|
||||
return @@fonts.uppercase.width[ char - ?A ]
|
||||
when ?0..?9
|
||||
return @@fonts.numeric.width[ char - ?0 ]
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
# 受け取った文字のフォントbmpにおけるX座標インデクスデータを返す
|
||||
def getIndexX(char)
|
||||
case char
|
||||
when ?a..?z
|
||||
return @@fonts.lowercase.index[ char - ?a ]
|
||||
when ?A..?Z
|
||||
return @@fonts.uppercase.index[ char - ?A ]
|
||||
when ?0..?9
|
||||
return @@fonts.numeric.index[ char - ?0 ]
|
||||
end
|
||||
end
|
||||
|
||||
# 受け取った文字のフォントbmpにおけるX座標インデクスデータを返す
|
||||
def getIndexY(char)
|
||||
case char
|
||||
when ?a..?z
|
||||
return 0
|
||||
when ?A..?Z
|
||||
return (FONT_HEIGHT + 1) * 2
|
||||
when ?0..?9
|
||||
return FONT_HEIGHT + 1
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# フォントbmpから抽出した文字列を今のバッファに埋め込む
|
||||
# image:埋め込み対象 fontimage:フォント画像 str:文字列 x,y:座標
|
||||
def putStr( image, fontimage, str, x, y )
|
||||
|
||||
#p "inserting #{str}"
|
||||
str.each_byte do |c|
|
||||
putChar( image, fontimage, c, x, y )
|
||||
x += 1 + getWidthC(c)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# フォントbmpの対象文字を今のバッファに埋め込む
|
||||
def putChar( image, fontimage, char, x, y )
|
||||
|
||||
#p "index of '#{char.chr}' : #{getIndexX(char)} #{getIndexY(char)} , x:#{x} y:#{y}"
|
||||
|
||||
charimg = fontimage.clip( getIndexX(char), getIndexY(char), getIndexX(char) + getWidthC(char)-1, getIndexY(char) + FONT_HEIGHT-1 )
|
||||
image.paste( charimg, x, y )
|
||||
|
||||
end
|
||||
|
||||
# バッファの中の白い部分を背景色、黒い部分を文字色で塗りつぶす
|
||||
# 4bitColorBMP仕様になったので未使用
|
||||
def changeColor( bgColor, fgColor )
|
||||
|
||||
(0...@buf_size).each do |idx|
|
||||
head = @buf[idx] >> 4
|
||||
foot = @buf[idx] & 0x0f
|
||||
|
||||
if head == 0xf then
|
||||
head = bgColor
|
||||
elsif head == 0x0
|
||||
head = fgColor
|
||||
end
|
||||
|
||||
if foot == 0xf then
|
||||
foot = bgColor
|
||||
elsif foot == 0x0
|
||||
foot = fgColor
|
||||
end
|
||||
|
||||
@buf[idx] = (head << 4) | foot
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
TwlIcon.init
|
||||
113
build/tools/iconMaker/about.txt
Normal file
113
build/tools/iconMaker/about.txt
Normal file
@ -0,0 +1,113 @@
|
||||
テキストからちょっとしたアイコン用bmpを作るだけの簡単なスクリプトです。
|
||||
|
||||
=========================================================
|
||||
|
||||
1. はじめに
|
||||
|
||||
|
||||
rubyが必要になるのでcygwinを使うなり、windows版を入れるなりしてください。
|
||||
|
||||
あとはターミナルから
|
||||
|
||||
% ruby iconMaker.rb Itest/Idesu/Iyooo
|
||||
|
||||
などと入力することでアイコン用のbmpが生成されます。
|
||||
与える引数の詳細については以下を参照してください。
|
||||
|
||||
|
||||
=========================================================
|
||||
|
||||
2. 入力方式とか仕様とか
|
||||
|
||||
アイコンは32*32ピクセルで構成され、フォントが縦幅9ピクセルなので
|
||||
3行までテキストを入力することができます。
|
||||
各行のテキストや色指定は全て'/'区切りにされた引数で行い、
|
||||
一つの出力ファイルに対して一続きの文字列が対応しています。
|
||||
引数がスペースで区切られた場合は、その数だけ出力ファイルを指定しているとみなします。
|
||||
|
||||
|
||||
・'I' (input text) アイコンに描画するテキストの文字列
|
||||
|
||||
このコマンドは3回まで繰り返すことができ、
|
||||
1回目は1行目のテキスト、2回目は2行目のテキスト、3回目は3行目のテキストを指定することになります。
|
||||
"Iaaaa/I/Ibbbb"という入力を与えた場合、2行目は空行と見なされます。
|
||||
|
||||
・'F' (foreground color) 文字列の色指定
|
||||
・'B' (background color) 背景の色指定
|
||||
|
||||
それぞれの色を指定します。
|
||||
以下の表における整数のidx値か、nameを指定してください。
|
||||
該当しない値が渡された場合、入力は無視されます。
|
||||
|
||||
idx r g b name
|
||||
0 0 0 0 black
|
||||
1 80 0 0 maroon
|
||||
2 0 80 0 green
|
||||
3 80 80 0 olive
|
||||
4 0 0 80 navy
|
||||
5 80 0 80 purple
|
||||
6 0 80 80 teal
|
||||
7 80 80 80 gray
|
||||
8 c0 c0 c0 lightgray
|
||||
9 ff 0 0 red
|
||||
10 0 ff 0 lime
|
||||
11 ff ff 0 yellow
|
||||
12 0 0 ff blue
|
||||
13 ff 0 ff fuchsia
|
||||
14 0 ff ff aqua
|
||||
15 ff ff ff white
|
||||
|
||||
利用形態を考えた結果、一度色指定を行ってからは、次に他の色指定が行われるまで
|
||||
次以降のファイルに対しても同じ色指定を適用し続けます。
|
||||
"Fpurple/Ithis/Iis/Ipurple Ithis/Iis/Idefault"という入力を与えると、
|
||||
二つのファイルは両方とも紫色の文字で出力されます。
|
||||
|
||||
|
||||
・'O' (output file) 出力ファイル名の指定
|
||||
|
||||
そのまんまです。
|
||||
指定しなかった場合はtest**.txtという形で出力されます。
|
||||
|
||||
|
||||
出力ファイル数が大きくなる場合は、テキストファイルから引数を与えることもできます。
|
||||
|
||||
## input.txt #############
|
||||
/O0NRA.bmp/INand/IInit/IRed
|
||||
/O0NPA.bmp/INand/IInit/IProd
|
||||
/O0NIA.bmp/INand/IInitilize
|
||||
/O0HWA.bmp/I0HWA/IHWInfo/Iwriter
|
||||
##########################
|
||||
|
||||
みたいなファイルを用意して
|
||||
|
||||
% ruby iconMaker.rb input.txt
|
||||
|
||||
とすれば良いですが、ファイルによる入力かどうかは引数の末尾が"*.txt"かどうかで判別しています。
|
||||
"Ifile/Iis/Ia.txt" みたいな入力を与えるとファイルからの入力扱いをされてハマります。
|
||||
|
||||
|
||||
横幅については文字ごとにまちまちなので、そのつど確認してください。
|
||||
仮に横幅をオーバーしたとしても、エラーを吐かずにはみ出た部分は切り捨てられますが、
|
||||
将来的には文字幅が溢れている場合、warning的なものを出す予定です。
|
||||
→ 出るようになりました
|
||||
|
||||
|
||||
=========================================================
|
||||
|
||||
TODO
|
||||
|
||||
・記号への対応
|
||||
|
||||
# 08/08/18
|
||||
・アルファベット大文字に対応
|
||||
・横幅がオーバーしていたときに警告を出力
|
||||
|
||||
# 08/08/13
|
||||
・引数指定のフォーマットを変更
|
||||
・色指定に対応
|
||||
・数字入力に対応
|
||||
・ファイルからの入力に対応
|
||||
|
||||
# 08/08/07
|
||||
|
||||
・初版
|
||||
196
build/tools/iconMaker/bmp.rb
Executable file
196
build/tools/iconMaker/bmp.rb
Executable file
@ -0,0 +1,196 @@
|
||||
# ruby用bmp操作ライブラリ
|
||||
# パレットはwindows標準の固定16色に決め打ち
|
||||
# 出力するときはTwlIconクラスのfgColorとbgColorで該当パレットを置換する
|
||||
|
||||
class BitMap
|
||||
PALETTE_SIZE = 16*4
|
||||
|
||||
def initialize(width, height, dpi = 96)
|
||||
@width = width
|
||||
@height = height
|
||||
@line_size = (width + (8 - width % 8 ) % 8) / 2
|
||||
@buf_size = @line_size * height
|
||||
@buf = [ 0x00 ] * @buf_size
|
||||
@bit_count = 4
|
||||
@compression = 0 # 圧縮無し
|
||||
@size_image = 0
|
||||
@x_pix_per_meter = 0
|
||||
@y_pix_per_meter = 0
|
||||
@clr_used = 16
|
||||
@cir_important = 0
|
||||
@palette_size = (2**@bit_count) * 4
|
||||
@palette = "\x00\x00\x00\x00\x00\x00\x80\x00\x00\x80\x00\x00\x00\x80\x80\x00" +
|
||||
"\x80\x00\x00\x00\x80\x00\x80\x00\x80\x80\x00\x00\x80\x80\x80\x00" +
|
||||
"\xC0\xC0\xC0\x00\x00\x00\xFF\x00\x00\xFF\x00\x00\x00\xFF\xFF\x00" +
|
||||
"\xFF\x00\x00\x00\xFF\x00\xFF\x00\xFF\xFF\x00\x00\xFF\xFF\xFF\x00"
|
||||
|
||||
#puts "Initialize..."
|
||||
#p "width :#{@width} line_size :#{@line_size}"
|
||||
end
|
||||
|
||||
def clear( clrIdx = 15 )
|
||||
@buf = [ (clrIdx << 4) + clrIdx ] * @height * @line_size
|
||||
end
|
||||
|
||||
attr_writer :buf
|
||||
attr_reader :width, :height
|
||||
|
||||
# BMPファイルを出力する
|
||||
def write(filename)
|
||||
file_size = 14 + 40 + @palette_size + @buf_size
|
||||
palette_offset = 14 + 40
|
||||
data_offset = palette_offset + @palette_size
|
||||
|
||||
open(filename, "wb") do |f|
|
||||
f.print 'BM'
|
||||
f.print [file_size, 0, data_offset].pack("l*")
|
||||
f.print [40, @width, @height].pack("l*")
|
||||
f.print [1, @bit_count].pack("S*")
|
||||
f.print [@compression, @size_image,
|
||||
@x_pix_per_meter, @y_pix_per_meter,
|
||||
@clr_used, @cir_important].pack("l*")
|
||||
f.print @palette
|
||||
f.print @buf.pack("c*")
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
# BMPファイルを読み込む
|
||||
def BitMap.read(filename)
|
||||
buf = nil
|
||||
open(filename, "rb") do |f|
|
||||
buf = f.read
|
||||
end
|
||||
|
||||
if buf[0] != ?B or buf[1] != ?M
|
||||
raise('[Error] read: Invalid Header')
|
||||
end
|
||||
real_buf_size = buf.size
|
||||
buf_size = (buf[2, 4].unpack("l*"))[0]
|
||||
if buf_size > real_buf_size
|
||||
raise('[Error] read: Invalid Buffer Size')
|
||||
end
|
||||
data_offset = (buf[10, 4].unpack("l*"))[0]
|
||||
if data_offset != 54 + PALETTE_SIZE
|
||||
raise('[Error] read: Invalid Data Offset')
|
||||
end
|
||||
|
||||
width = (buf[18, 4].unpack("l*"))[0]
|
||||
height = (buf[22, 4].unpack("l*"))[0]
|
||||
|
||||
bit_count = (buf[28, 2].unpack("s*"))[0]
|
||||
if bit_count != 4
|
||||
raise('[Error] read: Unsupported Color Depth')
|
||||
end
|
||||
|
||||
compression = (buf[30, 4].unpack("l*"))[0]
|
||||
if compression != 0
|
||||
raise('[Error] read: Compression Not Supported')
|
||||
end
|
||||
|
||||
pix_per_meter = (buf[38, 4].unpack("l*"))[0]
|
||||
dpi = pix_per_meter / 39.375
|
||||
|
||||
image_buf = buf[54 + PALETTE_SIZE, buf_size].unpack("C*")
|
||||
image = BitMap.new(width, height, dpi)
|
||||
image.buf = image_buf
|
||||
return image
|
||||
end
|
||||
|
||||
|
||||
# (x1, y1) - (x2, y2)の部分画像を取り出す
|
||||
def clip(x1, y1, x2, y2)
|
||||
return if x1 > x2
|
||||
return if y1 > y2
|
||||
return if x2 < 0
|
||||
return if y2 < 0
|
||||
return if x1 >= @width
|
||||
return if y1 >= @height
|
||||
x1 = 0 if x1 < 0
|
||||
y1 = 0 if y1 < 0
|
||||
x2 = @width - 1 if x2 >= @width
|
||||
y2 = @height - 1 if y2 >= @height
|
||||
|
||||
clip_width = x2 - x1 + 1
|
||||
clip_height = y2 - y1 + 1
|
||||
|
||||
clip_image = BitMap.new(clip_width, clip_height, self.get_dpi)
|
||||
|
||||
for y in 0 .. (clip_height - 1)
|
||||
for x in 0 .. (clip_width - 1)
|
||||
color = self.pget(x1 + x, y1 + y)
|
||||
clip_image.pset(x, y, color)
|
||||
end
|
||||
end
|
||||
|
||||
return clip_image
|
||||
end
|
||||
|
||||
|
||||
# x, y, r, g, b は整数であることを期待している
|
||||
def pset(x, y, clr)
|
||||
return if x < 0 or @width <= x
|
||||
return if y < 0 or @height <= y
|
||||
clr = 0 if clr < 0
|
||||
clr = 15 if clr > 15
|
||||
|
||||
nowClr = @buf[(@height - 1 - y) * @line_size + x / 2]
|
||||
|
||||
if x%2 == 0 then
|
||||
nowClr = (nowClr & 0x0F) + (clr << 4)
|
||||
else
|
||||
nowClr = (nowClr & 0xF0) + clr
|
||||
end
|
||||
|
||||
@buf[(@height - 1 - y) * @line_size + x / 2] = nowClr
|
||||
|
||||
end
|
||||
|
||||
# x, yは整数であることを期待している
|
||||
# 戻り値はパレットのインデクス整数値
|
||||
def pget(x, y)
|
||||
x = 0 if x < 0
|
||||
x = @width - 1 if x >= @width
|
||||
y = 0 if y < 0
|
||||
y = @height - 1 if y >= @height
|
||||
|
||||
addr = (@height - 1 - y) * @line_size + x / 2
|
||||
|
||||
if x%2 == 0 then
|
||||
retValue = @buf[addr] >> 4
|
||||
else
|
||||
retValue = @buf[addr] & 0x0F
|
||||
end
|
||||
|
||||
return retValue
|
||||
|
||||
end
|
||||
|
||||
def get_dpi()
|
||||
return (@x_pix_per_meter / 39.375).round
|
||||
end
|
||||
|
||||
def set_dpi(dpi)
|
||||
@x_pix_per_meter = (39.375 * dpi).round
|
||||
@y_pix_per_meter = @x_pix_per_meter
|
||||
end
|
||||
|
||||
# x0, y0 は、貼り付ける始点(左上)の座標
|
||||
def paste(image, x0 = 0, y0 = 0)
|
||||
return if image == nil
|
||||
|
||||
image.height.times do |from_y|
|
||||
y = y0 + from_y
|
||||
next if y < 0 or @height <= y
|
||||
|
||||
image.width.times do |from_x|
|
||||
x = x0 + from_x
|
||||
next if x < 0 or @width <= x
|
||||
color = image.pget(from_x, from_y)
|
||||
self.pset(x, y, color)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
BIN
build/tools/iconMaker/font.bmp
Normal file
BIN
build/tools/iconMaker/font.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
108
build/tools/iconMaker/iconMaker.rb
Executable file
108
build/tools/iconMaker/iconMaker.rb
Executable file
@ -0,0 +1,108 @@
|
||||
require './TwlIcon.rb'
|
||||
|
||||
$fgColor = 0x0
|
||||
$bgColor = 0xf
|
||||
|
||||
COLOR_TABLE = {
|
||||
"black" => 0, "maroon" => 1, "green" => 2, "olive" => 3,
|
||||
"navy" => 4, "purple" => 5, "teal" => 6, "gray" => 7,
|
||||
"lightgray" => 8, "red" => 9, "lime" => 10, "yellow" => 11,
|
||||
"blue" => 12, "fuchsia" => 13, "aqua" => 14, "white" => 15
|
||||
}
|
||||
def readArg( str )
|
||||
|
||||
lineNum = 0
|
||||
argList = str.split( "/" )
|
||||
return nil if argList.size == 0
|
||||
|
||||
newicon = TwlIcon.new
|
||||
|
||||
while( arg = argList.shift ) do
|
||||
next if arg.size == 0
|
||||
|
||||
head = arg[0]
|
||||
data = arg[1..arg.size]
|
||||
|
||||
if head == ?O then
|
||||
newicon.filename = data
|
||||
elsif head == ?I then
|
||||
newicon.setString( lineNum, data )
|
||||
lineNum += 1
|
||||
elsif head == ?F
|
||||
if data =~ /\d{1,2}?/ && (0..15).include?( data.to_i ) then
|
||||
$fgColor = data.to_i
|
||||
elsif COLOR_TABLE[data]
|
||||
$fgColor = COLOR_TABLE[data]
|
||||
end
|
||||
elsif head == ?B
|
||||
if data =~ /\d{1,2}?/ && (0..15).include?( data.to_i ) then
|
||||
$bgColor = data.to_i
|
||||
elsif COLOR_TABLE[data]
|
||||
$bgColor = COLOR_TABLE[data]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
newicon.setColor( $fgColor, $bgColor )
|
||||
|
||||
return newicon
|
||||
end
|
||||
|
||||
=begin
|
||||
# 各項目を//で区切られた引数を文字列リストに分割して
|
||||
# TwlIconオブジェクトを生成する
|
||||
def readArg( str )
|
||||
argList = str.split( "/" )
|
||||
p argList
|
||||
|
||||
return nil unless argList.size == 3 || argList.size == 5
|
||||
|
||||
newicon = TwlIcon.new
|
||||
|
||||
if argList.size == 5 then
|
||||
# fgcolorとbgcolorを割り当てる
|
||||
argList.delete 0..1
|
||||
end
|
||||
|
||||
# こっから表示文字列
|
||||
for i in 0..2 do
|
||||
newicon.setString( i, argList[i] )
|
||||
newicon.setColor(0x3, 0xc)
|
||||
end
|
||||
|
||||
return newicon
|
||||
end
|
||||
=end
|
||||
|
||||
TwlIcon::init
|
||||
|
||||
|
||||
iconlist = Array.new 0
|
||||
argList = []
|
||||
|
||||
ARGV.each do |str|
|
||||
if str =~ /(.+\.txt)/ then
|
||||
fileArgList = open(str).read.split(/\s/)
|
||||
fileArgList.each do |fileArg|
|
||||
newicon = readArg fileArg
|
||||
if newicon then
|
||||
iconlist.push newicon
|
||||
argList.push fileArg
|
||||
end
|
||||
end
|
||||
else
|
||||
newicon = readArg str
|
||||
if newicon then
|
||||
iconlist.push newicon
|
||||
argList.push str
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
idx = 0
|
||||
iconlist.each do |icon|
|
||||
filename = icon.filename ? icon.filename : "test#{idx}.bmp"
|
||||
puts "*** warning ***\n width overflow: #{argList[idx]}" unless icon.write( filename )
|
||||
#p filename
|
||||
idx += 1
|
||||
end
|
||||
76
build/tools/iconMaker/input_sumple.txt
Normal file
76
build/tools/iconMaker/input_sumple.txt
Normal file
@ -0,0 +1,76 @@
|
||||
/O0NRA.bmp/INand/IInit/IRed/Fwhite/Bblue
|
||||
/O0NPA.bmp/INand/IInit/IProd
|
||||
/O0NIA.bmp/INand/IInit/IStd
|
||||
/O0HWA.bmp/I0HWA/IHWInfo/Iwriter
|
||||
/O0IJA.bmp/I0IJA/IImport/IJump
|
||||
/O0SUA.bmp/ISystem/IUpdate
|
||||
|
||||
/O000A.bmp/I000A/IWl/ICheck/Fwhite/Bblue
|
||||
/O0A0A.bmp/I0A0A/IWl/ICheck
|
||||
|
||||
/O010A.bmp/I010A/ILogo/ILtdok/Fblack/Bgreen
|
||||
/O0G0A.bmp/I0G0A/ILogo/IHYBok
|
||||
/O0G2A.bmp/I0G2A/ILogo/ILTDok
|
||||
/O011A.bmp/I011A/ILogo/ILtdng/Fblack/Bred
|
||||
/O0G1A.bmp/I0G1A/ILogo/IHYBng
|
||||
/O0G3A.bmp/I0G3A/ILogo/ILTDng
|
||||
|
||||
/O012A.bmp/I012A/IFatal/IMaker/Fwhite/Bblue
|
||||
/O013A.bmp/I013A/IErLog/ITest
|
||||
/O0G4A.bmp/I0G4A/IFatal/IMaker
|
||||
/O0G5A.bmp/I0G5A/IErLog/ITest
|
||||
|
||||
/O020A.bmp/I020A/IDisp/IInfo/Fwhite/Bblue
|
||||
/O021A.bmp/I021A/IDisp/IInfo
|
||||
/O022A.bmp/I022A/IDisp/IInfo
|
||||
/O023A.bmp/I023A/IDisp/IInfo
|
||||
/O024A.bmp/I024A/IDisp/IInfo
|
||||
/O025A.bmp/I025A/IDisp/IInfo
|
||||
|
||||
/O0B0A.bmp/I0B0A/IDisp/IInfo/Fwhite/Bblue/
|
||||
/O0B1A.bmp/I0B1A/IDisp/IInfo
|
||||
/O0B2A.bmp/I0B2A/IDisp/IInfo
|
||||
/O0B3A.bmp/I0B3A/IDisp/IInfo
|
||||
/O0B4A.bmp/I0B4A/IDisp/IInfo
|
||||
/O0B5A.bmp/I0B5A/IDisp/IInfo
|
||||
/O0B6A.bmp/I0B6A/IDisp/IInfo
|
||||
/O0B7A.bmp/I0B7A/IDisp/IInfo
|
||||
/O0B8A.bmp/I0B8A/IDisp/IInfo
|
||||
/O0B9A.bmp/I0B9A/IDisp/IInfo
|
||||
/O0BAA.bmp/I0BAA/IDisp/IInfo
|
||||
/O0BBA.bmp/I0BBA/IDisp/IInfo
|
||||
|
||||
/O0F5A.bmp/I0F5A/IFATFS/IPerm/Fblack/Bgreen
|
||||
/O0F6A.bmp/I0F6A/IFATFS/IPerm
|
||||
/O0F7A.bmp/I0F7A/IFATFS/IPerm
|
||||
/O0F8A.bmp/I0F8A/IFATFS/IPerm
|
||||
/O0F9A.bmp/I0F9A/IFATFS/IPerm
|
||||
/O0FAA.bmp/I0FAA/IFATFS/IPerm
|
||||
/O0FBA.bmp/I0FBA/IFATFS/IPerm
|
||||
/O0FCA.bmp/I0FCA/IFATFS/IPerm
|
||||
/O0FDA.bmp/I0FDA/IFATFS/IPerm
|
||||
/O0FEA.bmp/I0FEA/IFATFS/IPerm
|
||||
|
||||
/O0D1A.bmp/I0D1A/IDigest/ICheck/Fblack/Bgreen
|
||||
/O0D2A.bmp/I0D2A/IDigest/ICheck
|
||||
/O0D4A.bmp/I0D4A/IDigest/ICheck
|
||||
|
||||
/O0C0A.bmp/I0C0A/Ikassen/Iswoff/Fblack/Bwhite
|
||||
/O0C1A.bmp/I0C1A/Ikassen/Inorm
|
||||
/O0C2A.bmp/I0C2A/Ikassen/Igame
|
||||
/O0C3A.bmp/I0C3A/Ikassen/Iswoff
|
||||
/O0C4A.bmp/I0C4A/Ikassen/Inorm
|
||||
/O0C5A.bmp/I0C5A/Ikassen/Igame
|
||||
|
||||
|
||||
/O0F0A.bmp/I0F0A/IFATFS/IPerm/Fblack/Bgreen
|
||||
/O0F1A.bmp/I0F1A/IFATFS/IPerm
|
||||
/O0F2A.bmp/I0F2A/IFATFS/IPerm
|
||||
/O0F3A.bmp/I0F3A/IFATFS/IPerm
|
||||
/O0F4A.bmp/I0F4A/IFATFS/IPerm
|
||||
|
||||
/O0D0A.bmp/I0D0A/IDigest/ICheck/Fblack/Bgreen
|
||||
/O0D3A.bmp/I0D3A/IDigest/ICheck
|
||||
|
||||
/O0CAA.bmp/I0CAA/ICard/Imode/Fblack/Bgreen
|
||||
/O0CBA.bmp/I0CBA/ICard/Imode
|
||||
Loading…
Reference in New Issue
Block a user