| 
 
| 赞 | 5 |  
| VIP | 359 |  
| 好人卡 | 195 |  
| 积分 | 3 |  
| 经验 | 560179 |  
| 最后登录 | 2024-5-17 |  
| 在线时间 | 1373 小时 |  
 Lv2.观梦者 
	梦石0 星屑270 在线时间1373 小时注册时间2005-10-16帖子5113 
 | 
| 本帖最后由 亿万星辰 于 2011-11-2 17:42 编辑 
 Font目录下放英文文件名,测试不存在反复重装的问题~复制代码  font_file_name = "fzsxslkjt.TTF" 
  font_name = "方正苏新诗柳楷简体"
  unless Font.exist?(font_name)
    dir = Win32API.new('kernel32','GetSystemDirectory','p,l','l')
    dir_str = " " * 256
    dir.call(dir_str,255)
    dir_str = dir_str.split('system')[0]
    dir_str.gsub!('\\') {'/'}
    Dir.chdir("Font")
    if FileTest.exist?(font_file_name)
      copy = Win32API.new('kernel32',"CopyFileA",'p,p,l','')
      copy.call(font_file_name, "#{dir_str}/Fonts/#{font_file_name}",0)
      font = Win32API.new('gdi32','AddFontResourceA','p','l')
      sendmsg = Win32API.new('user32','SendMessageA','l,l,l,l','l')
      font.call("#{dir_str}/Fonts/#{font_file_name}")
      sendmsg.call(65535,29,0,0)
      Thread.new{system ("Game")}
      exit
    end
  end
 | 
 |