RenPy中文空间

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 1234|回复: 3

[已解决] 关于翻译完成后运行游戏出现找不到字体的问题

[复制链接]
发表于 2020-3-28 20:46:48 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
翻译完后重新运行出现找不到字体,但是字体文件是存在的,而且这个游戏没有font文件夹,gui里面也没出现这个这个字体文件,这个字体文件在core文件夹中。具体情况如下:
I'm sorry, but an uncaught exception occurred.
While running game code:
  File "game/core/scenes/scripte01s01.rpy", line 105, in script
    Jessie "真是抱歉啊,小可爱。堵车呢,不能再快了。"
  File "game/core/scenes/scripte01s01.rpy", line 105, in script
    Jessie "真是抱歉啊,小可爱。堵车呢,不能再快了。"
Exception: Could not find font u'Norquay-Regular.ttf'.
-- Full Traceback ------------------------------------------------------------
Full traceback:
  File "C:\Users\selig\Desktop\NationalParkGirls-1.0-win\renpy\bootstrap.py", line 316, in bootstrap
    renpy.main.main()
  File "C:\Users\selig\Desktop\NationalParkGirls-1.0-win\renpy\main.py", line 574, in main
    run(restart)
  File "C:\Users\selig\Desktop\NationalParkGirls-1.0-win\renpy\main.py", line 139, in run
    renpy.execution.run_context(True)
  File "C:\Users\selig\Desktop\NationalParkGirls-1.0-win\renpy\execution.py", line 901, in run_context
    context.run()
  File "game/core/scenes/scripte01s01.rpy", line 105, in script
    Jessie "真是抱歉啊,小可爱。堵车呢,不能再快了。"
  File "game/core/scenes/scripte01s01.rpy", line 105, in script
    Jessie "真是抱歉啊,小可爱。堵车呢,不能再快了。"
  File "C:\Users\selig\Desktop\NationalParkGirls-1.0-win\renpy\ast.py", line 708, in execute
    renpy.exports.say(who, what, *args, **kwargs)
  File "C:\Users\selig\Desktop\NationalParkGirls-1.0-win\renpy\exports.py", line 1345, in say
    who(what, *args, **kwargs)
  File "C:\Users\selig\Desktop\NationalParkGirls-1.0-win\renpy\character.py", line 1142, in __call__
    self.do_display(who, what, cb_args=self.cb_args, **display_args)
  File "C:\Users\selig\Desktop\NationalParkGirls-1.0-win\renpy\character.py", line 842, in do_display
    **display_args)
  File "C:\Users\selig\Desktop\NationalParkGirls-1.0-win\renpy\character.py", line 591, in display_say
    rv = renpy.ui.interact(mouse='say', type=type, roll_forward=roll_forward)
  File "C:\Users\selig\Desktop\NationalParkGirls-1.0-win\renpy\ui.py", line 297, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "C:\Users\selig\Desktop\NationalParkGirls-1.0-win\renpy\display\core.py", line 2702, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "C:\Users\selig\Desktop\NationalParkGirls-1.0-win\renpy\display\core.py", line 3194, in interact_core
    self.draw_screen(root_widget, fullscreen_video, (not fullscreen_video) or video_frame_drawn)
  File "C:\Users\selig\Desktop\NationalParkGirls-1.0-win\renpy\display\core.py", line 2094, in draw_screen
    renpy.config.screen_height,
  File "render.pyx", line 490, in renpy.display.render.render_screen
  File "render.pyx", line 259, in renpy.display.render.render
  File "C:\Users\selig\Desktop\NationalParkGirls-1.0-win\renpy\display\layout.py", line 722, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 166, in renpy.display.render.render
  File "render.pyx", line 259, in renpy.display.render.render
  File "C:\Users\selig\Desktop\NationalParkGirls-1.0-win\renpy\display\layout.py", line 722, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 166, in renpy.display.render.render
  File "render.pyx", line 259, in renpy.display.render.render
  File "C:\Users\selig\Desktop\NationalParkGirls-1.0-win\renpy\display\layout.py", line 722, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 166, in renpy.display.render.render
  File "render.pyx", line 259, in renpy.display.render.render
  File "C:\Users\selig\Desktop\NationalParkGirls-1.0-win\renpy\display\screen.py", line 675, in render
    child = renpy.display.render.render(self.child, w, h, st, at)
  File "render.pyx", line 166, in renpy.display.render.render
  File "render.pyx", line 259, in renpy.display.render.render
  File "C:\Users\selig\Desktop\NationalParkGirls-1.0-win\renpy\display\layout.py", line 722, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 166, in renpy.display.render.render
  File "render.pyx", line 259, in renpy.display.render.render
  File "C:\Users\selig\Desktop\NationalParkGirls-1.0-win\renpy\display\layout.py", line 1127, in render
    st, at)
  File "render.pyx", line 166, in renpy.display.render.render
  File "render.pyx", line 259, in renpy.display.render.render
  File "C:\Users\selig\Desktop\NationalParkGirls-1.0-win\renpy\display\layout.py", line 722, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 166, in renpy.display.render.render
  File "render.pyx", line 259, in renpy.display.render.render
  File "C:\Users\selig\Desktop\NationalParkGirls-1.0-win\renpy\display\layout.py", line 1127, in render
    st, at)
  File "render.pyx", line 166, in renpy.display.render.render
  File "render.pyx", line 259, in renpy.display.render.render
  File "C:\Users\selig\Desktop\NationalParkGirls-1.0-win\renpy\text\text.py", line 1996, in render
    virtual_layout = Layout(self, width, height, renders, drawable_res=False, size_only=True)
  File "C:\Users\selig\Desktop\NationalParkGirls-1.0-win\renpy\text\text.py", line 626, in __init__
    glyphs = ts.glyphs(s, self)
  File "C:\Users\selig\Desktop\NationalParkGirls-1.0-win\renpy\text\text.py", line 242, in glyphs
    fo = font.get_font(self.font, self.size, self.bold, self.italic, 0, self.antialias, self.vertical, self.hinting, layout.oversample)
  File "C:\Users\selig\Desktop\NationalParkGirls-1.0-win\renpy\text\font.py", line 699, in get_font
    face = load_face(fn)
  File "C:\Users\selig\Desktop\NationalParkGirls-1.0-win\renpy\text\font.py", line 640, in load_face
    raise Exception("Could not find font {0!r}.".format(orig_fn))
