TrueType font Support by FreeType Library

A forum to store posts deemed exceptionally wise and useful
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: TrueType font Support by FreeType Library

Post by CuteAlien »

Check the function-declarations of the functions mentioned in the errors. They have to look the same in your code than in the base-class in the Irrlicht header. For event-receiver it's probably that OnEvent passes it's parameter now as const reference.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: TrueType font Support by FreeType Library

Post by robmar »

Thanks, so would you say that the IrrFreeType is worth updating to 1.7.2, or should people use those two classes on your web for fonts. What´s best for fonts on Irrlicht these days?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: TrueType font Support by FreeType Library

Post by CuteAlien »

Nalin and me both have updated versions working with newer Irrlicht (Nalin's are newer than mine and can be found here: http://irrlicht.sourceforge.net/forum/v ... =6&t=37296). We can't update the version on zgock's server and I don't think he is still working on this - so not much we can do for that (hm - I could theoretically edit the first post and mention it there, although not sure if modifying user-posts for this is something an Admin should do...).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: TrueType font Support by FreeType Library

Post by hendu »

BTW, since TTF is requested so often, is there something keeping it from being an optional feature in the engine?
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: TrueType font Support by FreeType Library

Post by robmar »

Or maybe a post with the classes and some simple guidance. I looked at the mentioned aboive "viewtopic.php?f=6&t=37296" but its not so easy to follow without documentation or an example.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: TrueType font Support by FreeType Library

Post by CuteAlien »

hendu wrote:BTW, since TTF is requested so often, is there something keeping it from being an optional feature in the engine?
Yes, missing mechanism to do serialization for fonts. Without serialization you can already use those extensions here anyway. Fonts need loaders/factories similar to other elements. But they are not the only objects needing that (other examples are skins, particle-affectors and emitters) and it need someone with enough confidence deciding if Irrlicht continues adding those all (making a fat interface as each type needs 3-4 more functions) or changing the serialization mechanism and making a common factory at a more basic class.

edit: Also at least my implementation is simply a few modifications to zgock's version to get it working for what I needed. Maybe Nalin's is better, but I wouldn't want to have my code for this in the engine (and not even sure about the license as zgock never commented on that).

edit2: Also if someone persuades Nalin to work directly on Irrlicht, I would put my vote in to get him in the team any day.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: TrueType font Support by FreeType Library

Post by robmar »

Can it be so much work to add good font support to Irrlicht with the FreeType library, and as its open platform, it´ll would comply with the coding rules. What about the MagicLibray code, I think that uses FreeType too, but it isn´t cross-platform... and adding font extrusion to 3D would also be a nice feature (dream on!). I could do it, if I get the time, but you guys would be able to do it much faster as you´ve got most of it up and running...
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: TrueType font Support by FreeType Library

Post by CuteAlien »

Uhm, what I just wrote... this isn't about font-rendering. It's a problem of serialization which is blocking this. You can already use any of the extensions if all you need is ttf-rendering.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: TrueType font Support by FreeType Library

Post by robmar »

okay but is there a working sample of ttf fonts with Irrlicht 1.7.2?

I looked at the earlier post couldn´t find a sample or docs, so digging through it from scratch is the only way then?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: TrueType font Support by FreeType Library

Post by CuteAlien »

I think the one on my website should work (if not I'll have to update it). And the link I posted above to Nalin's code also should work.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: TrueType font Support by FreeType Library

Post by robmar »

Okay, thanks, I´ll give your code a try first, and post the results.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: TrueType font Support by FreeType Library

Post by hybrid »

Damn it, my comment didn't make it last time. Anyway, besides what has been said already, I wanted to add that a) MagicLib was only nice until you chose a different setup than what the creator of that lib used, because then everything crashed. and b) that I'd say that having a non-serializable font is probably better than just having none at all.
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: TrueType font Support by FreeType Library

Post by robmar »

Don´t you just need to serialize the font name and other details, there are a few basic structures for this, LogFont could be used on any platform, not just windows, and maybe its not necessary to serialize all the details, just enough to enable reselection on reloading... or is there a complication?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: TrueType font Support by FreeType Library

Post by hybrid »

Yes, there is...
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: TrueType font Support by FreeType Library

Post by CuteAlien »

Yes, it's not much to serialize. It's "just" an architectural problem - making interfaces rather fat (adding lots of factories for all the type I mentioned above) or rewriting the current system somewhat so a base-factory can handle all types in future. But I have no idea what is preferable and don't dare working on that because I _know_ I don't have enough experience to make such decisions well. At least not without investing more time thinking about that than I've had the last years. Sorry, but I'm always very scared of changing anything before it's thought through completely, because once you wrecked up something it often stays for years.

edit: Also for reloading I think there might have been another problem with releasing textures, something I notices way too late after adding a removeFont function which now does not work as it should and can't be fixed *sigh*

edit2: I certainly also _want_ ttf-font support and realize I'm making lots of excuses here, because I plainly don't manage to code as much for Irrlicht as I want to (for all kind of stupid reasons).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply