Codesnippets > 2D-snippets

TTF - True Type Fonts

<< < (2/3) > >>

Qedo:
Thanks Gernot for this font engine.
I ask you if you can increase the font resolution that seems very low as you can see from the image. For example, the letter "g" is not rounded as it should be. Is it possible to work on generating the glbvf file?

Schranz0r:
in TTF.gbas:


--- Code: (glbasic) ---FUNCTION pt2px: pt
// points = pixels * 72 / dpi
STATIC dpi = PLATFORMINFO$("DPI")
RETURN pt / 72.0 * dpi  * 50.0 // this factor is by try/error
ENDFUNCTION
--- End code ---

I guess you have to change the DPI in the Editor itself?

Qedo:
It does not work.
I think it depends on how the font was triagolarized previously in the glbvf file

MrPlow:
I haven't tried this yet - but could be very useful for a game I am planning.
On this font system - can the fonts be relocated to the media/fonts/ ?
That way its isn't dependant on the windows setup of the machine?

Schranz0r:
I guess Gernot use SDL_TTF for it.
He need to change the


--- Code: (glbasic) ---ttf_rendertext_solid
--- End code ---

to


--- Code: (glbasic) ---ttf_rendertext_shaded
--- End code ---

then it's smooth :)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version