Upon finding that importing your own fonts into Codea’s font library simply isn’t possible, I wanted to challenge any of you professional Codea coders out there with lot’s of free time to create a one class function that looks something like this:
function text(string,x,y,size,textmode)
--Code goes here
end
Within this function there should preferably be clearly marked sprite inputs for each basic character (A-Z, 0-9, and all of the punctuation characters). The whole idea for this function is to make something that enables a person to design their own font set in the form of a series of sprites, each with a character in that font set, and then insert each of these characters into the appropriate sprite plugins within the function’s output. This person could then hypothetically be able to call this function any number of times with the string they want drawn, that string’s x and y position, that string’s size, and the strings textmode (CENTER, or CORNER), which would draw the appropriate sprites lined up to form the text he entered while following the parameters he set. An example of this function being called would look like this:
text("Hello123.",100,200,50,CENTER)
This would not only help me but a lot of other people who wish to include text with custom fonts in their projects that really follow their design style. This alone shouldn’t be an easy task, but if any of you really wanted to make the project more challenging or improve the functions variety, another parameter that could be added to the function would be: linewidth, which would determine how long a single line of text could be, for those who want to write multi-lined paragraphs. Any input is appreciated.