Brickley Roscowicz Engineering

Search

Main Menu

Rosco's Menu

This is a utility I wrote basically to be able to produce virtual stickers for my LDraw models. It allows you to choose any scalable typeface, and create a LDraw file containing a representation of any string in that typeface.

This is currently beta software. Use it at your own risk. Please send any comments/suggestions/bugs to
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

By default, the LDraw commands are output to stdout, and all other output is to stderr, so the LDraw file can be captured by re-directing stdout to a file. As of version 0.2.0, the output can also be sent to a file using the -o option.

Add a string of characters to the output.Characters are added in the order they appear on the command line.

-w

Specify width of bounding box (in LDU).Default width is least multiple of 20 LDU (one stud) greater than total width of characters.The text will be centred in the bounding box, and about the z axis

-x

Don't create bounding box.

-D

Specify debug level (Only available when compiled from source).Default is 3.

fontfile

The full path to an existing scalable font file. If not supplied, the default internal font will be used.

Example:

txt2dat -s Hello -c 4 -p 72 c:\windows\fonts\arial.ttf >hello.dat

Produces the file "hello.dat" containing the string "Hello" in red 72 point Arial on a white background.

Notes:

Using the transparent option for colours (eg: -b -) is not the same as choosing trans white (colour 47). The latter produces triangles of colour 47 which will be rendered by your viewer, the former produces no triangles at all.

The default internal font doesn't include any kerning information, so the -k option will make no difference when using that font.

ASCII characters (-a) are specified one at a time as decimal numbers, eg: -a 67 -a 65

I don't recommend using anything other than the default (-r 0) for spline resolution. In particular, using the maximum setting (-r 1) can consume very large amounts of memory.

Jim DeVona has now created an online version of txt2dat. You can control almost every txt2dat option, including font size and color. It is also possible to upload your own font. Just enter some text and click a button to download an LDraw “sticker” part with that text stamped right on it. You can find Jim's page here. Note I have nothing to do with that program - please contact Jim for any information!

Anders Isaksson has written a quick little Windows graphical front end for txt2dat, called quitx2d. You can read about it here, and download it here. Note I have nothing to do with that program - please contact Anders for any information!

Don Heyse also whipped up a quick TCL / Tk graphical front end - you can read about it here. Note I have nothing to do with that program - please contact Don for any information!