This project has moved. For the latest updates, please go here.

.net dxf writing text

Sep 7, 2014 at 8:20 PM
Hi, I was wondering if I could load a custom ttf and/or otf (true type and opentype) fonts and write some text to a specific size and make an *.dxf file with it. All from code (C#) by the way. Or should I convert the font and text to a points array or something?

Best regards,
Sep 8, 2014 at 4:31 PM
There are two entities to handle text in a dxf. The Text entity for single line texts, and the MText entity for multiline texts; both use the TextStyle object that controls among other things the font file to use. The dxf specification does not really care about the font format, at least it does not say anything about it, it needs a font file. It will be the responsibility of the program that reads the dxf how to render the text. For example, AutoCad understands true type fonts and shx (an old Autodesk format used for shapes and fonts), and, I think, it is not compatible with opentype.

The best source of information is the actual AutoCad user's guide that you can find online at The dxf format is a close representation of the internal AutoCad drawing database, and there you will find detailed information about the different entities, keep in mind that this library does not support all of them.