Exception: Could not find font u'Norquay-Regular.ttf'.


不知道什么原因,不是中文的问题,因为我重新换成英文也会这样报错
求大佬给出解决方法
发表于 2020-3-30 09:27:35 | 显示全部楼层
本帖最后由 763003211 于 2020-3-30 09:29 编辑

目测是字体文件的路径改变了导致找不到文件,在全部代码中搜索".ttf"找到路径的设置看看有没有问题如果打包了,路径也许会变为多了一个文件夹,可以试试直接放到根目录并同步修改路径设置,看还有没有找不到的问题

评分

参与人数 1干货 +1 收起 理由
BuErShen + 1 感谢解答!

查看全部评分

回复 支持 反对

使用道具 举报

 楼主| 发表于 2020-3-30 13:28:17 | 显示全部楼层
十分感谢,已经解决了,确实是路径问题
回复 支持 反对

使用道具 举报

发表于 2020-3-30 16:33:51 | 显示全部楼层
看这里出错提示,主要看:“-- Full Traceback --------” 上面一句。

Exception: Could not find font u'Norquay-Regular.ttf'.
-- Full Traceback ------------------------------------------------------------

不到英文,可以用Google翻译

例外:找不到字体u'Norquay-Regular.ttf'。
---------完整追溯--------------------------------------
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|RenPy中文空间 ( 苏ICP备17067825号 | 苏公网安备 32092302000068号 )

GMT+8, 2020-12-4 21:56 , Processed in 0.035003 second(s), 12 queries , File On.

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表