newsGNU FreeDink - News


More work on fonts; sound

Item posted by Sylvain Beucler <Beuc> on Mon 19 Nov 2007 07:37:34 PM UTC.

I managed to display fonts with exactly the same metrics than the original game (that is, the same as MS Woe does). This involved finding the good size ratio, finding how to reproduce semi-boldness, finding metric-compatible replacements for arial.ttf and vgasys.fon (used by Dinkedit), writing sample programs and checking results under Woe and Wine, using different versions of FreeType (with or without the bytecode interpreter enabled - yes, rendering TrueType fonts does involve a virtual machine, who knew? :)).

I also reworked the text wrapping code from sabetts, and fixed title placement in text dialogs (tip: when text is marked as vertically aligned in the Dink source code, well, that actually never worked ;)).

It was pretty interested to dive into the work of font rendering - but thanksfully I could reuse existing libraries as-is and avoid writing lots of code.

Now I'm on one of the last missing features: changeable sound frequency for sound effects (playing the same sound very slowly or very quickly to get totally different results).

SDL_mixer does not provide that feature, but there're chances I can find a workaround, without having to try and combine SDL_mixer with another sound library such as Allegro's or OpenAL, which both support frequency changes. I find sticking to SDL_mixer important because that's the only library that decently plays MIDIs (and also, to a less extent, audio CDs sound tracks).

Back to the top

Powered by Savane 3.13-4448.
Corresponding source code