本帖最后由 sd2011678 于 2012-6-21 17:46 编辑
汉化游戏中,发现游戏根本无法显示中文 一导入中文就脚本出错,研究发现游戏居然用了少见的点阵字库....
于是想修改,但是本人是脚本白痴..所以求大家帮忙
做点阵字库我会,但是这段脚本怎么定义位置呢?或求教高人们指点或者帮忙看下脚本结构看能否改成传统的字库显示,如果帮忙解决问题,我保证汉化一定不会烂尾,且会要显著的位置标明技术援助,谢谢~
附上工程下载:http://115.com/file/dpat8tyq
#==============================================================================
# Keep fonts in system
#==============================================================================
class Game_System
alias :font_sys_init :initialize unless $@
def initialize
font_sys_init
@fonts = {}
FONTS::DATA.each_key{ |k| @fonts[k] = BitmapFont.new(k) }
end
def font(f)
return @fonts[f]
end
end
#==============================================================================
# Font Settings
#==============================================================================
module FONTS
if !$rebuild_data
# Load from data files
DATA = load_data('Data/LS_Fonts.rvdata')
else
DATA = {}
#--------------------------------------------------------------------------
# * Standard Font
#--------------------------------------------------------------------------
std = {}
std[:gfx] = "fnt_std.png"
std[:cell] = [30,30]
std[:start] = [3,3]
std[:offset] = [0,0]
std[:spacing] = [-1,5,27]
std[:modkern] = 2
std[:height] = 22
std[:modwidth] = 1
std[:widths] = [15,12,13,13,10,9,14,12,4,7,11,9,18,14,15,11,17,12,12,13,14,15,
22,13,13,12,10,12,10,11,11,9,12,11,4,7,11,4,18,11,12,12,11,8,
9,9,11,12,18,11,13,9,13,10,11,11,13,11,12,12,13,12,4,11,7,18,
4,6,6,5,6,6]
DATA['std'] = std
#--------------------------------------------------------------------------
# * Recolors
#--------------------------------------------------------------------------
['green','red','blue','shdw'].each{ |f|
stdc = {}
stdc[:gfx] = "fnt_"+f+".png"
stdc[:cell] = std[:cell]
stdc[:start] = std[:start]
stdc[:offset] = std[:offset]
stdc[:spacing] = std[:spacing]
stdc[:modkern] = std[:modkern]
stdc[:height] = std[:height]
stdc[:modwidth] = std[:modwidth]
stdc[:widths] = std[:widths]
DATA[f] = stdc
}
#--------------------------------------------------------------------------
# * Glows for standard font
#--------------------------------------------------------------------------
['red','yellow','green','purp','blue','black'].each{ |f|
glow = {}
glow[:gfx] = "fnt_std_"+f+".png"
glow[:cell] = [30,30]
glow[:start] = [0,0]
glow[:offset] = [3,3]
glow[:spacing] = [-4,5,27]
glow[:modkern] = std[:modkern]
glow[:height] = std[:height]
glow[:modwidth] = std[:modwidth]
glow[:widths] = std[:widths]
DATA['std_'+f] = glow
}
['green'].each{ |f|
glow = {}
glow[:gfx] = "fnt_green_green.png"
glow[:cell] = [30,30]
glow[:start] = [0,0]
glow[:offset] = [3,3]
glow[:spacing] = [-4,5,27]
glow[:modkern] = std[:modkern]
glow[:height] = std[:height]
glow[:modwidth] = std[:modwidth]
glow[:widths] = std[:widths]
DATA['green_green'] = glow
}
#--------------------------------------------------------------------------
# * Big Font
#--------------------------------------------------------------------------
big = {}
big[:gfx] = "fnt_big.png"
big[:cell] = [60,60]
big[:start] = [6,6]
big[:offset] = [0,0]
big[:spacing] = [-1,10,48]
big[:modkern] = 6
big[:height] = 44
big[:modwidth] = 2
big[:widths] = [15,12,13,13,10,9,14,12,4,7,11,9,18,14,15,11,17,12,12,13,14,15,
22,13,13,12,10,12,10,11,11,9,12,11,4,7,11,4,18,11,12,12,11,8,
9,9,11,12,18,11,13,9,13,10,11,11,13,11,12,12,13,12,4,11,11,18,
4,6,6,5,6,6]
DATA['big'] = big
#--------------------------------------------------------------------------
# * Big Glows
#--------------------------------------------------------------------------
['red','yellow','green','purp','blue','black'].each{ |f|
glow = {}
glow[:gfx] = "fnt_big_"+f+".png"
glow[:cell] = [60,60]
glow[:start] = [0,0]
glow[:offset] = [6,6]
glow[:spacing] = big[:spacing]
glow[:modkern] = big[:modkern]
glow[:height] = big[:height]
glow[:modwidth] = big[:modwidth]
glow[:widths] = big[:widths]
DATA['big_'+f] = glow
}
#--------------------------------------------------------------------------
# * Mini Font
#--------------------------------------------------------------------------
mini = {}
mini[:gfx] = "fnt_mini.png"
mini[:cell] = [15,15]
mini[:start] = [1,1]
mini[:offset] = [0,0]
mini[:spacing] = [0,3,15]
mini[:modkern] = 1
mini[:height] = 12
mini[:modwidth] = 0.5
mini[:widths] = [15,12,13,13,10,9,14,12,4,7,11,9,18,14,15,11,17,12,12,13,14,15,
22,13,13,12,10,12,10,11,11,9,12,11,4,7,11,4,18,11,12,12,11,8,
9,9,11,12,18,11,13,9,13,10,11,11,13,11,12,12,13,12,4,11,11,18,
4,6,6,5,6,6]
DATA['mini'] = mini
#--------------------------------------------------------------------------
# * Namebox Font
#--------------------------------------------------------------------------
face = {}
face[:gfx] = "fnt_face.png"
face[:cell] = [30,30]
face[:start] = [3,3]
face[:offset] = [0,0]
face[:spacing] = [-1,5,27]
face[:modkern] = 2
face[:height] = 22
face[:modwidth] = 1
face[:widths] = [11,9,10,10,8,7,11,10,3,5,9,7,14,10,12,9,13,9,9,10,10,11,16,
10,9,9,8,9,8,9,8,7,9,8,3,5,8,3,13,8,10,9,9,6,7,7,8,9,13,9,
9,7,10,8,8,9,10,9,9,9,9,9,3,8,9,13,4,4,4,3,5,4]
DATA['face'] = face
#--------------------------------------------------------------------------
# * Title Font
#--------------------------------------------------------------------------
title = {}
title[:gfx] = "fnt_title.png"
title[:cell] = [37.5,37.5]
title[:start] = [4,4]
title[:offset] = [0,0]
title[:spacing] = [0,7,35]
title[:modkern] = 1
title[:height] = 30
title[:modwidth] = 1.25
title[:widths] = [15,12,13,13,10,9,14,12,4,7,11,9,18,14,15,11,17,12,12,13,14,15,
22,13,13,12,10,12,10,11,11,9,12,11,4,7,11,4,18,11,12,12,11,8,
9,9,11,12,18,11,13,9,13,10,11,11,13,11,12,12,13,12,4,11,11,18,
4,6,6,5,6,6]
DATA['title'] = title
#save_data(DATA,'Data/LS_Fonts.rvdata')
end
#--------------------------------------------------------------------------
# * Prep Kernings
#--------------------------------------------------------------------------
KERNING = []
bigs = ['T','V','W','X','Y']
smalls = ('a'..'z').to_a
smalls = smalls - ['h','j','k','l']
bigs.each { |b|
smalls.each{ |s|
KERNING.push(b+s)
}
}
kplus = ['ys','yo','yt']
KERNING = KERNING + kplus
end
|