Skip to content

Pixelly font library for OpenSCAD

Creation's quality: 5.0/5 (1 vote)
Evaluation of members on the printability, utility, level of detail, etc.

3D model description

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:
include <pixellyfont.scad>
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, pixelScale and 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:
renderString("abc") circle(d=1);
renderString("abc",invert=true) circle(d=0.1);

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 font, spacing and size options that renderString() uses.

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/getFontHeight(font) where size is the size parameter for renderString().

  • 3D file format: STL





Best sellers of the category Art

Add a comment

Would you like to support Cults?

You like Cults and you want to help us continue the adventure independently? Please note that we are a small team of 3 people, therefore it is very simple to support us to maintain the activity and create future developments. Here are 4 solutions accessible to all:

  • ADVERTISING: Disable your AdBlock banner blocker and click on our banner ads.

  • AFFILIATION: Make your purchases online by clicking on our affiliate links here Amazon, Gearbest or Aliexpress.

  • DONATE: If you want, you can make a donation via PayPal here.

  • WORD OF MOUTH: Invite your friends to come, discover the platform and the magnificent 3D files shared by the community!