Discussion:
[Clanlib-devel] Added SDL System Font Support
bramp
2006-08-09 14:39:01 UTC
Permalink
Hi,
While testing my program under SDL only, I got this exception
"Congratulations! You just got assigned the task of implementing
system fonts for clanSDL :-)"

So I figured I would look into it... and as it turns out all I had to
do was copy and paste the OpenGL code for rendering system fonts. I'm
pretty sure there is no OpenGL specific code in the code I copied, so
that shouldn't be a problem. I also noticed that support for system
fonts on non win32 platforms doesn't exist anymore. There was some
commented X11 code. May I ask why this isn't supported anymore?

Anyway I have attached a patch which makes system fonts now work under
SDL only. The patch is against the 0.8 release, but it applies cleanly
against 0.9.

Enjoy
Andrew
Magnus Norddahl
2006-08-10 02:38:33 UTC
Permalink
Post by bramp
So I figured I would look into it... and as it turns out all I had to
do was copy and paste the OpenGL code for rendering system fonts. I'm
pretty sure there is no OpenGL specific code in the code I copied, so
that shouldn't be a problem. I also noticed that support for system
fonts on non win32 platforms doesn't exist anymore. There was some
commented X11 code. May I ask why this isn't supported anymore?
The system font support in the 0.8 series is rather incomplete, as you
noticed yourself. The reason the X11 version is commented is probably that
it was never finished and ready for usage. Adding system font support in
X11 is a bit more complicated than in Windows, because fonts in Linux have
various competing font servers and font libraries. Although the Windows
system font stuff can most likely be used with SDL, a X11 version requires
the code to know the Display handle used to connect to the X server, and
other more exotic SDL targets would surely not work.

Having said that, I see no reason not to allow the system fonts to work with
SDL in Windows. So applying it to 0.8 would be okay, I think.
Post by bramp
Anyway I have attached a patch which makes system fonts now work under
SDL only. The patch is against the 0.8 release, but it applies cleanly
against 0.9.
The display model used in 0.9 is significantly different from the 0.8
series. The SDL target in 0.9 is old legacy code that won't compile.
Personally I think the amount of clanDisplay features lost will be so great
that making a SDL target makes little sense. Of course if someone is
willing to invest the time in creating a SDL target for 0.9, they are
welcome to do so, but otherwise the target will get removed before the
release of 0.9.0.

--
Magnus Norddahl

Loading...