sfont kerns

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
ShiraiJunichi
Miko-Class Veteran
Posts: 651
Joined: Sat May 21, 2005 12:28 pm
Location: University of Utah
Contact:

sfont kerns

#1 Post by ShiraiJunichi »

In an older version of Ren'Py, the following code worked:

Code: Select all

    
    $ import asfont22

    # Register the sfont contained in asfont22 as "subfont".
    $ renpy.register_sfont('subfont', 22,
    filename="asfont22.png",
    kerns=asfont22.kerns,
    spacewidth=4)
Now that code fails:

Code: Select all

I'm sorry, but an exception occured while executing your Ren'Py
script.

ImportError: No module named asfont22

While executing init code:
 - script at line 10 of C:\Users\jasons\Documents\File Center\Programs\Games\Visual Novels\My Renai Projects\Projects\TyingThreads/game/options.rpy
 - python at line 28 of C:\Users\jasons\Documents\File Center\Programs\Games\Visual Novels\My Renai Projects\Projects\TyingThreads/game/options.rpy.

-- Full Traceback ------------------------------------------------------------

  File "C:\Users\jasons\Documents\File Center\Programs\Games\Visual Novels\My Renai Projects\renpy-6.9.3\renpy\bootstrap.py", line 260, in bootstrap
  File "C:\Users\jasons\Documents\File Center\Programs\Games\Visual Novels\My Renai Projects\renpy-6.9.3\renpy\main.py", line 253, in main
  File "C:\Users\jasons\Documents\File Center\Programs\Games\Visual Novels\My Renai Projects\renpy-6.9.3\renpy\execution.py", line 230, in run
  File "C:\Users\jasons\Documents\File Center\Programs\Games\Visual Novels\My Renai Projects\renpy-6.9.3\renpy\ast.py", line 558, in execute
  File "C:\Users\jasons\Documents\File Center\Programs\Games\Visual Novels\My Renai Projects\renpy-6.9.3\renpy\python.py", line 921, in py_exec_bytecode
  File "C:\Users\jasons\Documents\File Center\Programs\Games\Visual Novels\My Renai Projects\Projects\TyingThreads/game/options.rpy", line 28, in <module>
ImportError: No module named asfont22

While executing init code:
 - script at line 10 of C:\Users\jasons\Documents\File Center\Programs\Games\Visual Novels\My Renai Projects\Projects\TyingThreads/game/options.rpy
 - python at line 28 of C:\Users\jasons\Documents\File Center\Programs\Games\Visual Novels\My Renai Projects\Projects\TyingThreads/game/options.rpy.

Ren'Py Version: Ren'Py 6.9.3c
Setting the default_kern parameter to -1 instead produces decent results, but it's just not as good as before. Any suggestions?

User avatar
PyTom
Ren'Py Creator
Posts: 16093
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: sfont kerns

#2 Post by PyTom »

You need to grab a copy of asfont22.py from somewhere, and place it into the game directory.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: Google [Bot]