Hi, everyone,
I have a problem about the font render. Currently I got the subtitle file using debug function in scummvm, so I want to draw the TTF font with SDL_ttf() to the graphic surface directly, but I failed every time. my problem is if it's possible to add the ttf_font support to the scumm engine conveniently? If possible, it will make life easier when we want to add multi-language support to scummvm.
Thanks for your valuable suggestions!
Is it possible to add TTF font support in the scumm engine?
Moderator: ScummVM Team
Adding support for Truetype fonts (TTF format) would be desirable, and has been considered in the part, e.g. as part of GSoC (Google Summer of Code) project proposals. It is, however, not without problems. In particular, TTF font rendering incurs an overhead in terms of binary size, memory and CPU usage etc. -- and it might be (resp. almost certainly is) just too much for some of the lower spec devices we support. Hence such code would have to be optional.
Also, using SDL_ttf would only work for the SDL backend, but many of our backends are not based on that. It would be much better to use FreeType directly.
AFAIK, no team member is planning to do any work on this at this time, though. If you are interested in this subject, I strongly recommend talking about it on the -devel mailing list, not here.
Also, using SDL_ttf would only work for the SDL backend, but many of our backends are not based on that. It would be much better to use FreeType directly.
AFAIK, no team member is planning to do any work on this at this time, though. If you are interested in this subject, I strongly recommend talking about it on the -devel mailing list, not here.
- eriktorbjorn
- ScummVM Developer
- Posts: 3561
- Joined: Mon Oct 31, 2005 7:39 am
Wasn't that just for the ScummVM GUI? When I read vimrc's post I thought he meant adding it to the SCUMM engine specifically, even though that does sound a bit odd to me.fingolfin wrote:Adding support for Truetype fonts (TTF format) would be desirable, and has been considered in the part, e.g. as part of GSoC (Google Summer of Code) project proposals.
I will check my code again. Sometimes it's a little difficult to zoom in/out the fonts into a proper size. Moreover, for several Asian characters, we have to adjust the font render code for each engine even for each game, it's quite painful.
Anyway, I will try to move on and will post my problem in the dev maillist later. Thank you again.
Anyway, I will try to move on and will post my problem in the dev maillist later. Thank you again.
We are from ChinaAVG forum (www.chinaavg.com). With the help of the forum's moderator Shane007, we are translating the retro games such as FT, Indy series, Broken sword 1/2 etc, and publish the language patches free. Here are an successful font patch in FT:
FT:
However, we meet a problem in indy4. That is the font size is difficult to adjust, so it overlapped the dialog separator bar as the following figure:
We can't make the font smaller or it'll be unclear. At the current stage, we decide to try the true type font, so it's easy to use the bold one or other slender font shapes to prevent this problem. This is our point. Thank you.
FT:
However, we meet a problem in indy4. That is the font size is difficult to adjust, so it overlapped the dialog separator bar as the following figure:
We can't make the font smaller or it'll be unclear. At the current stage, we decide to try the true type font, so it's easy to use the bold one or other slender font shapes to prevent this problem. This is our point. Thank you.
- eriktorbjorn
- ScummVM Developer
- Posts: 3561
- Joined: Mon Oct 31, 2005 7:39 am
There is *some* handling for drawing fonts at a higher resolution. But that handling is always engine specific. So I can't say whether it would be easy to get it to work with SCUMM in a fan made game easily. Some official SCUMM games are using it though, IIRC there's for example a Japanese version of The Dig and of course all FM-Towns games should be Japanese too.eriktorbjorn wrote:Isn't there some mechanism in ScummVM for drawing the font at a higher resolution? I've never had one of those games myself (and wouldn't be able to understand it if I did), so I never paid much attention to the "CJK mode" handling. It's quite possible that I've completely misunderstood it.
(Here's some notes about Japanese The Dig: http://sev-notes.blogspot.com/2008/04/s ... nough.html)
It actually might really require you to patch the ScummVM sources, thus your fan made patches wouldn't work with vanilla ScummVM (we usually don't add extra code for fan made translations). So if you are required to do so, please do not forget to follow the rules of our source code license.vimrc wrote:Errrrr.. It looks like quite promising according to the Japanese the dig. I will check the relevant code, thank you all indeed. You really trigger a new idea for us. :)