Project1

标题: 关于变更字体 [打印本页]

作者: 131541122    时间: 2011-8-20 18:10
标题: 关于变更字体
我把字体改成了一种特殊字体,请问怎样才能使发布后的游戏,即使对方电脑内没有这个字体看到的也是这种特殊字体?dsu_plus_rewardpost_czw
作者: as8987000    时间: 2011-8-20 18:40
放个TXT文件说明,另外附加组件的字体文件.......叫他自己安装
作者: 2578699    时间: 2011-8-20 18:53
本帖最后由 2578699 于 2011-8-20 18:55 编辑

把游戏所用字体放在游戏目录下,
在脚本顶端插入,7行修改字体。
  1. dir = Win32API.new('kernel32','GetSystemDirectory','pl','l')
  2. dir_str = " " * 256
  3. dir.call(dir_str,255)
  4. dir_str = dir_str.split('system')[0]

  5. font_name = "fzchyjw.ttf"  
  6. font_chn_name = "方正粗活意简体"
  7. begin
  8. if FileTest.exist?(font_name)
  9.   copy = Win32API.new('kernel32',"CopyFileA",'ppl','')
  10.   copy.call(font_name, "#{dir_str}Fonts/#{font_name}",0)
  11.   font = Win32API.new('gdi32','AddFontResourceA','p','l')
  12.   sendmsg = Win32API.new('user32','SendMessageA','llll','l')
  13.   unless Font.exist?(font_chn_name)
  14.     font.call(font_name)
  15.     sendmsg.call(65535,29,0,0)
  16.   end
  17. end
  18. end
  19. #==============================================================================
  20. # 鸣谢:GPRA8764
  21. #==============================================================================
复制代码
脚本来自全新世纪2
作者: 失·忆    时间: 2011-8-20 22:07
对方电脑里没有的话是看不见的哦…将字体文件放在根目录下,到时候玩家自行安装就可以了。




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1