*vsy_TextFunBegin - create an instance of a TextFun object vsy_TextFunEnd - destroy an instance of a TextFun object vsy_TextFunError - return TextFun object error flag vsy_TextFunCopy - make a copy of a TextFun object
vsy_TextFunSet - set function pointers Get - get function pointers vsy_TextFunSetObj - set auxiliary object GetObj - get auxiliary object vsy_TextFunAPI - set built-in text functions
vsy_TextFunCloseFile - close file vsy_TextFunConnectFile - connect to preexisting file vsy_TextFunDisconnectFile - disconnect from file vsy_TextFunOpenFile - open file vsy_TextFunQueryFile - query current file
vsy_TextFunBackColor - set background RGB color vsy_TextFunBorderWidth - set table border width vsy_TextFunColumnAlign - set column alignment vsy_TextFunListType - set current list type vsy_TextFunHeadingLevel - set heading level vsy_TextFunRuleWidth - set rule width vsy_TextFunSetMode - set text mode vsy_TextFunTableColor - set table RGB color vsy_TextFunTableWidth - set table width vsy_TextFunTextColor - set text RGB color
vsy_TextFunSpace - character spaces vsy_TextFunString - character string vsy_TextFunImageFile - image file vsy_TextFunHorizontalRule - horizontal rule
vsy_TextFunFormInit - initiate form vsy_TextFunFormTerm - terminate form vsy_TextFunFormAction - perform form action
Before text formatting can occur to a file, a formatting object and associated text function object must be instanced and a file opened. The following illustrates instancing HTMLText and TextFun objects and setting HTML formatting functions.
vsy_HTMLText *htmltext; vsy_TextFun *tf; /* create text function */ tf = vsy_TextFunBegin(); /* create HTML formatting object */ htmltext = vsy_HTMLTextBegin(); /* load text functions for HTML formatting */ vsy_HTMLTextTextFun (htmltext,tf); /* open file */ vsy_TextFunOpenFile (tf,"example.htm");At this point a file is open and ready to receive text. To close a file and terminate text formatting reverse the process described above. The following code fragment illustrates this process:
/* close file */ vsy_TextFunCloseFile (tf); /* delete objects */ vsy_HTMLTextEnd (htmltext); vsy_TextFunEnd (tf);Table of Contents
Text modes are attributes which may be enabled and disabled. If a mode is enabled then all subsequent text primitives are affected by the mode until the mode is disabled. An example of a text mode is enabling and disabling an italics font for text string primitives. Not every primitive is affected by a given mode. For example, image files are not affected by the italics mode.
*vsy_TextFunBegin - create an instance of a TextFun object
vsy_TextFun *vsy_TextFunBegin ()
None
Destroy an instance of a TextFun object using
void vsy_TextFunEnd (vsy_TextFun *textfun)
Return the current value of a TextFun object error flag using
Vint vsy_TextFunError (vsy_TextFun *textfun)
Make a copy of a TextFun object. The private data from the fromtextfun object is copied to the textfun object. Any previous private data in textfun is lost.
void vsy_TextFunCopy (vsy_TextFun *textfun,vsy_TextFun *fromtextfun)
vsy_TextFunSet - set pointer to text function
void vsy_TextFunSet (vsy_TextFun *textfun, Vint type, void (*function)())
textfun Pointer to TextFun object. type Function type being set =TEXTFUN_BACKCOLOR Set BackColor function =TEXTFUN_BORDERWIDTH Set BorderWidth function =TEXTFUN_CLOSEFILE Set CloseFile function =TEXTFUN_CONNECTFILE Set ConnectFile function =TEXTFUN_DISCONNECTFILE Set DisconnectFile function =TEXTFUN_FORMACTION Set FormAction function =TEXTFUN_FORMINIT Set FormInit function =TEXTFUN_FORMTERM Set FormTerm function =TEXTFUN_HEADINGLEVEL Set HeadingLevel function =TEXTFUN_HORIZONTALRULE Set HorizontalRule function =TEXTFUN_IMAGEFILE Set ImageFile function =TEXTFUN_LISTTYPE Set ListType function =TEXTFUN_OPENFILE Set OpenFile function =TEXTFUN_QUERYFILE Set QueryFile function =TEXTFUN_RULEWIDTH Set RuleWidth function =TEXTFUN_SETMODE Set SetMode function =TEXTFUN_SPACE Set Space function =TEXTFUN_STRING Set String function =TEXTFUN_TABLECOLOR Set TableColor function =TEXTFUN_TABLEWIDTH Set TableWidth function =TEXTFUN_TEXTCOLOR Set TextColor function function Pointer to text function
None
Get function as an output argument using
void vsy_TextFunGet (vsy_TextFun *textfun, Vint type, void (**function)())
vsy_TextFunSetObj - set pointer to auxiliary object
void vsy_TextFunSetObj (vsy_TextFun *textfun, Vobject *obj)
textfun Pointer to TextFun object. obj Pointer to auxiliary object
None
Get obj as an output argument using
void vsy_TextFunGetObj (vsy_TextFun *textfun, Vobject **obj)
vsy_TextFunAPI - set built-in text functions
void vsy_TextFunAPI (vsy_TextFun *textfun, Vint api)
textfun Pointer to TextFun object. api Type of built-in text function to return. =TEXTFUN_APIPRINT Set printing text functions =TEXTFUN_APIRETURN Set return text functions
None
vsy_TextFunCloseFile - close file
void vsy_TextFunCloseFile (vsy_TextFun *textfun)
textfun Pointer to TextFun object.
None
vsy_TextFunConnectFile - connect to preexisting file
void vsy_TextFunConnectFile (vsy_TextFun *textfun, FILE *fd)
textfun Pointer to TextFun object. fd File descriptor of file to connect to
None
vsy_TextFunDisconnectFile - disconnect from file
void vsy_TextFunDisconnectFile (vsy_TextFun *textfun)
textfun Pointer to TextFun object.
None
vsy_TextFunOpenFile - open file
void vsy_TextFunOpenFile (vsy_TextFun *textfun Vchar *pathname)
textfun Pointer to TextFun object. pathname Name of file to open
None
vsy_TextFunQueryFile - query current file
void vsy_TextFunQueryFile (vsy_TextFun *textfun, FILE **fd)
textfun Pointer to TextFun object.
fd Current connected or opened file descriptor
vsy_TextFunBackColor - set background RGB color
void vsy_TextFunBackColor (vsy_TextFun *textfun, Vfloat c[3])
textfun Pointer to TextFun object. c Current background color RGB values
None
vsy_TextFunBorderWidth - set table border width
void vsy_TextFunBorderWidth (vsy_TextFun *textfun, Vint borderwidth)
textfun Pointer to TextFun object. borderwidth Width of table cell borders in pixels, borderwidth >= 0
None
vsy_TextFunColumnAlign - set column alignment
void vsy_TextFunColumnAlign (vsy_TextFun *textfun, Vint align)
textfun Pointer to TextFun object. align Table column alignment =SYS_TEXT_LEFT Left =SYS_TEXT_RIGHT Right =SYS_TEXT_MIDDLE Middle
None
vsy_TextFunListType - set current list type
void vsy_TextFunListType (vsy_TextFun *textfun, Vint listtype)
textfun Pointer to TextFun object. listtype Current listtype =SYS_TEXT_UNORDERED Unordered list =SYS_TEXT_ORDERED Ordered list =SYS_TEXT_MENU Menu list
None
vsy_TextFunHeadingLevel - set heading level
void vsy_TextFunHeadingLevel (vsy_TextFun *textfun, Vint level)
textfun Pointer to TextFun object. level Heading level 1 <= level <= 5.
None
vsy_TextFunRuleWidth - set rule width
void vsy_TextFunRuleWidth (vsy_TextFun *textfun, Vint rulewidth)
textfun Pointer to TextFun object. rulewidth Current horizontal rule width
None
vsy_TextFunSetMode - set text mode
void vsy_TextFunSetMode (vsy_TextFun *textfun, Vint mode, Vint flag)
textfun Pointer to TextFun object. mode Text mode =SYS_TEXT_BOLD Bold font =SYS_TEXT_CENTER Center text =SYS_TEXT_ITALICS Italics font =SYS_TEXT_PREFORMATTED Preformatted text =SYS_TEXT_TYPEWRITER Typewriter font =SYS_TEXT_HANDLEERR Invoke error handler flag Mode flag =SYS_OFF Turn mode off =SYS_ON Turn mode on
None
The SYS_TEXT_BOLD mode is used to format text using the bold form of the current font. By default SYS_TEXT_BOLD mode is off.
The SYS_TEXT_CENTER mode is used to center text. By default SYS_TEXT_CENTER mode is off.
The SYS_TEXT_ITALICS mode is used to format text using the italic form of the current font. By default SYS_TEXT_ITALICS mode is off.
The SYS_TEXT_PREFORMATTED mode is used to format text in a preformatted form. By default SYS_TEXT_PREFORMATTED mode is off.
The SYS_TEXT_TYPEWRITER mode is used to format text using a monospaced font. By default SYS_TEXT_TYPEWRITER mode is off.
The SYS_TEXT_HANDLEERR mode is used to toggle invoking the error handler if an error is detected. In some applications an error handler is used which utilizes text functions. If an error occurs within the text functions it is possible to create an infinite loop of the text functions calling themselves. By default SYS_TEXT_HANDLEERR mode is off.
vsy_TextFunTableColor - set table RGB color
void vsy_TextFunTableColor (vsy_TextFun *textfun, Vfloat c[3])
textfun Pointer to TextFun object. c Current table color RGB values
None
vsy_TextFunTableWidth - set table width
void vsy_TextFunTableWidth (vsy_TextFun *textfun, Vint tablewidth)
textfun Pointer to TextFun object. tablewidth Width of table in percent of page, tablewidth >= 0
None
vsy_TextFunTextColor - set text RGB color
void vsy_TextFunTextColor (vsy_TextFun *textfun, Vfloat c[3])
textfun Pointer to TextFun object. c Current text color RGB values
None
vsy_TextFunSpace - character spaces
void vsy_TextFunSpace (vsy_TextFun *textfun, Vint nspaces)
textfun Pointer to TextFun object. nspaces Number of character spaces in space primitive
None
vsy_TextFunString - character string
void vsy_TextFunString (vsy_TextFun *textfun, const Vchar *string)
textfun Pointer to TextFun object. string Character string primitive
None
vsy_TextFunImageFile - image file
void vsy_TextFunImageFile (vsy_TextFun *textfun, Vchar *pathname)
textfun Pointer to TextFun object. pathname Name of image file primitive
None
vsy_TextFunHorizontalRule - horizontal rule
void vsy_TextFunHorizontalRule (vsy_TextFun *textfun)
textfun Pointer to TextFun object.
None
vsy_TextFunFormInit - initiate form
void vsy_TextFunFormInit(vsy_TextFun *textfun, Vint form)
textfun Pointer to TextFun object. form Text form =SYS_TEXT_TITLE Page title =SYS_TEXT_HEADING Heading =SYS_TEXT_LIST List =SYS_TEXT_ITEM List item =SYS_TEXT_TABLE Table =SYS_TEXT_COLUMN Table column =SYS_TEXT_ROW Table row
None
vsy_TextFunFormTerm - terminate form
void vsy_TextFunFormInit(vsy_TextFun *textfun, Vint form)
textfun Pointer to TextFun object. form Text form
None
vsy_TextFunFormAction - perform form action
void vsy_TextFunFormAction (vsy_TextFun *textfun, Vint formaction)
textfun Pointer to TextFun object. formaction Text form action =SYS_TEXT_PARAGRAPH Paragraph break =SYS_TEXT_LINEBREAK Line break
None
The action SYS_TEXT_PARAGRAPH marks the beginning of a new paragraph. A line break is performed and a blank line is inserted.
The action SYS_TEXT_LINEBREAK forces text immediately after the line break onto the next line.
*vsy_TextTeeBegin - create an instance of a TextTee object vsy_TextTeeEnd - destroy an instance of a TextTee object vsy_TextTeeError - return TextTee object error flag
vsy_TextTeeTextFun - fill TextFun object vsy_TextTeeSetObject - set pointers to output text functions.
*vsy_TextTeeBegin - create an instance of a TextTee object
vsy_TextTee *vsy_TextTeeBegin ()
None
Destroy an instance of a TextTee object using
void vsy_TextTeeEnd (vsy_TextTee *texttee)
Return the current value of a TextTee object error flag using
Vint vsy_TextTeeError (vsy_TextTee *texttee)
vsy_TextTeeTextFun - return pointers to text functions
void vsy_TextTeeTextFun (vsy_TextTee *texttee, vsy_TextFun *textfun)
texttee Pointer to TextTee object. textfun Pointer to TextFun object to be filled with text functions
None
vsy_TextTeeSetObject - set pointers to output text function objects
void vsy_TextTeeSetObject (vsy_TextTee *texttee, Vint objecttype, Vobject *object)
texttee Pointer to TextTee object. objecttype The name of the object type to be set. =VSY_TEXTFUN TextFun object =VSY_TEXTFUN_TEE TextFun object =VSY_TEXTFUN_0 TextFun object =VSY_TEXTFUN_1 TextFun object =VSY_TEXTFUN_2 TextFun object =VSY_TEXTFUN_3 TextFun object =VSY_TEXTFUN_4 TextFun object =VSY_TEXTFUN_5 TextFun object =VSY_TEXTFUN_6 TextFun object =VSY_TEXTFUN_7 TextFun object object Pointer to the object to be set.
None
*vsy_PlainTextBegin - create an instance of a PlainText object vsy_PlainTextEnd - destroy an instance of a PlainText object vsy_PlainTextError - return PlainText object error flag
vsy_PlainTextTextFun - fill TextFun object vsy_PlainTextSetPageWidth - specify page width
*vsy_PlainTextBegin - create an instance of a PlainText object
vsy_PlainText *vsy_PlainTextBegin ()
None
Destroy an instance of a PlainText object using
void vsy_PlainTextEnd (vsy_PlainText *plaintext)
Return the current value of a PlainText object error flag using
Vint vsy_PlainTextError (vsy_PlainText *plaintext)
vsy_PlainTextTextFun - return pointers to text functions
void vsy_PlainTextTextFun (vsy_PlainText *plaintext, vsy_TextFun *textfun)
plaintext Pointer to PlainText object. textfun Pointer to TextFun object to be filled with text functions
None
vsy_PlainTextSetPageWidth - specify page width
void vsy_PlainTextSetPageWidth (vsy_PlainText *plaintext, Vint pagewidth)
plaintext Pointer to PlainText object. pagewidth Page width in characters, pagewidth >= 20
None
*vsy_HTMLTextBegin - create an instance of a HTMLText object vsy_HTMLTextEnd - destroy an instance of a HTMLText object vsy_HTMLTextError - return HTMLText object error flag
vsy_HTMLTextTextFun - fill TextFun object
*vsy_HTMLTextBegin - create an instance of a HTMLText object
vsy_HTMLText *vsy_HTMLTextBegin ()
None
Destroy an instance of a HTMLText object using
void vsy_HTMLTextEnd (vsy_HTMLText *htmltext)
Return the current value of a HTMLText object error flag using
Vint vsy_HTMLTextError (vsy_HTMLText *htmltext)
vsy_HTMLTextTextFun - return pointers to text functions
void vsy_HTMLTextTextFun (vsy_HTMLText *htmltext, vsy_TextFun *textfun)
htmltext Pointer to HTMLText object. textfun Pointer to TextFun object to be filled with text functions
None
*vsy_LaTeXTextBegin - create an instance of a LaTeXText object vsy_LaTeXTextEnd - destroy an instance of a LaTeXText object vsy_LaTeXTextError - return LaTeXText object error flag
vsy_LaTeXTextTextFun - fill TextFun object
*vsy_LaTeXTextBegin - create an instance of a LaTeXText object
vsy_LaTeXText *vsy_LaTeXTextBegin ()
None
Destroy an instance of a LaTeXText object using
void vsy_LaTeXTextEnd (vsy_LaTeXText *latextext)
Return the current value of a LaTeXText object error flag using
Vint vsy_LaTeXTextError (vsy_LaTeXText *latextext)
vsy_LaTeXTextTextFun - return pointers to text functions
void vsy_LaTeXTextTextFun (vsy_LaTeXText *latextext, vsy_TextFun *textfun)
latextext Pointer to LaTeXText object. textfun Pointer to TextFun object to be filled with text functions
None