Graphiteng
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
include
graphite2
Segment.h
Go to the documentation of this file.
1
/* GRAPHITE2 LICENSING
2
3
Copyright 2010, SIL International
4
All rights reserved.
5
6
This library is free software; you can redistribute it and/or modify
7
it under the terms of the GNU Lesser General Public License as published
8
by the Free Software Foundation; either version 2.1 of License, or
9
(at your option) any later version.
10
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
Lesser General Public License for more details.
15
16
You should also have received a copy of the GNU Lesser General Public
17
License along with this library in the file named "LICENSE".
18
If not, write to the Free Software Foundation, 51 Franklin Street,
19
Suite 500, Boston, MA 02110-1335, USA or visit their web page on the
20
internet at http://www.fsf.org/licenses/lgpl.html.
21
22
Alternatively, the contents of this file may be used under the terms
23
of the Mozilla Public License (http://mozilla.org/MPL) or the GNU
24
General Public License, as published by the Free Software Foundation,
25
either version 2 of the License or (at your option) any later version.
26
*/
27
#pragma once
28
29
#include "
graphite2/Types.h
"
30
#include "
graphite2/Font.h
"
31
32
#ifdef __cplusplus
33
extern
"C"
34
{
35
#endif
36
37
enum
gr_break_weight
{
38
gr_breakNone
= 0,
39
/* after break weights */
40
gr_breakWhitespace
= 10,
41
gr_breakWord
= 15,
42
gr_breakIntra
= 20,
43
gr_breakLetter
= 30,
44
gr_breakClip
= 40,
45
/* before break weights */
46
gr_breakBeforeWhitespace
= -10,
47
gr_breakBeforeWord
= -15,
48
gr_breakBeforeIntra
= -20,
49
gr_breakBeforeLetter
= -30,
50
gr_breakBeforeClip
= -40
51
};
52
53
enum
gr_justFlags
{
55
gr_justCompleteLine
= 0,
57
gr_justStartInline
= 1,
59
gr_justEndInline
= 2
60
};
61
63
enum
gr_attrCode
{
65
gr_slatAdvX
= 0,
67
gr_slatAdvY
,
69
gr_slatAttTo
,
71
gr_slatAttX
,
73
gr_slatAttY
,
75
gr_slatAttGpt
,
77
gr_slatAttXOff
,
79
gr_slatAttYOff
,
81
gr_slatAttWithX
,
83
gr_slatAttWithY
,
85
gr_slatWithGpt
,
87
gr_slatAttWithXOff
,
89
gr_slatAttWithYOff
,
91
gr_slatAttLevel
,
93
gr_slatBreak
,
95
gr_slatCompRef
,
97
gr_slatDir
,
99
gr_slatInsert
,
101
gr_slatPosX
,
103
gr_slatPosY
,
105
gr_slatShiftX
,
107
gr_slatShiftY
,
109
gr_slatUserDefnV1
,
111
gr_slatMeasureSol
,
113
gr_slatMeasureEol
,
115
gr_slatJStretch
,
117
gr_slatJShrink
,
119
gr_slatJStep
,
121
gr_slatJWeight
,
123
gr_slatJWidth
,
125
gr_slatSegSplit
=
gr_slatJStretch
+ 29,
127
gr_slatUserDefn
,
128
130
gr_slatMax
,
132
gr_slatNoEffect
=
gr_slatMax
+ 1
133
};
134
135
enum
gr_bidirtl
{
137
gr_rtl
= 1,
140
gr_nobidi
= 2,
142
gr_nomirror
= 4
143
};
144
145
typedef
struct
gr_char_info
gr_char_info
;
146
typedef
struct
gr_segment
gr_segment
;
147
typedef
struct
gr_slot
gr_slot
;
148
153
GR2_API
unsigned
int
gr_cinfo_unicode_char
(
const
gr_char_info
* p
/*not NULL*/
);
154
167
GR2_API
int
gr_cinfo_break_weight
(
const
gr_char_info
* p
/*not NULL*/
);
168
177
GR2_API
int
gr_cinfo_after
(
const
gr_char_info
* p
/*not NULL*/
);
178
187
GR2_API
int
gr_cinfo_before
(
const
gr_char_info
* p
/*not NULL*/
);
188
194
GR2_API
size_t
gr_cinfo_base
(
const
gr_char_info
* p
/*not NULL*/
);
195
207
GR2_API
size_t
gr_count_unicode_characters
(
enum
gr_encform
enc,
const
void
* buffer_begin,
const
void
* buffer_end,
const
void
** pError);
208
234
GR2_API
gr_segment
*
gr_make_seg
(
const
gr_font
* font,
const
gr_face
* face,
gr_uint32
script,
const
gr_feature_val
* pFeats,
enum
gr_encform
enc,
const
void
* pStart,
size_t
nChars,
int
dir);
235
240
GR2_API
void
gr_seg_destroy
(
gr_segment
* p);
241
246
GR2_API
float
gr_seg_advance_X
(
const
gr_segment
* pSeg
/*not NULL*/
);
247
249
GR2_API
float
gr_seg_advance_Y
(
const
gr_segment
* pSeg
/*not NULL*/
);
250
252
GR2_API
unsigned
int
gr_seg_n_cinfo
(
const
gr_segment
* pSeg
/*not NULL*/
);
253
255
GR2_API
const
gr_char_info
*
gr_seg_cinfo
(
const
gr_segment
* pSeg
/*not NULL*/
,
unsigned
int
index
/*must be <number_of_CharInfo*/
);
256
258
GR2_API
unsigned
int
gr_seg_n_slots
(
const
gr_segment
* pSeg
/*not NULL*/
);
//one slot per glyph
259
265
GR2_API
const
gr_slot
*
gr_seg_first_slot
(
gr_segment
* pSeg
/*not NULL*/
);
//may give a base slot or a slot which is attached to another
266
271
GR2_API
const
gr_slot
*
gr_seg_last_slot
(
gr_segment
* pSeg
/*not NULL*/
);
//may give a base slot or a slot which is attached to another
272
292
GR2_API
float
gr_seg_justify
(
gr_segment
* pSeg
/*not NULL*/
,
const
gr_slot
* pStart
/*not NULL*/
,
const
gr_font
*pFont,
double
width,
enum
gr_justFlags
flags,
const
gr_slot
* pFirst,
const
gr_slot
* pLast);
293
299
GR2_API
const
gr_slot
*
gr_slot_next_in_segment
(
const
gr_slot
* p);
300
307
GR2_API
const
gr_slot
*
gr_slot_prev_in_segment
(
const
gr_slot
* p);
308
314
GR2_API
const
gr_slot
*
gr_slot_attached_to
(
const
gr_slot
* p);
315
324
GR2_API
const
gr_slot
*
gr_slot_first_attachment
(
const
gr_slot
* p);
325
335
GR2_API
const
gr_slot
*
gr_slot_next_sibling_attachment
(
const
gr_slot
* p);
336
337
343
GR2_API
unsigned
short
gr_slot_gid
(
const
gr_slot
* p);
344
346
GR2_API
float
gr_slot_origin_X
(
const
gr_slot
* p);
347
349
GR2_API
float
gr_slot_origin_Y
(
const
gr_slot
* p);
350
360
GR2_API
float
gr_slot_advance_X
(
const
gr_slot
* p,
const
gr_face
* face,
const
gr_font
*font);
361
367
GR2_API
float
gr_slot_advance_Y
(
const
gr_slot
* p,
const
gr_face
* face,
const
gr_font
*font);
368
376
GR2_API
int
gr_slot_before
(
const
gr_slot
* p
/*not NULL*/
);
377
385
GR2_API
int
gr_slot_after
(
const
gr_slot
* p
/*not NULL*/
);
386
392
GR2_API
unsigned
int
gr_slot_index
(
const
gr_slot
* p
/*not NULL*/
);
393
399
GR2_API
int
gr_slot_attr
(
const
gr_slot
* p
/*not NULL*/
,
const
gr_segment
* pSeg
/*not NULL*/
,
enum
gr_attrCode
index,
gr_uint8
subindex);
//tbd - do we need to expose this?
400
402
GR2_API
int
gr_slot_can_insert_before
(
const
gr_slot
* p);
403
409
GR2_API
int
gr_slot_original
(
const
gr_slot
* p
/*not NULL*/
);
410
416
GR2_API
void
gr_slot_linebreak_before
(
gr_slot
*p
/*not NULL*/
);
417
418
#ifdef __cplusplus
419
}
420
#endif
Generated on Fri Jul 26 2013 03:24:14 for Graphiteng by
1.8.1.2