Log In  

Cart #vectfont-0 | 2020-01-24 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3

This is a custom font library. You can create your own font. Just use the matrix to set the drawing of the char. Use a dot a the begin of each line. The drawing for the letter 'F' can be '.PAC.FG'. Put the pen in P then a line to A and from A to C. Next, put the pen in F and draw a line to G.

f='.pac.fg'

Sampe of use:

function _draw()
 cls(5)
 font:drawtext(3,10,'t⬇️his is a way to create custom',7)
 font:drawtext(3,20,'⬇️vector ⬆️font.',7)
 font:size(4,5)
 font:drawtext(11,52,'s⬇️ize matters!',1)
 font:drawtext(10,50,'s⬇️ize matters!',14)
 font:size(2)
 line(55,113,127,113,8)
 font:drawtext(56,105,'⬇️picoscope101.fr',7)
end
P#72211 2020-01-24 11:22

1

interesting coordinate system!
much easier than specifying coords (though less precise)

hum - performance wise I was expecting some kind of ‘compilation’ of the glyphs definitions.

P#72214 2020-01-24 15:11 ( Edited 2020-01-24 15:15)
2

You know this is quite nice. Now I would've =encoded= the font using letters as you have here, but I never considered having the letters also part of the input instead of using arrow keys and (O) to mark and draw vectors.

Gold Star for genius thinking here, @jihem.

P#72217 2020-01-24 16:39 ( Edited 2020-01-24 17:18)

@freds72, @dw817
Thanks for you nice comments. I will work on it to optimize and adding functions: font:textwidth,...

P#72251 2020-01-26 09:13

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-29 06:19:50 | 0.027s | Q:22