This is an OpenSCAD library to generate pixelly fonts, mostly based on some PalmOS bitmap fonts from Ron Buelow. There are 29 fonts included.
I used it to make a Minecraft-themed text topper for a birthday cake. The full library code is here -- the downloads for this Thing just include a self-contained demo file.
To use, start with:
The syntax for the main library call, with defaults indicated, is:
string: text to render; only characters included in the CP-1252 character set are supported; other characters will be turned to spaces
font: font to use; the fonts are defined in fontdata.scad
halign: horizontal alignment: "left", "right" or "center"
valign: vertical alignment: "bottom", "top" or "center"
invert: set to
true if you want to draw the background instead of the characters
spacing: scale for character spacing
size: height of characters
pixelScale: the scaling to apply to the pixels; if you increase it noticeably above 1, the pixels will join up more, and if you decrease it below 1, you'll get blank space around them
height height to extrude pixels; set to 0 to make pixels 2D
You can also use
renderString() as a modifier for a shape. In that case,
height are ignored, and instead the shape is used as a pixel. For instance, you can do this to make foreground pixels be large circles and background pixels be small circles:
If you want to know how much horizontal space text will take up, you can call
getStringWidth(string[,options]) where the available options are the
size options that
If you want to know how many pixels high characters in a font are, call
getFontHeight(font). You can then compute the size of an individual pixel as
size is the
size parameter for