Page 1 of 1

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

Posted: Thu Jan 11, 2018 10:38 pm
by PoisionLullaby
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

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

Posted: Fri Jan 12, 2018 7:58 am
by Remix
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.

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

Posted: Sat Jan 13, 2018 2:03 am
by PoisionLullaby
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.

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

Posted: Sat Jan 13, 2018 9:36 am
by Remix
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 :)

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

Posted: Sun Jan 14, 2018 12:41 am
by PyTom
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.

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

Posted: Sun Jan 14, 2018 6:27 pm
by PoisionLullaby
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. :)