Main Menu

Pango

Started by josebita, December 29, 2008, 12:35:52 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

josebita

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.
In the spanish post 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:

Rendering non-latin alphabets:


[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.

Sandman

This looks very interesting. Hope to see a Windows version.
-- Sandman

josebita

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.
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?

Sandman

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!
-- Sandman

josebita

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:

Sandman

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.
-- Sandman

josebita

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 :(