[OpenSCAD] 3D Text

Clifford Wolf clifford at clifford.at
Sat Mar 20 18:15:09 CET 2010


On Fri, Mar 19, 2010 at 11:27:09PM +0100, Marius Kintel wrote:
> The real solution for text would be to interface directly with freetype,
> or a higher-level library on top of that if we can find smth. useful.
> This is on the TODO list - we're just slighty short of developer
> resources :/

afaik freetype does not support rendering to a vector backend but always
generates pixel maps.

My current plan for this is the following:

1. implement an svgpath() statement that creates a 2d object from an svg
path (I probaly could reuse some code from [1] for this).

2. implement a function that can convert a string into an array of

3. write a simple perl/awk/whatever script that reads in an svg font
file (they look like [2]), extracts all <glyph> entities and spits out an
SCAD module that converts a string into a union of svgpath() statements.

non-monospace fonts would probably need some additional functions
(calculating sums using the entries from lists, etc) that would
probably be handy to have for many other cases too.

 - clifford

[1] http://svn.clifford.at/ecad4g/trunk/shapes/primitives.cc
[2] http://svn.clifford.at/ecad4g/trunk/modules/kernel/fonts/Mono.svg

Some languages are designed to solve a problem. Others are designed to
prove a point.

More information about the Openscad mailing list