Bennu Game Development

English Forums => Extensions => Mensaje iniciado por: josebita en Diciembre 29, 2008, 12:35:52 am

Título: Pango
Publicado por: josebita en Diciembre 29, 2008, 12:35:52 am
Hi all:

Yesterday night and today (and with a bit of help :)) I've created a wrapper library for pango. Pango is the font rendering system for one of the two main linux desktop systems.
It's very useful, as it supports HTML-like markup in texts, so something like this is perfectly valid:
[code language="html4strict"]<span font_family="Arial" size="xx-large" color="#0000ff"><u>Hello</u>, World!</span>[/code]
The full list of supported markup is here (http://library.gnome.org/devel/pango/unstable/PangoMarkupFormat.html).
In the spanish post (http://forum.bennugd.org/index.php?topic=393.msg4668#msg4668) I've attached the code for a very first version of the library, and the library compiled for a 32 bit linux system. It should work just fine in both 32 and 16 color bit modes, but will certainly not work in 16 bits (help appreciated, I believe the problem might be with the 16 bit mask values).
As soon as I fix the problem get some free time, I'll try to compile it for windows.
I've uploaded the windows version, refer to the spanish post for details.
Hope you find it useful.

As usual, screenshots:
Subscript and superscript example:
(http://lh5.ggpht.com/_RDT1BQDk_sQ/SVgYdyfJKiI/AAAAAAAAITE/-GLViQvwgB4/s800/emc2.png)
Rendering non-latin alphabets:
(http://lh4.ggpht.com/_RDT1BQDk_sQ/SVgYeC5DYYI/AAAAAAAAITM/H_TCpZHinw4/s800/Hello%20World.png)

[UPDATE] The 16 bits problem is fixed with some help from SplinterGU and should now work just fine. I've updated the link in the spanish forum with the new version.
Título: Re: Pango
Publicado por: Sandman en Diciembre 31, 2008, 02:12:25 am
This looks very interesting. Hope to see a Windows version.
Título: Re: Pango
Publicado por: josebita en Enero 01, 2009, 11:04:19 pm
I've just uploaded the windows binaries to the wiki. They're quite difficult to compile because of all the dependencies I've had to compile by hand. You can find a step-by-step tutorial to get SDL_Pango compiled in mingw here (http://johnnypops.demon.co.uk/mingw/).
The first thing you have to do is run once "fc-list.exe". This will create the file "etc/fonts/.fonts-cache-1". When distributing your game, be sure to delete this file prior to packaging and then run, while installing, fc-list.exe again.
After that, you should be able to just compile and run the example in the zipfile.

Hope you find it very useful and use it a lot, as it was quite hard to get :)

PS: Sandman, if you believe I'm spamming the wiki, tell me and I'll move the file somewhere else, ok?
Título: Re: Pango
Publicado por: Sandman en Enero 02, 2009, 12:20:29 am
Not at all, you're doing a great job. :) If the wiki is not a good place to store such things, then we'd need a different place. But we don't have a different place now, so it's good. Maybe we need a central place to upload these kind of things to.

Thanks for the build!
Título: Re: Pango
Publicado por: josebita en Enero 03, 2009, 12:29:19 am
I've reuploaded the pack with a binary that was missing.
During installation, be sure to run both ".exe"s.

Ok, so I've tested this with sandman's bennugd wip18 in a machine other than the one I used to compile the library and the result is as follows:
(http://lh3.ggpht.com/_RDT1BQDk_sQ/SV6vrosKcLI/AAAAAAAAIV4/PGR5OlJRKU4/s800/SDLPango.jpg)
Título: Re: Pango
Publicado por: Sandman en Octubre 20, 2009, 02:34:56 pm
The Windows package contains a gazillion files. Are they all needed? In the readme it says something about being able to use a MS backend.
Título: Re: Pango
Publicado por: josebita en Octubre 20, 2009, 05:01:42 pm
I'm pretty positive they're all needed when rendering through freetype.
I should recompile the package for a newer version of the package with a couple of improvements I made. I'll then try to compile the package so that it uses the native windows font rendering functions, and we'll see.

But right now, I'm pretty busy :(