/*
8 * Copyright (C) 2017 Authors
9 * Released under GNU GPL v2.0+, read the file
'COPYING' for more information.
24#ifndef _TEXT_REASSEMBLE_
25#define _TEXT_REASSEMBLE_
37#include <fontconfig/fontconfig.h>
44#define TEREMIN(A,B) (A < B ? A : B)
45#define TEREMAX(A,B) (A > B ? A : B)
48# define M_PI 3.14159265358979323846
50#define ALLOCINFO_CHUNK 32
51#define ALLOCOUT_CHUNK 8192
52#define TRPRINT trinfo_append_out
60#define BKCLR_NONE 0x00
61#define BKCLR_FRAG 0x01
62#define BKCLR_LINE 0x02
74#define TXTDECOR_NONE 0x000
75#define TXTDECOR_UNDER 0x001
76#define TXTDECOR_OVER 0x002
77#define TXTDECOR_BLINK 0x004
78#define TXTDECOR_STRIKE 0x008
79#define TXTDECOR_TMASK 0x00F
81#define TXTDECOR_SOLID 0x000
82#define TXTDECOR_DOUBLE 0x010
83#define TXTDECOR_DOTTED 0x020
84#define TXTDECOR_DASHED 0x040
85#define TXTDECOR_WAVY 0x080
86#define TXTDECOR_LMASK 0x0F0
88#define TXTDECOR_CLRSET 0x100
102#define ALICENTER 0x02
122#define TR_EMFBOT 0x01
315#define ICONV_CAST (const char **)
317#if !defined(ICONV_CAST)
318#define ICONV_CAST (char **)
uint32_t fi_idx
index into FT_INFO fonts, for fonts added for missing glyphs
uint32_t weight
integer weight for alt fonts, kept sorted into descending order
Information for a single bounding rectangle.
double xur
x upper right corner
double xll
x rectangle lower left corner
double xbearing
x bearing of the leftmost character
Information for all bounding rectangles.
uint32_t space
storage slots allocated
uint32_t used
storage slots in use
BRECT_SPECS * rects
bounding rectangles
List of all members of a single complex.
uint32_t space
storage slots allocated
int * members
array of immediate children (for TR_PARA_* these are indices for TR_TEXT or TR_LINE complexes also in...
uint32_t used
storage slots in use
Information for all complexes.
uint32_t used
storage slots in use
uint32_t paras
Number of complexes (paras) entered in phase 2
uint32_t space
storage slots allocated
uint32_t phase1
Number of complexes (lines + text fragments) entered in phase 1
uint32_t lines
Number of lines in phase 1
Information for a single complex.
CHILD_SPECS kids
immediate child nodes of this complex, for type TR_TEXT the idx refers to the tpi data.
enum tr_classes type
classification of the complex
int rt_cidx
index of rectangle that contains all members
Information for a font instance.
uint32_t space
alts storage slots allocated
uint32_t used
alts storage slots in use
uint8_t * fontspec
pointer to a font specification (name:italics, etc.)
FcPattern * fpat
current font, must hang onto this or faces operations break
FcFontSet * fontset
all matching fonts (for fallback on missing glyphs)
double spcadv
advance equal to a space, in points at font's face size
FT_Face face
font face structures (FT_FACE is a pointer!)
double fsize
font's face size in points
uint8_t * file
pointer to font paths to files
ALT_SPECS * alts
index into FT_INFO fonts, for fonts added for missing glyphs
Information for all font instances.
FT_Library library
Fontconfig handle
uint32_t used
storage slots in use
FNT_SPECS * fonts
Array of fontinfo structures
uint32_t space
storage slots allocated
Information for one padding record.
Information for a single text object.
int rt_tidx
index of rectangle that contains it
int decoration
text decorations, ignored during assembly, used during output
int weight
weight, as in FontConfig
int taln
text alignment with respect to x,y
double boff
Y LL corner - boff finds baseline
int spaces
count of spaces converted from wide kerning (1 or 2)
double ykern
y kern relative to preceding text chunk in complex (if any)
int co
condensed override, if set Font name included narrow
double ori
Orientation, angle of characters with respect to baseline in degrees.
TRCOLORREF decColor
text decoration color, ignored during assembly, used during output
int fi_idx
index of the font it uses
uint8_t * string
UTF-8 text
double xkern
x kern relative to preceding text chunk in complex (if any)
double fs
font size of text
int ldir
language direction LDIR_*
double vadvance
Line spacing typically 1.25 or 1.2, only set on the first text element in a complex
int italics
italics, as in FontConfig
double x
x coordinate, relative to TR_INFO x,y, in points
double y
y coordinate, relative to TR_INFO x,y, in points
int condensed
condensed, as in FontConfig
Information for all text objects.
uint32_t space
storage slots allocated
TCHUNK_SPECS * chunks
text chunks
uint32_t used
storage slots in use
uint8_t Red
Red color (0-255)
uint8_t Green
Green color (0-255)
uint8_t Reserved
Not used.
uint8_t Blue
Blue color (0-255)
Information for the entire text reassembly system.
CX_INFO * cxi
Complex Info storage
double esc
escapement angle in DEGREES
uint8_t * out
buffer to hold formatted output
int use_kern
1 if kerning is used, 0 if not
int dirty
1 if text records are loaded
int load_flags
FT_LOAD_NO_SCALE or FT_LOAD_TARGET_NORMAL
double qe
quantization error in points.
FT_INFO * fti
Font info storage
BR_INFO * bri
Bounding Rectangle Info storage
double x
x coordinate of first text object, in points
int usebk
On output write the background color under the text
double y
y coordinate of first text object, in points
uint32_t outspace
storage in output buffer allocated
uint32_t outused
storage in output buffer in use
TRCOLORREF bkcolor
RGB background color
int kern_mode
FT_KERNING_DEFAULT, FT_KERNING_UNFITTED, or FT_KERNING_UNSCALED
TP_INFO * tpi
Text Info/Position Info storage
void cxinfo_dump(const TR_INFO *tri)
int trinfo_load_qe(TR_INFO *tri, double qe)
tr_classes
classification of complexes
@ TR_PARA_CJ
ditto, center justified
@ TR_PARA_RJ
ditto, right justified
@ TR_TEXT
simple text object
@ TR_LINE
linear assembly of TR_TEXTs
@ TR_PARA_LJ
ditto, left justified
@ TR_PARA_UJ
sequential assembly of TR_LINEs and TR_TEXTs into a paragraph - unknown justification properties
int brinfo_make_insertable(BR_INFO *bri)
void csp_release(CHILD_SPECS *csp)
TR_INFO * trinfo_init(TR_INFO *tri)
char * TR_construct_fontspec(const TCHUNK_SPECS *tsp, const char *fontname)
CX_INFO * cxinfo_init(void)
int TR_layout_analyze(TR_INFO *tri)
int ftinfo_insert(FT_INFO *fti, FNT_SPECS *fsp)
int cxinfo_append(CX_INFO *cxi, int src, enum tr_classes type)
int ftinfo_find_loaded_by_src(const FT_INFO *fti, const uint8_t *filename)
int is_mn_unicode(int test)
int TR_weight_FC_to_SVG(int weight)
FT_INFO * ftinfo_release(FT_INFO *fti)
int fsp_alts_insert(FNT_SPECS *fsp, uint32_t fi_idx)
void ftinfo_dump(const FT_INFO *fti)
int tpinfo_make_insertable(TP_INFO *tpi)
FT_INFO * ftinfo_clear(FT_INFO *fti)
TP_INFO * tpinfo_release(TP_INFO *tpi)
int trinfo_load_bk(TR_INFO *tri, int usebk, TRCOLORREF bkcolor)
int ftinfo_find_loaded_by_spec(const FT_INFO *fti, const uint8_t *fname)
int brinfo_overlap(const BR_INFO *bri, int dst, int src, RT_PAD *rp_dst, RT_PAD *rp_src)
int trinfo_append_out(TR_INFO *tri, const char *src)
int fsp_alts_weight(FNT_SPECS *fsp, uint32_t a_idx)
void TR_layout_2_svg(TR_INFO *tri)
int csp_merge(CHILD_SPECS *dst, CHILD_SPECS *src)
TP_INFO * tpinfo_init(void)
void TR_rt_pad_set(RT_PAD *rt_pad, double up, double down, double left, double right)
int tpinfo_insert(TP_INFO *tpi, const TCHUNK_SPECS *tsp)
enum tr_classes brinfo_pp_alignment(const BR_INFO *bri, int dst, int src, double slop, enum tr_classes type)
TR_INFO * trinfo_clear(TR_INFO *tri)
int TR_getkern2(FNT_SPECS *fsp, uint32_t wc, uint32_t pc, int kern_mode)
int csp_insert(CHILD_SPECS *csp, int src)
int TR_find_alternate_font(FT_INFO *fti, FNT_SPECS **efsp, uint32_t wc)
FT_INFO * ftinfo_init(void)
int TR_getadvance(FT_INFO *fti, FNT_SPECS *fsp, uint32_t wc, uint32_t pc, int load_flags, int kern_mode, int *ymin, int *ymax)
int TR_check_set_vadvance(TR_INFO *tri, int src, int lines)
int TR_kern_gap(FNT_SPECS *fsp, TCHUNK_SPECS *tsp, TCHUNK_SPECS *ptsp, int kern_mode)
int cxinfo_merge(CX_INFO *cxi, int dst, int src, enum tr_classes type)
BR_INFO * brinfo_init(void)
int trinfo_check_bk(TR_INFO *tri, int usebk, TRCOLORREF bkcolor)
TR_INFO * trinfo_release_except_FC(TR_INFO *tri)
char * TR_reconstruct_fontspec(const char *fontspec, const char *fontname)
int trinfo_load_ft_opts(TR_INFO *tri, int use_kern, int load_flags, int kern_mode)
int cxinfo_insert(CX_INFO *cxi, int src, int src_rt_idx, enum tr_classes type)
int TR_findcasesub(const char *string, const char *sub)
int fsp_alts_make_insertable(FNT_SPECS *fsp)
int trinfo_load_textrec(TR_INFO *tri, const TCHUNK_SPECS *tsp, double escapement, int flags)
BR_INFO * brinfo_release(BR_INFO *bri)
void csp_clear(CHILD_SPECS *csp)
int cxinfo_make_insertable(CX_INFO *cxi)
int brinfo_insert(BR_INFO *bri, const BRECT_SPECS *element)
double TR_baseline(TR_INFO *tri, int src, double *AscMax, double *DscMax)
int csp_make_insertable(CHILD_SPECS *csp)
int ftinfo_make_insertable(FT_INFO *fti)
int cxinfo_trim(CX_INFO *cxi)
int ftinfo_load_fontname(FT_INFO *fti, const char *fontspec)
int brinfo_merge(BR_INFO *bri, int dst, int src)
TR_INFO * trinfo_release(TR_INFO *tri)
CX_INFO * cxinfo_release(CX_INFO *cxi)