Vector Font library for Teensy 3.6

MichaelMC

Well-known member
Attached is a vector based font library 'vFont' that I've been working on as part of another project, for a Teensy3.6. vFont features most things one would expect from a vector font library; such as configurable paths', brush types and size and string/glyph orientation. To keep performance up, vFont renders directly to a frame buffer, then written to display whenever (see demo).

Here it is released separately as an easily expandable C API (C, none of this class rubbish here:cool:).
Source: View attachment vfont_210617.zip


Usage example, to draw the base green layer from the attached video:
Code:
// set the initial state
setFont(ctx, &gothiceng);
setGlyphScale(ctx, 4.0f);
setRenderFilter(ctx, RENDEROP_NONE);
setBrush(ctx, BRUSH_DISK);
setBrushStep(ctx, 5.0f);
setBrushSize(ctx, 40.0f);
setBrushColour(ctx, COLOUR_PAL_DARKGREEN);

// now do the rendering
drawString(ctx, "Gothic", x, y);


Animated text:

IMAG0197_1280.jpg
IMAG0224_1280.jpg
 
Last edited:
Looks cool - What display are you using? I see in the code referencing something like usbd480.

I like the demo!
 
Cheers.

Kurte, The display name is USBD480 and is unconnected/separate from the font library. It's a Highspeed USB interfaced display, 16bpp with a resolution of 480x272 (from a PSP) with a touch panel on top, with an 8megabyte fully addressable framebuffer. Basically an MSP30 (if memory recalls) driving an FPGA with a 2046 touch controller wrapped round a composite USB interface. Source code for this is also included in the zip.
Teensy36 has no problem driving this while also handling the full floating point vector [drawing] routines.
 
Hi Michael

This is an old post, I realise, but I just found it and decided to have a go at adapting your code for the Teensy 4.1 and my vstcm vector generator PCB which targets real vector monitors (https://github.com/english1234/vstcm). It works quite well! Here's a quick video (sorry for the awful quality, it looks great in reality):

Regards
Robin
 
Hey Robin, That looks excellent! It's nice to see the code be reused in to something it was never intended for.
Thank you for posting
 
Back
Top