Autor Tema: Mod_ttf  (Leído 13703 veces)

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

Desconectado DCelso

  • Hero Member
  • *****
  • Mensajes: 3707
  • Karma: 180
  • Sexo: Masculino
    • Ver Perfil
Re: Mod_ttf
« Respuesta #30 en: Octubre 13, 2009, 05:46:34 am »
You refer to the libfreetype-6.dll file.
I saw it, too. But In the source code of freetype there is not any parameter to do that the dll file is smaller. I think that it is because now have more funcionality or because the last file is a compressed dll.
You can reduce the .dll using upx to optain a 621kb dll if you need that.
Monstruos Diabólicos

"A PAck of classic GAMEs For BennuGD" en desarrollo
http://code.google.com/p/apagame4be/

Desconectado DCelso

  • Hero Member
  • *****
  • Mensajes: 3707
  • Karma: 180
  • Sexo: Masculino
    • Ver Perfil
Re: Mod_ttf
« Respuesta #31 en: Octubre 13, 2009, 05:49:25 am »
I suggest that you (Josebita and Sandman) use my last ttf.c file, because it have a little no dangerous changes that adapt the source code to the BennuGD nomenclature.
Monstruos Diabólicos

"A PAck of classic GAMEs For BennuGD" en desarrollo
http://code.google.com/p/apagame4be/

Desconectado DCelso

  • Hero Member
  • *****
  • Mensajes: 3707
  • Karma: 180
  • Sexo: Masculino
    • Ver Perfil
Re: Mod_ttf
« Respuesta #32 en: Octubre 13, 2009, 07:08:54 am »
Sandman, I have a present for you for you. I don't  know when is your birthday but it is near :D
You can open your picture with inkscape for doing any modification.
« última modificación: Octubre 13, 2009, 07:12:02 am por DCelso »
Monstruos Diabólicos

"A PAck of classic GAMEs For BennuGD" en desarrollo
http://code.google.com/p/apagame4be/

Desconectado Windgate

  • Hero Member
  • *****
  • Mensajes: 2930
  • Karma: 124
  • Sexo: Masculino
    • Ver Perfil
    • TRINIT Asociación de Informáticos de Zaragoza
Re: Mod_ttf
« Respuesta #33 en: Octubre 13, 2009, 12:21:12 pm »
A suggestion:

Wouldn,t be "easy" to change mod_ttf source in order to build the font filled with a pattern (texture) instead of a fixed rgba?

Only a suggestion... ;)

Thanks again and again Sandman

EDIT: I'm taking a look over mod_ttf source:

I think this is the code which filled the font "body" with colour (32 bit):

Código: [Seleccionar]
case 32: {
int r1, g1, b1, a1;
int r2, g2, b2, a2;

gr_get_rgba (bg, &r1, &g1, &b1, &a1);
gr_get_rgba (fg, &r2, &g2, &b2, &a2);
//printf("bg: r%i g%i b%i a%i\n",r1,g1,b1,a1);
//printf("fg: r%i g%i b%i a%i\n",r2,g2,b2,a2);
for (i = 0 ; i < 256 ; i++) {
equiv[i] = gr_rgba32 (
r1 + ( (i*(r2-r1)) >> 8 ),
g1 + ( (i*(g2-g1)) >> 8 ),
b1 + ( (i*(b2-b1)) >> 8 ),
a1 + ( (i*(a2-a1)) >> 8 ));
//printf("equiv[%i]: r%i g%i b%i a%i\n",i,r1 + ( (i*(r2-r1)) >> 8 ),g1 + ( (i*(g2-g1)) >> 8 ),b1 + ( (i*(b2-b1)) >> 8 ),a1 + ( (i*(a2-a1)) >> 8 ));
}
break;

I understand that bg is the variable that holds the fixed colour, and it could use map_get_pixel ( ) or similar in order to run trough a texture and stablishing at bg the colour found at that texture...

Could I use map_get_pixel ( ) at the source code of mod_ttf (I think is C)?

Bennu as embed script culd be the solution?

lol
« última modificación: Octubre 13, 2009, 12:29:52 pm por Windgate »
Iván García Subero. Programador, profesor de informática, monitor de actividades culturales y presidente de TRINIT Asociación de Informáticos de Zaragoza. http://trinit.es

Desconectado Sandman

  • Sr. Member
  • ****
  • Mensajes: 298
  • Karma: 48
  • Sexo: Masculino
    • Ver Perfil
Re: Mod_ttf
« Respuesta #34 en: Octubre 13, 2009, 03:36:24 pm »
@Windgate:
Ultimately, using a texture is possible, but not the way you describe. The equiv[] holds the gradients from the foreground colour to the background color. This array could be specified by the user, but that wouldn't add much if you ask me.
Adding texture support is possible though and maybe not even that much more work. Maybe...

@DCelso:
You can use the command strip to strip debug symbols from the dll. Your ttf.c file looks fine to me, it can be used in the package. Thanks for the avatar and yes, my birthday is next month. :)
-- Sandman

Desconectado Windgate

  • Hero Member
  • *****
  • Mensajes: 2930
  • Karma: 124
  • Sexo: Masculino
    • Ver Perfil
    • TRINIT Asociación de Informáticos de Zaragoza
Re: Mod_ttf
« Respuesta #35 en: Octubre 13, 2009, 09:32:40 pm »
Thanks Sandman, I dindn't understood the 256 value on that for(), I see it is used to hold "almost any" possible value between both colours ;D

Well, mod_ttf is really good just like it is. If at any moment you/me/someone wants to add the texture support you/me/someone could change the source code ::)

That's all my possible suggestions by now, GOOD job.
Iván García Subero. Programador, profesor de informática, monitor de actividades culturales y presidente de TRINIT Asociación de Informáticos de Zaragoza. http://trinit.es

Desconectado splinter_work

  • Full Member
  • ***
  • Mensajes: 249
  • Karma: 6
    • Ver Perfil
Re: Mod_ttf
« Respuesta #36 en: Octubre 15, 2009, 06:36:20 am »
excelent my friend!

kup!

Conectado FreeYourMind

  • Hero Member
  • *****
  • Mensajes: 5526
  • Karma: 125
  • Sexo: Masculino
    • Ver Perfil
    • GECA soft
Re: Mod_ttf
« Respuesta #37 en: Julio 02, 2011, 02:52:18 am »
I'm porting this module to Pandora.
Splinter you break the compatibility with this module changing the 'libfont' module on release r194 xDDDD

Changes:
int gr_font_new() --> int gr_font_new( int charset, uint32_t bpp )

Conectado FreeYourMind

  • Hero Member
  • *****
  • Mensajes: 5526
  • Karma: 125
  • Sexo: Masculino
    • Ver Perfil
    • GECA soft
Re: Mod_ttf
« Respuesta #38 en: Julio 02, 2011, 03:42:38 am »

Conectado SplinterGU

  • Hero Member
  • *****
  • Mensajes: 12414
  • Karma: 366
  • Sexo: Masculino
    • Ver Perfil
Re: Mod_ttf
« Respuesta #39 en: Julio 02, 2011, 01:12:49 pm »
I'm porting this module to Pandora.
Splinter you break the compatibility with this module changing the 'libfont' module on release r194 xDDDD

Changes:
int gr_font_new() --> int gr_font_new( int charset, uint32_t bpp )

you must upgrade it...

sorry, bennugd project must continue...
Download Lastest BennuGD Release: http://www.bennugd.org/node/2