Creating a textured font

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
WarpEnterprises
Prole
Posts: 3
Joined: Fri Nov 16, 2012 5:10 pm

Creating a textured font

Post by WarpEnterprises »

Is it possible to create a textured font?
I now it's possible by using ImageFont, but I was searching for a way to "print" to an image and manipulate the imagedata to get some texture where there is the glyph color set.
But it seems that "print" only works to screen and not to an image. Is this true?
User avatar
substitute541
Party member
Posts: 484
Joined: Fri Aug 24, 2012 9:04 am
Location: Southern Leyte, Visayas, Philippines
Contact:

Re: Creating a textured font

Post by substitute541 »

In short, it's hard to do. And what do you mean " 'print' "? I see you're new to the forums so, welcome :nyu:.
Currently designing themes for WordPress.

Sometimes lurks around the forum.
User avatar
WarpEnterprises
Prole
Posts: 3
Joined: Fri Nov 16, 2012 5:10 pm

Re: Creating a textured font

Post by WarpEnterprises »

...I already suspected that it's not easy :(
Sorry - with "print" I meant love.graphics.print

I think I found a viable solution. First I tried love.graphics.newStencil -> this did not work for print as the whole square of each glyph is masked.

Then I used Canvas to print the text (say in the first 100 lines), draw the texture (after the first 100 lines), then transfer the texture into the text with Canvas:getImageData, getPixel and setPixel, and finally put the imagedata in an image for later use.
User avatar
LPGhatguy
Prole
Posts: 14
Joined: Thu Aug 09, 2012 12:57 am
Location: Montana, United States
Contact:

Re: Creating a textured font

Post by LPGhatguy »

I'd say your best bet is going to be shaders.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 2 guests