libDXF 0.0.1
A library with DXF related functions written in C.
|
Definition of a DXF text entity (TEXT
).
More...
#include "global.h"
Go to the source code of this file.
Data Structures | |
struct | dxf_text |
DXF definition of an AutoCAD text entity. More... | |
Typedefs | |
typedef struct dxf_text | DxfText |
DXF definition of an AutoCAD text entity. | |
Functions | |
DxfText * | dxf_text_new () |
Allocate memory for a DxfText . | |
DxfText * | dxf_text_init (DxfText *text) |
Allocate memory and initialize data fields in a TEXT entity. | |
DxfText * | dxf_text_read (DxfFile *fp, DxfText *text) |
Read data from a DXF file into a TEXT entity. | |
int | dxf_text_write (DxfFile *fp, DxfText *text) |
Write DXF output to fp for a text entity. | |
int | dxf_text_free (DxfText *text) |
Free the allocated memory for a DXF TEXT and all it's data fields. | |
void | dxf_text_free_chain (DxfText *texts) |
Free the allocated memory for a chain of DXF TEXT entities and all their data fields. |
Definition of a DXF text entity (TEXT
).
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
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.
You should have received a copy of the GNU General Public License along with this program; if not, write to:
Free Software Foundation, Inc.,
59 Temple Place,
Suite 330,
Boston,
MA 02111 USA.
Drawing eXchange Format (DXF) is a defacto industry standard for the exchange of drawing files between various Computer Aided Drafting programs.
DXF is an industry standard designed by Autodesk(TM).
For more details see http://www.autodesk.com .
Definition in file text.h.
DXF definition of an AutoCAD text entity.
DXFOUT handles ASCII control characters in text strings by expanding the character into a ^ (caret) followed by the appropriate letter.
For example, an ASCII Control-G (BEL, decimal code 7) is output as ^G.
If the text itself contains a caret character, it is expanded to ^ (caret, space).
DXFIN performs the complementary conversion.
DxfText* dxf_text_new | ( | ) |
Allocate memory for a DxfText
.
Fill the memory contents with zeros.
Definition at line 53 of file text.c.
References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_text_init(), and dxf_text_read().
Allocate memory and initialize data fields in a TEXT
entity.
NULL
when no memory was allocated, a pointer to the allocated memory when succesful.text | a pointer to the DXF TEXT entity. |
Definition at line 96 of file text.c.
References _, dxf_text::color, dxf_text::dictionary_owner_hard, dxf_text::dictionary_owner_soft, DXF_COLOR_BYLAYER, DXF_DEBUG_BEGIN, DXF_DEBUG_END, DXF_DEFAULT_LAYER, DXF_DEFAULT_LINETYPE, DXF_DEFAULT_LINETYPE_SCALE, DXF_DEFAULT_VISIBILITY, DXF_MODELSPACE, dxf_text_new(), dxf_text::elevation, dxf_text::extr_x0, dxf_text::extr_y0, dxf_text::extr_z0, dxf_text::height, dxf_text::hor_align, dxf_text::id_code, dxf_text::layer, dxf_text::linetype, dxf_text::linetype_scale, dxf_text::next, dxf_text::obl_angle, dxf_text::paperspace, dxf_text::rel_x_scale, dxf_text::rot_angle, dxf_text::text_flags, dxf_text::text_style, dxf_text::text_value, dxf_text::thickness, dxf_text::vert_align, dxf_text::visibility, dxf_text::x0, dxf_text::x1, dxf_text::y0, dxf_text::y1, dxf_text::z0, and dxf_text::z1.
Referenced by dxf_text_read().
Read data from a DXF file into a TEXT
entity.
The last line read from file contained the string "TEXT".
Now follows some data for the TEXT
, to be terminated with a " 0" string announcing the following entity, or the end of the ENTITY
section marker ENDSEC
.
While parsing the DXF file store data in text
.
EXIT_SUCCESS
when done, or EXIT_FAILURE
when an error occurred.fp | filepointer to the input file (or device). |
text | a pointer to the DXF TEXT entity. |
Definition at line 176 of file text.c.
References _, dxf_file_struct::acad_version_number, AutoCAD_11, AutoCAD_13, dxf_text::color, dxf_text::dictionary_owner_hard, dxf_text::dictionary_owner_soft, DXF_DEBUG_BEGIN, DXF_DEBUG_END, DXF_DEFAULT_LAYER, DXF_DEFAULT_LINETYPE, dxf_entity_skip(), dxf_text_init(), dxf_text_new(), dxf_text::elevation, dxf_text::extr_x0, dxf_text::extr_y0, dxf_text::extr_z0, dxf_file_struct::filename, dxf_file_struct::fp, dxf_text::height, dxf_text::hor_align, dxf_text::id_code, dxf_text::layer, dxf_file_struct::line_number, dxf_text::linetype, dxf_text::linetype_scale, dxf_text::obl_angle, dxf_text::paperspace, dxf_text::rel_x_scale, dxf_text::rot_angle, dxf_text::text_flags, dxf_text::text_style, dxf_text::text_value, dxf_text::thickness, dxf_text::vert_align, dxf_text::visibility, dxf_text::x0, dxf_text::y0, and dxf_text::z0.
Write DXF output to fp for a text entity.
fp | DXF file pointer to an output file (or device). |
text | a pointer to the DXF TEXT entity. |
Definition at line 469 of file text.c.
References _, dxf_file_struct::acad_version_number, AutoCAD_11, AutoCAD_12, AutoCAD_13, AutoCAD_14, dxf_text::color, dxf_text::dictionary_owner_hard, dxf_text::dictionary_owner_soft, DXF_COLOR_BYLAYER, DXF_DEBUG_BEGIN, DXF_DEBUG_END, DXF_DEFAULT_LAYER, DXF_DEFAULT_LINETYPE, DXF_DEFAULT_TEXTSTYLE, dxf_entity_skip(), DXF_FLATLAND, dxf_text::elevation, dxf_text::extr_x0, dxf_text::extr_y0, dxf_text::extr_z0, dxf_file_struct::fp, dxf_text::height, dxf_text::hor_align, dxf_text::id_code, dxf_text::layer, dxf_text::linetype, dxf_text::linetype_scale, dxf_text::obl_angle, dxf_text::paperspace, dxf_text::rel_x_scale, dxf_text::rot_angle, dxf_text::text_flags, dxf_text::text_style, dxf_text::text_value, dxf_text::thickness, dxf_text::vert_align, dxf_text::visibility, dxf_text::x0, dxf_text::x1, dxf_text::y0, dxf_text::y1, dxf_text::z0, and dxf_text::z1.
int dxf_text_free | ( | DxfText * | text | ) |
Free the allocated memory for a DXF TEXT
and all it's data fields.
EXIT_SUCCESS
when done, or EXIT_FAILURE
when an error occurred.text | a pointer to the memory occupied by the DXF TEXT entity. |
Definition at line 697 of file text.c.
References _, dxf_text::dictionary_owner_hard, dxf_text::dictionary_owner_soft, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_text::layer, dxf_text::linetype, dxf_text::text_style, and dxf_text::text_value.
Referenced by dxf_text_free_chain().
void dxf_text_free_chain | ( | DxfText * | texts | ) |
Free the allocated memory for a chain of DXF TEXT
entities and all their data fields.
texts | a pointer to the chain of DXF TEXT entities. |
Definition at line 740 of file text.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_text_free(), and dxf_text::next.