Autor Tema: Pango  (Leído 4694 veces)

0 Usuarios y 1 Visitante están viendo este tema.

Desconectado josebita

  • Administrator
  • Hero Member
  • *****
  • Mensajes: 4039
  • Karma: 257
  • Sexo: Masculino
    • Ver Perfil
    • BennuGD Mobile Worklog
Pango
« en: Diciembre 28, 2008, 04:35:52 pm »
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.
« última modificación: Enero 01, 2009, 02:59:35 pm por josebita »

Desconectado Sandman

  • Sr. Member
  • ****
  • Mensajes: 298
  • Karma: 48
  • Sexo: Masculino
    • Ver Perfil
Re: Pango
« Respuesta #1 en: Diciembre 30, 2008, 06:12:25 pm »
This looks very interesting. Hope to see a Windows version.
-- Sandman

Desconectado josebita

  • Administrator
  • Hero Member
  • *****
  • Mensajes: 4039
  • Karma: 257
  • Sexo: Masculino
    • Ver Perfil
    • BennuGD Mobile Worklog
Re: Pango
« Respuesta #2 en: Enero 01, 2009, 03: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.
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?

Desconectado Sandman

  • Sr. Member
  • ****
  • Mensajes: 298
  • Karma: 48
  • Sexo: Masculino
    • Ver Perfil
Re: Pango
« Respuesta #3 en: Enero 01, 2009, 04:20:29 pm »
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

Desconectado josebita

  • Administrator
  • Hero Member
  • *****
  • Mensajes: 4039
  • Karma: 257
  • Sexo: Masculino
    • Ver Perfil
    • BennuGD Mobile Worklog
Re: Pango
« Respuesta #4 en: Enero 02, 2009, 04:29:19 pm »
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:

Desconectado Sandman

  • Sr. Member
  • ****
  • Mensajes: 298
  • Karma: 48
  • Sexo: Masculino
    • Ver Perfil
Re: Pango
« Respuesta #5 en: Octubre 20, 2009, 06:34:56 am »
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

Desconectado josebita

  • Administrator
  • Hero Member
  • *****
  • Mensajes: 4039
  • Karma: 257
  • Sexo: Masculino
    • Ver Perfil
    • BennuGD Mobile Worklog
Re: Pango
« Respuesta #6 en: Octubre 20, 2009, 09:01:42 am »
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 :(