Mod_ttf

Started by Sandman, October 10, 2009, 11:00:30 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DCelso

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/

DCelso

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/

DCelso

#32
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.
Monstruos Diabólicos

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

Windgate

#33
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):

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

Sandman

@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

Windgate

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

splinter_work

excelent my friend!

kup!

FreeYourMind

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 )


SplinterGU

Quote from: FreeYourMind on July 02, 2011, 10: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 )

you must upgrade it...

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