libDXF 0.0.1
A library with DXF related functions written in C.
Data Structures | Typedefs | Functions

text.h File Reference

Definition of a DXF text entity (TEXT). More...

#include "global.h"
Include dependency graph for text.h:
This graph shows which files directly or indirectly include this file:

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

DxfTextdxf_text_new ()
 Allocate memory for a DxfText.
DxfTextdxf_text_init (DxfText *text)
 Allocate memory and initialize data fields in a TEXT entity.
DxfTextdxf_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.

Detailed Description

Definition of a DXF text entity (TEXT).

Author:
Copyright (C) 2008, 2010, 2012, 2014, 2015, 2016, 2017 by Bert Timmerman <bert.timmerman@xs4all.nl>.
Copyright (C) 2012 by Paolo Caroni <kenren89@gmail.com>.

Copyright Notices.


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.


Typedef Documentation

typedef struct dxf_text DxfText

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.

Version:
According to DXF R10.
According to DXF R11.
According to DXF R12.
According to DXF R13.
According to DXF R14.

Function Documentation

DxfText* dxf_text_new ( )

Allocate memory for a DxfText.

Fill the memory contents with zeros.

Version:
According to DXF R10.
According to DXF R11.
According to DXF R12.
According to DXF R13.
According to DXF R14.

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().

DxfText* dxf_text_init ( DxfText text)

Allocate memory and initialize data fields in a TEXT entity.

Returns:
NULL when no memory was allocated, a pointer to the allocated memory when succesful.
Version:
According to DXF R10.
According to DXF R11.
According to DXF R12.
According to DXF R13.
According to DXF R14.
Parameters:
texta 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().

Here is the call graph for this function:

DxfText* dxf_text_read ( DxfFile fp,
DxfText text 
)

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.

Returns:
EXIT_SUCCESS when done, or EXIT_FAILURE when an error occurred.
Version:
According to DXF R10.
According to DXF R11.
According to DXF R12.
According to DXF R13.
According to DXF R14.
Parameters:
fpfilepointer to the input file (or device).
texta 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.

Here is the call graph for this function:

int dxf_text_write ( DxfFile fp,
DxfText text 
)

Write DXF output to fp for a text entity.

Version:
According to DXF R10.
According to DXF R11.
According to DXF R12.
According to DXF R13.
According to DXF R14.

Todo:
for version R14.
Implementing the start of application-defined group "{application_name", with Group code 102.
For example: "{ACAD_REACTORS" indicates the start of the AutoCAD persistent reactors group.

application-defined codes: Group codes and values within the 102 groups are application defined (optional).

End of group, "}" (optional), with Group code 102.

Parameters:
fpDXF file pointer to an output file (or device).
texta 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.

Here is the call graph for this function:

int dxf_text_free ( DxfText text)

Free the allocated memory for a DXF TEXT and all it's data fields.

Returns:
EXIT_SUCCESS when done, or EXIT_FAILURE when an error occurred.
Version:
According to DXF R10.
According to DXF R11.
According to DXF R12.
According to DXF R13.
According to DXF R14.
Parameters:
texta 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.

Version:
According to DXF R10.
According to DXF R11.
According to DXF R12.
According to DXF R13.
According to DXF R14.
Parameters:
textsa 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.

Here is the call graph for this function: