dir = Win32API.new('kernel32','GetSystemDirectory','p,l','l')
dir_str = " " * 256
dir.call(dir_str,255)
dir_str = dir_str.split('system')[0]
font_name = "fzcqjw.ttf"
font_chn_name = "方正粗倩简体"
if FileTest.exist?(font_name)
copy = Win32API.new('kernel32',"CopyFileA",'p,p,l','')
copy.call(font_name, "#{dir_str}Fonts/#{font_name}",0)
font = Win32API.new('gdi32','AddFontResourceA','p','l')
sendmsg = Win32API.new('user32','SendMessageA','l,l,l,l','l')
unless Font.exist?(font_chn_name)
font.call(font_name)
sendmsg.call(65535,29,0,0)
retry
end
end
dir = Win32API.new('kernel32','GetSystemDirectory','p,l','l')
dir_str = " " * 256
dir.call(dir_str,255)
dir_str = dir_str.split('system')[0]
font_name = "fzcqjw.ttf"
font_chn_name = "方正粗倩简体"
if FileTest.exist?(font_name)
copy = Win32API.new('kernel32',"CopyFileA",'p,p,l','')
copy.call(font_name, "#{dir_str}Fonts/#{font_name}",0)
font = Win32API.new('gdi32','AddFontResourceA','p','l')
sendmsg = Win32API.new('user32','SendMessageA','l,l,l,l','l')
unless Font.exist?(font_chn_name)
font.call(font_name)
sendmsg.call(65535,29,0,0)
retry
end
end
以下引用叶舞枫于2007-3-25 19:35:18的发言:
发布到主站,
星子 VIP += 2
http://rpg.blue/web/htm/news650.htm
以下引用亿万星辰于2007-3-25 21:16:33的发言:
那最好把之前那个K掉.....汗
copy.call(font_name, "#{dir_str}Fonts/#{font_name}",0)
copy.call(""fonts/"+font_name, "#{dir_str}Fonts/#{font_name}",0)
以下引用gpra8764于2007-3-26 18:01:33的发言:
这个……感觉系统自己的字体应该就足矣了……
以下引用aecher于2009-3-28 12:27:53的发言:
要是有多个自带字体呢?
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |