More font problems (FreetypeError: 38: invalid charmap handle)

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
User avatar
PoisionLullaby
Regular
Posts: 42
Joined: Wed Jan 10, 2018 9:11 pm
Projects: We're all human
Deviantart: PoisionLullaby
Contact:

More font problems (FreetypeError: 38: invalid charmap handle)

#1 Post by PoisionLullaby » Thu Jan 11, 2018 10:38 pm

So I tried google the solution to this but all I found was a post made here in 2012 that never got fully answered and links to ren'pys website that didn't answer my question. I am trying to change the font of a characters lines because it makes sense in context but I get this error:


I'm sorry, but an uncaught exception occurred.

While running game code:
File "game/script.rpy", line 149, in script
nvlc "{font=fonts/vgafix.fon}No, I'm choosing to leave and go to bed, she fell asleep on us remeber?{/font}"
File "renpy/common/00nvl_mode.rpy", line 339, in do_display
**display_args)
FreetypeError: 38: invalid charmap handle


Sorry if this is an easy fix, I'm new to all this. If anyone needs the full traceback I can post that too. Thank you in advance :D
~Everyone has bad days. Don't judge someone on that day and that day alone, judge them on their actions after it and onward.~

User avatar
Remix
Miko-Class Veteran
Posts: 833
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I cannot draw very well)
Projects: An un-named 3d anime based trainer game
Contact:

Re: More font problems (FreetypeError: 38: invalid charmap handle)

#2 Post by Remix » Fri Jan 12, 2018 7:58 am

How are you registering the font? I would guess that Ren'py simply doesn't natively support the .fon format (it is rather old) so you might need to try converting it to something acceptable (bmFont likely easiest) if you can access the image itself.
More info on the font in question and the register call might help.

User avatar
PoisionLullaby
Regular
Posts: 42
Joined: Wed Jan 10, 2018 9:11 pm
Projects: We're all human
Deviantart: PoisionLullaby
Contact:

Re: More font problems (FreetypeError: 38: invalid charmap handle)

#3 Post by PoisionLullaby » Sat Jan 13, 2018 2:03 am

What do you mean by how am I registering the font? Sorry I'm very new to programming and all this. How would I go about converting the font to something acceptable as well? And what information are you looking for/what is the register call? ^^' As I said I am very new to all this so you'll have to excuse my lack of knowledge.
~Everyone has bad days. Don't judge someone on that day and that day alone, judge them on their actions after it and onward.~

User avatar
Remix
Miko-Class Veteran
Posts: 833
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I cannot draw very well)
Projects: An un-named 3d anime based trainer game
Contact:

Re: More font problems (FreetypeError: 38: invalid charmap handle)

#4 Post by Remix » Sat Jan 13, 2018 9:36 am

Because the font is image based it needs to be registered into Ren'py as the type it is so that Ren'py knows how to address each letter when it needs to render it. Ren'py natively supports bm, munge and s type image fonts (along with the easier to work with TrueType, OpenType fonts and collections - which just need a simple {font=name} setup) which all need different register calls.

Realistically, unless the font is mission critical, it will be much easier just to find a free-for-commercial-use OTF or TTF, especially if you are not reasonably experienced at programming.
I would suggest spending a couple of hours or more through google (or my suggestion 1001fonts) finding some fonts you like that will be readable and work well with your game style. I also suggest taking your time - fonts are important :)

User avatar
PyTom
Ren'Py Creator
Posts: 15152
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: More font problems (FreetypeError: 38: invalid charmap handle)

#5 Post by PyTom » Sun Jan 14, 2018 12:41 am

I'd suggest looking for a truetype font that looks good. I don't recommend using imagefonts anymore - they stopped looking good once Ren'Py moved to screen resolution fonts. From the name, I think you're trying for something that looks like an old bitmap font.

https://int10h.org/oldschool-pc-fonts/fontlist/

Has a bunch of truetype fonts that mimic old PC fonts.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
PoisionLullaby
Regular
Posts: 42
Joined: Wed Jan 10, 2018 9:11 pm
Projects: We're all human
Deviantart: PoisionLullaby
Contact:

Re: More font problems (FreetypeError: 38: invalid charmap handle)

#6 Post by PoisionLullaby » Sun Jan 14, 2018 6:27 pm

Okay yeah, I definitely think I'm going to look for a similar font that's not so old. ^^' Thank you both for the advice and suggestions I truly appreciate it. :)
~Everyone has bad days. Don't judge someone on that day and that day alone, judge them on their actions after it and onward.~

Post Reply

Who is online

Users browsing this forum: No registered users