libTERE
A portable library for reassembling complex formatted text from text fragments.
|
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <stdint.h>
#include <ctype.h>
#include <fontconfig/fontconfig.h>
#include <ft2build.h>
#include <iconv.h>
Go to the source code of this file.
Data Structures | |
struct | FNT_SPECS |
Information for a font instance. More... | |
struct | FT_INFO |
Information for all font instances. More... | |
struct | TCHUNK_SPECS |
Information for a single text object. More... | |
struct | TP_INFO |
Information for all text objects. Coordinates here are INTERNAL, after offset/rotate using values in TR_INFO. More... | |
struct | BRECT_SPECS |
Information for a single bounding rectangle. Coordinates here are INTERNAL, after offset/rotate using values in TR_INFO. More... | |
struct | BR_INFO |
Information for all bounding rectangles. More... | |
struct | CHILD_SPECS |
List of all members of a single complex. More... | |
struct | CX_SPECS |
Information for a single complex. More... | |
struct | CX_INFO |
Information for all complexes. More... | |
struct | TR_INFO |
Information for the entire text reassembly system. More... | |
struct | RT_PAD |
Information for one padding record. (Padding is added to bounding rectangles before overlap tests.) More... |
Macros | |
#define | ALILEFT 0x01 |
#define | ALICENTER 0x02 |
#define | ALIRIGHT 0x04 |
#define | ALIHORI 0x07 |
#define | ALITOP 0x08 |
#define | ALIBASE 0x10 |
#define | ALIBOT 0x20 |
#define | ALIVERT 0x38 |
#define | LDIR_LR 0x00 |
#define | LDIR_RL 0x01 |
#define | LDIR_TB 0x02 |
#define | TR_EMFBOT 0x01 |
Enumerations | |
enum | tr_classes { TR_TEXT, TR_LINE, TR_PARA_UJ, TR_PARA_LJ, TR_PARA_CJ, TR_PARA_RJ } |
Functions | |
int | TR_findcasesub (char *string, char *sub) |
Find a (sub)string in a caseinvariant manner, used for locating "Narrow" in font name. | |
int | TR_getadvance (FNT_SPECS *fsp, uint32_t wc, uint32_t pc, int load_flags, int kern_mode, int *ymin, int *ymax) |
Get the advance for the 32 bit character. | |
int | TR_getkern2 (FNT_SPECS *fsp, uint32_t wc, uint32_t pc, int kern_mode) |
Get the kerning for a pair of 32 bit characters. | |
int | TR_kern_gap (FNT_SPECS *fsp, TCHUNK_SPECS *tsp, TCHUNK_SPECS *ptsp, int kern_mode) |
Get the kerning for a pair of 32 bit characters, where one is the last charcter in the previous text block, and the other is the first in the current text block. | |
void | TR_rt_pad_set (RT_PAD *rt_pad, double up, double down, double left, double right) |
Set the padding that will be added to bounding rectangles before checking for overlaps in brinfo_overlap(). | |
double | TR_baseline (TR_INFO *tri, int src, double *AscMax, double *DscMax) |
Find baseline on Y axis of a complex. If the complex is a TR_TEXT or TR_LINE find its baseline. If the complex is TR_PARA_[UCLR]J find the baseline of the last line. If there are multiple text elements in a TR_LINE, the baseline is that of the element that uses the largest font. This will definitely give the wrong result if that line starts with a super or subscript that is full font size, but they are usually smaller. | |
int | TR_check_set_vadvance (TR_INFO *tri, int src, int lines) |
Check or set vertical advance on the growing complex relative to the current complex. Vadvance is a multiplicative factor like 1.25. The distance between successive baselines is vadvance * max(font_size), where the maximum is over all text elements in src. The growing complex is always the last one in the CX_INFO section of the TR_INFO structure. If an existing vadvance does not match the one which would be required to fit the next complex to add to the growing one, it terminates a growing complex. (Ie, starts a new paragraph.) Find baseline on Y axis of a complex. If the complex is a TR_TEXT or TR_LINE find its baseline. If the complex is TR_PARA+* find the baseline of the last line. If there are multiple text elements in a TR_LINE, the baseline is that of the element that uses the largest font. This will definitely give the wrong result if that line starts with a super or subscript that is full font size, but they are usually smaller. | |
int | TR_layout_analyze (TR_INFO *tri) |
Attempt to figure out the original organization, in lines and paragraphs, of the text objects. The method is: | |
void | TR_layout_2_svg (TR_INFO *tri) |
Convert from analyzed complexes to SVG format. | |
int | TR_weight_FC_to_SVG (int weight) |
Fontweight conversion. Fontconfig units to SVG units. Anything not recognized becomes "normal" == 400. There is no interpolation because a value that mapped to 775, for instance, most likely would not display properly because it is intermediate between 700 and 800, and only those need be supported in SVG viewers. | |
FT_INFO * | ftinfo_init (void) |
Initialize an FT_INFO structure. Sets up a freetype library to use in this context. | |
int | ftinfo_make_insertable (FT_INFO *fti) |
Make an FT_INFO structure insertable. Adds storage as needed. | |
int | ftinfo_insert (FT_INFO *fti, FNT_SPECS *fsp) |
Insert a copy of a FNT_SPECS structure into the FT_INFO structure. | |
FT_INFO * | ftinfo_release (FT_INFO *fti) |
Release an FT_INFO structure. Release all associated memory. Use like: fi_ptr = ftinfo_release(fi_ptr) | |
FT_INFO * | ftinfo_clear (FT_INFO *fti) |
Clear an FT_INFO structure. Release all Freetype memory but does not release Fontconfig. This would be called in preference to ftinfo_release() if some other part of the program needed to continue using Fontconfig. Use like: fi_ptr = ftinfo_clear(fi_ptr) | |
int | csp_make_insertable (CHILD_SPECS *csp) |
Make a CHILD_SPECS structure insertable. Adds storage as needed. | |
int | csp_insert (CHILD_SPECS *csp, int src) |
Add a member to a CHILD_SPECS structure. (Member is an index for either a text object or a complex.) | |
int | csp_merge (CHILD_SPECS *dst, CHILD_SPECS *src) |
Append all the members of one CHILD_SPECS structure to another CHILD_SPECS structure. Member is an index for either a text object or a complex. The donor is not modified. | |
void | csp_release (CHILD_SPECS *csp) |
Release a CHILD_SPECS structure. Release all associated memory. | |
CX_INFO * | cxinfo_init (void) |
Initialize an CX_INFO structure. Holds complexes (multiple text objects in known positions and order.) | |
int | cxinfo_make_insertable (CX_INFO *cxi) |
Make a CX_INFO structure insertable. Adds storage as needed. | |
int | cxinfo_insert (CX_INFO *cxi, int src, int src_rt_idx, enum tr_classes type) |
Insert a complex into the CX_INFO structure. (Insert may be either TR_TEXT or TR_LINE.) | |
int | cxinfo_append (CX_INFO *cxi, int src, enum tr_classes type) |
Append a complex to the CX_INFO structure and give it a type. | |
int | cxinfo_merge (CX_INFO *cxi, int dst, int src, enum tr_classes type) |
Merge a complex dst with N members (N>=1) by adding a second complex src, and change the type. | |
CX_INFO * | cxinfo_release (CX_INFO *cxi) |
Release a CX_INFO structure. Release all associated memory. use like: cxi = cxiinfo_release(cxi);. | |
void | cxinfo_dump (TR_INFO *tri) |
Dump the contents of the TR_INFO structure to stdout. For debugging purposes,not used in production code. | |
TP_INFO * | tpinfo_init (void) |
Initialize an TP_INFO structure. Holds text objects from which complexes are built. | |
int | tpinfo_make_insertable (TP_INFO *tpi) |
Make a TP_INFO structure insertable. Adds storage as needed. | |
int | tpinfo_insert (TP_INFO *tpi, TCHUNK_SPECS *tsp) |
Insert a copy of a TCHUNK_SPECS structure into a TP_INFO structure. (Insert a text object.) | |
TP_INFO * | tpinfo_release (TP_INFO *tpi) |
Release a TP_INFO structure. Release all associated memory. use like: tpi = tpinfo_release(tpi);. | |
BR_INFO * | brinfo_init (void) |
Initialize an BR_INFO structure. Holds bounding rectangles, for both text objects and complexes. | |
int | brinfo_make_insertable (BR_INFO *bri) |
Make a BR_INFO structure insertable. Adds storage as needed. | |
int | brinfo_insert (BR_INFO *bri, BRECT_SPECS *element) |
Insert a copy of a BRECT_SPEC structure into a BR_INFO structure. (Insert a bounding rectangle.) | |
int | brinfo_merge (BR_INFO *bri, int dst, int src) |
Merge BRECT_SPEC element src into/with BRECT_SPEC element dst. src is unchanged. (Merge two bounding rectangles.) | |
enum tr_classes | brinfo_pp_alignment (BR_INFO *bri, int dst, int src, double slop, enum tr_classes type) |
Try to deduce justification of a paragraph from the bounding rectangles for two successive lines. | |
int | brinfo_overlap (BR_INFO *bri, int dst, int src, RT_PAD *rp_dst, RT_PAD *rp_src) |
Check for an allowable overlap of two bounding rectangles. Allowable overlap is any area overlap of src and dst bounding rectangles, after they have been expanded (padded) by allowed edge expansions. (For instance, if missing spaces must be accounted for.) The method works backwards: look for all reasons they might not overlap, if none are found, then the rectangles do overlap. An overlap here does not count just a line or a point - area must be involved. | |
BR_INFO * | brinfo_release (BR_INFO *bri) |
Release a BR_INFO structure. Release all associated memory. use like: bri = brinfo_release(bri);. | |
TR_INFO * | trinfo_init (TR_INFO *tri) |
Initialize an TR_INFO structure. Holds all data for text reassembly. | |
TR_INFO * | trinfo_release (TR_INFO *tri) |
Release a TR_INFO structure completely. Release all associated memory, including FontConfig. See also trinfo_clear() and trinfo_release_except_FC(). use like: tri = trinfo_release(tri);. | |
TR_INFO * | trinfo_release_except_FC (TR_INFO *tri) |
Release a TR_INFO structure mostly. Release all associated memory EXCEPT Fontconfig. Fontconfig may still be needed elsewhere in a program and there is no way to figure that out here. See also trinfo_clear() and trinfo_release(). use like: tri = trinfo_release_except_FC(tri);. | |
TR_INFO * | trinfo_clear (TR_INFO *tri) |
Clear a TR_INFO structure. Releases text and rectangle information, but retains font information, both Freetype information and Fontconfig information. See also trinfo_release() and trinfo_release_except_FC(). Use like: tri = trinfo_clear(tri);. | |
int | trinfo_load_fontname (TR_INFO *tri, uint8_t *fontname, TCHUNK_SPECS *tsp) |
Load a (new) font by name into a TR_INFO structure. | |
int | trinfo_load_qe (TR_INFO *tri, double qe) |
Set the quantization error value for a TR_INFO structure. If coordinates have passed through an integer form limits in accuracy may have been imposed. For instance, if the X coordinate of a point in such a file is 1000, and the conversion factor from those coordinates to points is .04, then eq is .04. This just says that single coordinates are only good to within .04, and two coordinates may differ by as much as .08, just due to quantization error. So if some calculation shows a difference of .02 it may be interpreted as this sort of error and set to 0.0. | |
int | trinfo_load_ft_opts (TR_INFO *tri, int use_kern, int load_flags, int kern_mode) |
Set Freetype parameters and kerning mode (if any) in a TRI_INFO structure. | |
int | trinfo_load_textrec (TR_INFO *tri, TCHUNK_SPECS *tsp, double escapement, int flags) |
Load a text object into a TR_INFO struct. | |
int | trinfo_append_out (TR_INFO *tri, char *src) |
Append text to a TR_INFO struct's output buffer, expanding it if necessary. |
libTERE headers.
See text_reassemble.c for notes
File: text_reassemble.h Version: 0.0.3 Date: 11-DEC-2012 Author: David Mathog, Biology Division, Caltech email: matho Copyright: 2012 David Mathog and California Institute of Technology (Caltech) g@ca ltech .edu
enum tr_classes |
classification of complexes
BR_INFO* brinfo_init | ( | void | ) |
int brinfo_insert | ( | BR_INFO * | bri, |
BRECT_SPECS * | element | ||
) |
Insert a copy of a BRECT_SPEC structure into a BR_INFO structure. (Insert a bounding rectangle.)
bri | pointer to the BR_INFO structure |
element | pointer to the BRECT_SPECS structure |
int brinfo_make_insertable | ( | BR_INFO * | bri | ) |
int brinfo_merge | ( | BR_INFO * | bri, |
int | dst, | ||
int | src | ||
) |
Merge BRECT_SPEC element src into/with BRECT_SPEC element dst. src is unchanged. (Merge two bounding rectangles.)
bri | pointer to the BR_INFO structure |
dst | index of the destination bounding rectangle. |
src | index of the source bounding rectangle. |
Check for an allowable overlap of two bounding rectangles. Allowable overlap is any area overlap of src and dst bounding rectangles, after they have been expanded (padded) by allowed edge expansions. (For instance, if missing spaces must be accounted for.) The method works backwards: look for all reasons they might not overlap, if none are found, then the rectangles do overlap. An overlap here does not count just a line or a point - area must be involved.
bri | pointer to the BR_INFO structure |
dst | index of the destination bounding rectangle. |
src | index of the source bounding rectangle. |
rp_dst | Pointer to edge padding values for dst. |
rp_src | Pointer to edge padding values for src. |
enum tr_classes brinfo_pp_alignment | ( | BR_INFO * | bri, |
int | dst, | ||
int | src, | ||
double | slop, | ||
enum tr_classes | type | ||
) |
Try to deduce justification of a paragraph from the bounding rectangles for two successive lines.
bri | pointer to the BR_INFO structure |
dst | index of the destination bounding rectangle. |
src | index of the source bounding rectangle. |
slop | allowed error in edge alignment. |
type | Preexisting justification for dst, if any. Justification of dst and src must match this or TR_PARA_UJ is returned even if dst and src have some (other) alignment. |
int csp_insert | ( | CHILD_SPECS * | dst, |
int | src | ||
) |
Add a member to a CHILD_SPECS structure. (Member is an index for either a text object or a complex.)
dst | pointer to the CHILD_SPECS structure. |
src | index of the member. |
int csp_make_insertable | ( | CHILD_SPECS * | csp | ) |
Make a CHILD_SPECS structure insertable. Adds storage as needed.
csp | pointer to the CHILD_SPECS structure |
int csp_merge | ( | CHILD_SPECS * | dst, |
CHILD_SPECS * | src | ||
) |
Append all the members of one CHILD_SPECS structure to another CHILD_SPECS structure. Member is an index for either a text object or a complex. The donor is not modified.
dst | pointer to the recipient CHILD_SPECS structure. |
src | pointer to the donor CHILD_SPECS structure. |
void csp_release | ( | CHILD_SPECS * | csp | ) |
Release a CHILD_SPECS structure. Release all associated memory.
csp | pointer to the CHILD_SPECS structure. |
int cxinfo_append | ( | CX_INFO * | cxi, |
int | src, | ||
enum tr_classes | type | ||
) |
void cxinfo_dump | ( | TR_INFO * | tri | ) |
CX_INFO* cxinfo_init | ( | void | ) |
int cxinfo_insert | ( | CX_INFO * | cxi, |
int | src, | ||
int | src_rt_tidx, | ||
enum tr_classes | type | ||
) |
Insert a complex into the CX_INFO structure. (Insert may be either TR_TEXT or TR_LINE.)
cxi | pointer to the CX_INFO structure (complexes). |
src | index of the the complex to insert. |
src_rt_tidx | index of the bounding rectangle |
type | TR_TEXT (index is for tpi->chunks[]) or TR_LINE (index is for cxi->kids[]) |
int cxinfo_make_insertable | ( | CX_INFO * | cxi | ) |
int cxinfo_merge | ( | CX_INFO * | cxi, |
int | dst, | ||
int | src, | ||
enum tr_classes | type | ||
) |
Merge a complex dst with N members (N>=1) by adding a second complex src, and change the type.
cxi | pointer to the CX_INFO structure (complexes). |
dst | index of the complex to expand. |
src | index of the donor complex (which is not modified). |
type | TR_LINE (src is an index for tpi->chunks[]) or TR_PARA (src is an index for cxi->kids[]). |
Clear an FT_INFO structure. Release all Freetype memory but does not release Fontconfig. This would be called in preference to ftinfo_release() if some other part of the program needed to continue using Fontconfig. Use like: fi_ptr = ftinfo_clear(fi_ptr)
fti | pointer to the FT_INFO structure. |
FT_INFO* ftinfo_init | ( | void | ) |
int ftinfo_make_insertable | ( | FT_INFO * | fti | ) |
TP_INFO* tpinfo_init | ( | void | ) |
int tpinfo_insert | ( | TP_INFO * | tpi, |
TCHUNK_SPECS * | tsp | ||
) |
Insert a copy of a TCHUNK_SPECS structure into a TP_INFO structure. (Insert a text object.)
tpi | pointer to the TP_INFO structure |
tsp | pointer to the TCHUNK_SPECS structure |
int tpinfo_make_insertable | ( | TP_INFO * | tpi | ) |
double TR_baseline | ( | TR_INFO * | tri, |
int | src, | ||
double * | ymax, | ||
double * | ymin | ||
) |
Find baseline on Y axis of a complex. If the complex is a TR_TEXT or TR_LINE find its baseline. If the complex is TR_PARA_[UCLR]J find the baseline of the last line. If there are multiple text elements in a TR_LINE, the baseline is that of the element that uses the largest font. This will definitely give the wrong result if that line starts with a super or subscript that is full font size, but they are usually smaller.
tri | pointer to the TR_INFO structure holding all TR data |
src | index of the current complex |
ymax | If the pointer is defined, the value is adjusted if ymax of current complex is more than the current value. |
ymin | If the pointer is defined, the value is adjusted if ymin of current complex is less than the current value. |
int TR_check_set_vadvance | ( | TR_INFO * | tri, |
int | src, | ||
int | lines | ||
) |
Check or set vertical advance on the growing complex relative to the current complex. Vadvance is a multiplicative factor like 1.25. The distance between successive baselines is vadvance * max(font_size), where the maximum is over all text elements in src. The growing complex is always the last one in the CX_INFO section of the TR_INFO structure. If an existing vadvance does not match the one which would be required to fit the next complex to add to the growing one, it terminates a growing complex. (Ie, starts a new paragraph.) Find baseline on Y axis of a complex. If the complex is a TR_TEXT or TR_LINE find its baseline. If the complex is TR_PARA+* find the baseline of the last line. If there are multiple text elements in a TR_LINE, the baseline is that of the element that uses the largest font. This will definitely give the wrong result if that line starts with a super or subscript that is full font size, but they are usually smaller.
tri | pointer to the TR_INFO structure holding all TR data |
src | index of the current complex, to be added to the growing complex. This lets the value of "src - lines" determine the weight to give to each new vadvance value as it is merged into the running weighted average. This improves the accuracy of the vertical advance, since there can be some noise introduced when lines have different maximum font sizes. |
lines | index of the first text block that was added to the growing complex. |
int TR_findcasesub | ( | char * | string, |
char * | sub | ||
) |
Find a (sub)string in a caseinvariant manner, used for locating "Narrow" in font name.
string | Text to search |
sub | Text to find |
int TR_getadvance | ( | FNT_SPECS * | fsp, |
uint32_t | wc, | ||
uint32_t | pc, | ||
int | load_flags, | ||
int | kern_mode, | ||
int * | ymin, | ||
int * | ymax | ||
) |
Get the advance for the 32 bit character.
fsp | Pointer to FNT_SPECS struct. |
wc | Current character (32 bit int) |
pc | Previous character |
load_flags | Controls internal advance: FT_LOAD_NO_SCALE, internal advance is in 1/64th of a point. (kerning values are still scaled) FT_LOAD_TARGET_NORMAL internal advance is in 1/64th of a point. The scale factor seems to be (Font Size in points)*(DPI)/(32.0 pnts)*(72 dpi). |
kern_mode | FT_KERNING_DEFAULT, FT_KERNING_UNFITTED, or FT_KERNING_UNSCALED. Set to match calling application. |
ymin | If the pointer is defined, the value is adjusted if ymin of wc character is less than the current value. |
ymax | If the pointer is defined, the value is adjusted if ymin of wc character is more than the current value. |
int TR_getkern2 | ( | FNT_SPECS * | fsp, |
uint32_t | wc, | ||
uint32_t | pc, | ||
int | kern_mode | ||
) |
Get the kerning for a pair of 32 bit characters.
fsp | Pointer to FNT_SPECS struct. |
wc | Current character (32 bit int) |
pc | Previous character |
kern_mode | FT_KERNING_DEFAULT, FT_KERNING_UNFITTED, or FT_KERNING_UNSCALED. Set to match calling application. |
int TR_kern_gap | ( | FNT_SPECS * | fsp, |
TCHUNK_SPECS * | tsp, | ||
TCHUNK_SPECS * | ptsp, | ||
int | kern_mode | ||
) |
Get the kerning for a pair of 32 bit characters, where one is the last charcter in the previous text block, and the other is the first in the current text block.
fsp | Pointer to FNT_SPECS struct. |
tsp | current text object |
ptsp | previous text object |
kern_mode | FT_KERNING_DEFAULT, FT_KERNING_UNFITTED, or FT_KERNING_UNSCALED. Set to match calling application. |
void TR_layout_2_svg | ( | TR_INFO * | tri | ) |
Convert from analyzed complexes to SVG format.
tri | pointer to a TR_INFO struct which will be analyzed. Result is stored in its "out" buffer. |
int TR_layout_analyze | ( | TR_INFO * | tri | ) |
Attempt to figure out the original organization, in lines and paragraphs, of the text objects. The method is:
tri | pointer to the TR_INFO structure holding the data, which will also hold the results. |
void TR_rt_pad_set | ( | RT_PAD * | rt_pad, |
double | up, | ||
double | down, | ||
double | left, | ||
double | right | ||
) |
Set the padding that will be added to bounding rectangles before checking for overlaps in brinfo_overlap().
rt_pad | pointer to an RT_PAD structure. |
up | padding for the top of a bounding rectangle. |
down | padding for the bottom of a bounding rectangle. |
left | padding for the left of a bounding rectangle. |
right | padding for the right of a bounding rectangle. |
int TR_weight_FC_to_SVG | ( | int | weight | ) |
Fontweight conversion. Fontconfig units to SVG units. Anything not recognized becomes "normal" == 400. There is no interpolation because a value that mapped to 775, for instance, most likely would not display properly because it is intermediate between 700 and 800, and only those need be supported in SVG viewers.
weight | Fontconfig font weight. |
int trinfo_append_out | ( | TR_INFO * | tri, |
char * | src | ||
) |
Clear a TR_INFO structure. Releases text and rectangle information, but retains font information, both Freetype information and Fontconfig information. See also trinfo_release() and trinfo_release_except_FC(). Use like: tri = trinfo_clear(tri);.
tri | pointer to the TR_INFO structure. |
int trinfo_load_fontname | ( | TR_INFO * | tri, |
uint8_t * | fontname, | ||
TCHUNK_SPECS * | tsp | ||
) |
Load a (new) font by name into a TR_INFO structure.
tri | pointer to the TR_INFO structure. |
fontname | UTF-8 font name |
tsp | pointer to the TCHUNK_SPECS structure - used to construct a font query string. |
int trinfo_load_ft_opts | ( | TR_INFO * | tri, |
int | use_kern, | ||
int | load_flags, | ||
int | kern_mode | ||
) |
Set Freetype parameters and kerning mode (if any) in a TRI_INFO structure.
tri | pointer to a TR_INFO structure |
use_kern | 0 if kerning is to be employed, !0 otherwise. |
load_flags | Controls internal advance: FT_LOAD_NO_SCALE, internal advance is in 1/64th of a point. (kerning values are still scaled) FT_LOAD_TARGET_NORMAL internal advance is in 1/64th of a point. The scale factor seems to be (Font Size in points)*(DPI)/(32.0 pnts)*(72 dpi). |
kern_mode | FT_KERNING_DEFAULT, FT_KERNING_UNFITTED, or FT_KERNING_UNSCALED. Set to match calling application. |
int trinfo_load_qe | ( | TR_INFO * | tri, |
double | qe | ||
) |
Set the quantization error value for a TR_INFO structure. If coordinates have passed through an integer form limits in accuracy may have been imposed. For instance, if the X coordinate of a point in such a file is 1000, and the conversion factor from those coordinates to points is .04, then eq is .04. This just says that single coordinates are only good to within .04, and two coordinates may differ by as much as .08, just due to quantization error. So if some calculation shows a difference of .02 it may be interpreted as this sort of error and set to 0.0.
tri | pointer to TR_INFO structure |
qe | quantization error. |
int trinfo_load_textrec | ( | TR_INFO * | tri, |
TCHUNK_SPECS * | tsp, | ||
double | escapement, | ||
int | flags | ||
) |
Load a text object into a TR_INFO struct.
tri | pointer to a TR_INFO structure |
tsp | pointer to a TCHUNK_SPECS structure (text object to load) |
escapement | angle in degrees of the text object. |
flags | special processing flags: TR_EMFBOT calculate Y coordinates of ALIBOT object compatible with EMF files TA_BOTTOM alignment. |
Release a TR_INFO structure completely. Release all associated memory, including FontConfig. See also trinfo_clear() and trinfo_release_except_FC(). use like: tri = trinfo_release(tri);.
tri | pointer to the TR_INFO structure. |
Release a TR_INFO structure mostly. Release all associated memory EXCEPT Fontconfig. Fontconfig may still be needed elsewhere in a program and there is no way to figure that out here. See also trinfo_clear() and trinfo_release(). use like: tri = trinfo_release_except_FC(tri);.
tri | pointer to the TR_INFO structure. |