.net dxf writing text

Sep 7, 2014 at 7: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 3: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 http://help.autodesk.com/view/ACD/2015/ENU/. 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.