/
pango-layout.go
613 lines (526 loc) · 20 KB
/
pango-layout.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
/*
* Copyright (c) 2015- terrak <terrak1975@gmail.com>
*
* This file originated from: http://www.terrak.net/
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
package pango
// #include <pango/pango.h>
// #include "pango.go.h"
import "C"
import (
"runtime"
"unsafe"
"github.com/gotk3/gotk3/glib"
)
func init() {
tm := []glib.TypeMarshaler{
// Enums
{glib.Type(C.pango_alignment_get_type()), marshalAlignment},
{glib.Type(C.pango_ellipsize_mode_get_type()), marshalEllipsizeMode},
{glib.Type(C.pango_wrap_mode_get_type()), marshalWrapMode},
{glib.Type(C.pango_tab_align_get_type()), marshalTabAlign},
// Objects/Interfaces
// {glib.Type(C.pango_layout_get_type()), marshalLayout},
}
glib.RegisterGValueMarshalers(tm)
}
// Layout is a representation of PangoLayout.
type Layout struct {
pangoLayout *C.PangoLayout
}
// Native returns a pointer to the underlying PangoLayout.
func (v *Layout) Native() uintptr {
return uintptr(unsafe.Pointer(v.native()))
}
func (v *Layout) native() *C.PangoLayout {
if v == nil {
return nil
}
return (*C.PangoLayout)(unsafe.Pointer(v.pangoLayout))
}
func WrapLayout(p uintptr) *Layout {
layout := new(Layout)
layout.pangoLayout = (*C.PangoLayout)(unsafe.Pointer(p))
return layout
}
// LayoutLine is a representation of PangoLayoutLine.
type LayoutLine struct {
pangoLayoutLine *C.PangoLayout
}
// Native returns a pointer to the underlying PangoLayoutLine.
func (v *LayoutLine) Native() uintptr {
return uintptr(unsafe.Pointer(v.native()))
}
func (v *LayoutLine) native() *C.PangoLayoutLine {
if v == nil {
return nil
}
return (*C.PangoLayoutLine)(unsafe.Pointer(v.pangoLayoutLine))
}
/*
* Constants
*/
// Alignment is a representation of Pango's PangoAlignment.
type Alignment int
const (
ALIGN_LEFT Alignment = C.PANGO_ALIGN_LEFT
ALIGN_CENTER Alignment = C.PANGO_ALIGN_CENTER
ALIGN_RIGHT Alignment = C.PANGO_ALIGN_RIGHT
)
func marshalAlignment(p uintptr) (interface{}, error) {
c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p)))
return Alignment(c), nil
}
// WrapMode is a representation of Pango's PangoWrapMode.
type WrapMode int
const (
WRAP_WORD WrapMode = C.PANGO_WRAP_WORD
WRAP_CHAR WrapMode = C.PANGO_WRAP_CHAR
WRAP_WORD_CHAR WrapMode = C.PANGO_WRAP_WORD_CHAR
)
func marshalWrapMode(p uintptr) (interface{}, error) {
c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p)))
return WrapMode(c), nil
}
// EllipsizeMode is a representation of Pango's PangoEllipsizeMode.
type EllipsizeMode int
const (
ELLIPSIZE_NONE EllipsizeMode = C.PANGO_ELLIPSIZE_NONE
ELLIPSIZE_START EllipsizeMode = C.PANGO_ELLIPSIZE_START
ELLIPSIZE_MIDDLE EllipsizeMode = C.PANGO_ELLIPSIZE_MIDDLE
ELLIPSIZE_END EllipsizeMode = C.PANGO_ELLIPSIZE_END
)
func marshalEllipsizeMode(p uintptr) (interface{}, error) {
c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p)))
return EllipsizeMode(c), nil
}
type TabAlign int
const (
TAB_LEFT TabAlign = C.PANGO_TAB_LEFT
)
func marshalTabAlign(p uintptr) (interface{}, error) {
c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p)))
return TabAlign(c), nil
}
/*
func marshalLayout(p uintptr) (interface{}, error) {
c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p)))
obj := wrapObject(unsafe.Pointer(c))
return wrapLayout(obj), nil
}
func wrapLayout(obj *glib.Object) *Layout {
return &Layout{obj}
}
*/
// LayoutNew is a wrapper around pango_layout_new().
func LayoutNew(context *Context) *Layout {
c := C.pango_layout_new(context.native())
layout := new(Layout)
layout.pangoLayout = (*C.PangoLayout)(c)
return layout
}
// Copy is a wrapper around pango_layout_copy().
func (v *Layout) Copy() *Layout {
c := C.pango_layout_copy(v.native())
layout := new(Layout)
layout.pangoLayout = (*C.PangoLayout)(c)
return layout
}
// GetContext is a wrapper around pango_layout_get_context().
func (v *Layout) GetContext() *Context {
c := C.pango_layout_get_context(v.native())
context := new(Context)
context.pangoContext = (*C.PangoContext)(c)
return context
}
// SetAttributes is a wrapper around pango_layout_set_attributes().
func (v *Layout) SetAttributes(attrs *AttrList) {
C.pango_layout_set_attributes(v.native(), attrs.native())
}
// GetAttributes is a wrapper around pango_layout_get_attributes().
func (v *Layout) GetAttributes() *AttrList {
c := C.pango_layout_get_attributes(v.native())
attrList := new(AttrList)
attrList.pangoAttrList = (*C.PangoAttrList)(c)
return attrList
}
// SetText is a wrapper around pango_layout_set_text().
func (v *Layout) SetText(text string, length int) {
cstr := C.CString(text)
defer C.free(unsafe.Pointer(cstr))
C.pango_layout_set_text(v.native(), (*C.char)(cstr), (C.int)(length))
}
// GetText is a wrapper around pango_layout_get_text().
func (v *Layout) GetText() string {
c := C.pango_layout_get_text(v.native())
return C.GoString((*C.char)(c))
}
// GetCharacterCount is a wrapper around pango_layout_get_character_count().
func (v *Layout) GetCharacterCount() int {
c := C.pango_layout_get_character_count(v.native())
return int(c)
}
// SetMarkup is a wrapper around pango_layout_set_markup().
func (v *Layout) SetMarkup(text string, length int) {
cstr := C.CString(text)
defer C.free(unsafe.Pointer(cstr))
C.pango_layout_set_markup(v.native(), (*C.char)(cstr), (C.int)(length))
}
//void pango_layout_set_markup_with_accel (PangoLayout *layout,
// const char *markup,
// int length,
// gunichar accel_marker,
// gunichar *accel_char);
/*
func (v *Layout) SetMarkupWithAccel (text string, length int, accel_marker, accel_char rune){
cstr := C.CString(text)
defer C.free(unsafe.Pointer(cstr))
C.pango_layout_set_markup_with_accel (v.native(), (*C.char)(cstr), (C.int)(length), (C.gunichar)(accel_marker), (C.gunichar)(accel_char) )
}
*/
// SetFontDescription is a wrapper around pango_layout_set_font_description().
func (v *Layout) SetFontDescription(desc *FontDescription) {
C.pango_layout_set_font_description(v.native(), desc.native())
}
// GetFontDescription is a wrapper around pango_layout_get_font_description().
func (v *Layout) GetFontDescription() *FontDescription {
c := C.pango_layout_get_font_description(v.native())
desc := new(FontDescription)
desc.pangoFontDescription = (*C.PangoFontDescription)(c)
return desc
}
// SetWidth is a wrapper around pango_layout_set_width().
func (v *Layout) SetWidth(width int) {
C.pango_layout_set_width(v.native(), C.int(width))
}
// GetWidth is a wrapper around pango_layout_get_width().
func (v *Layout) GetWidth() int {
c := C.pango_layout_get_width(v.native())
return int(c)
}
// SetHeight is a wrapper around pango_layout_set_height().
func (v *Layout) SetHeight(width int) {
C.pango_layout_set_height(v.native(), C.int(width))
}
// GetHeight is a wrapper around pango_layout_get_height().
func (v *Layout) GetHeight() int {
c := C.pango_layout_get_height(v.native())
return int(c)
}
// SetWrap is a wrapper around pango_layout_set_wrap().
func (v *Layout) SetWrap(wrap WrapMode) {
C.pango_layout_set_wrap(v.native(), C.PangoWrapMode(wrap))
}
// WrapMode is a wrapper around pango_layout_get_wrap().
func (v *Layout) GetWrap() WrapMode {
c := C.pango_layout_get_wrap(v.native())
return WrapMode(c)
}
// IsWrapped is a wrapper around pango_layout_is_wrapped().
func (v *Layout) IsWrapped() bool {
c := C.pango_layout_is_wrapped(v.native())
return gobool(c)
}
// SetIndent is a wrapper around pango_layout_set_indent().
func (v *Layout) SetIndent(indent int) {
C.pango_layout_set_indent(v.native(), C.int(indent))
}
// GetIndent is a wrapper around pango_layout_get_indent().
func (v *Layout) GetIndent() int {
c := C.pango_layout_get_indent(v.native())
return int(c)
}
// SetTabs is a wrapper around pango_layout_set_tabs().
func (v *Layout) SetTabs(tabs *TabArray) {
C.pango_layout_set_tabs(v.native(), tabs.native())
}
// GetTabs is a wrapper around pango_layout_get_tabs().
func (v *Layout) GetTabs() (*TabArray, error) {
c := C.pango_layout_get_tabs(v.native())
if c == nil {
return nil, nilPtrErr
}
ta := wrapTabArray(c)
runtime.SetFinalizer(ta, (*TabArray).free)
return ta, nil
}
// GetSize is a wrapper around pango_layout_get_size().
func (v *Layout) GetSize() (int, int) {
var w, h C.int
C.pango_layout_get_size(v.native(), &w, &h)
return int(w), int(h)
}
/*
* TabArray
*/
// TabArray is a representation of PangoTabArray.
type TabArray struct {
pangoTabArray *C.PangoTabArray
}
// Native returns a pointer to the underlying PangoTabArray.
func (v *TabArray) Native() uintptr {
return uintptr(unsafe.Pointer(v.native()))
}
func (v *TabArray) native() *C.PangoTabArray {
if v == nil {
return nil
}
return (*C.PangoTabArray)(unsafe.Pointer(v.pangoTabArray))
}
func wrapTabArray(tabArray *C.PangoTabArray) *TabArray {
return &TabArray{tabArray}
}
func WrapTabArray(p uintptr) *TabArray {
tabArray := new(TabArray)
tabArray.pangoTabArray = (*C.PangoTabArray)(unsafe.Pointer(p))
return tabArray
}
// TabArrayNew is a wrapper around pango_tab_array_new().
func TabArrayNew(initialSize int, positionsInPixels bool) *TabArray {
c := C.pango_tab_array_new(C.gint(initialSize), gbool(positionsInPixels))
tabArray := new(TabArray)
runtime.SetFinalizer(tabArray, (*TabArray).free)
tabArray.pangoTabArray = (*C.PangoTabArray)(c)
return tabArray
}
// TabArrayNewWithPositions is a wrapper around pango_tab_array_new_with_positions().
// func TabArrayNewWithPositions(size int, positionsInPixels bool, ...) *TabArray {
// c := C.pango_tab_array_new_with_positions(C.gint(size), gbool(positionsInPixels), ...)
// tabArray := new(TabArray)
// runtime.SetFinalizer(e, (*TabArray).free)
// tabArray.pangoTabArray = (*C.PangoTabArray)(c)
// return tabArray
// }
// Copy is a wrapper around pango_tab_array_copy().
func (v *TabArray) Copy() (*TabArray, error) {
c := C.pango_tab_array_copy(v.native())
if c == nil {
return nil, nilPtrErr
}
ta := wrapTabArray(c)
runtime.SetFinalizer(ta, (*TabArray).free)
return ta, nil
}
// free is a wrapper around pango_tab_array_free().
func (v *TabArray) free() {
C.pango_tab_array_free(v.native())
}
// free is a wrapper around pango_tab_array_free().
// This is only to enable other packages within gotk. Should not be used outside the gotk library.
func (v *TabArray) Free() {
C.pango_tab_array_free(v.native())
}
// GetSize is a wrapper around pango_tab_array_get_size().
func (v *TabArray) GetSize() int {
return int(C.pango_tab_array_get_size(v.native()))
}
// Resize is a wrapper around pango_tab_array_resize().
func (v *TabArray) Resize(newSize int) {
C.pango_tab_array_resize(v.native(), C.gint(newSize))
}
// SetTab is a wrapper around pango_tab_array_set_tab().
func (v *TabArray) SetTab(tabIndex int, alignment TabAlign, location int) {
C.pango_tab_array_set_tab(v.native(), C.gint(tabIndex), C.PangoTabAlign(alignment), C.gint(location))
}
// GetTab is a wrapper around pango_tab_array_get_tab().
func (v *TabArray) GetTab(tabIndex int) (TabAlign, int) {
var alignment C.PangoTabAlign
var location C.gint
C.pango_tab_array_get_tab(v.native(), C.gint(tabIndex), &alignment, &location)
return TabAlign(alignment), int(location)
}
// GetTabs is a wrapper around pango_tab_array_get_tabs().
// func (v *TabArray) GetTabs() ([]TabAlign, []int) {
// var alignment *C.PangoTabAlign
// var location *C.gint
// C.pango_tab_array_get_tabs(v.native(), &alignment, &location)
// size := v.GetSize()
// var goAlignments []TabAlign
// var goLocations []int
// if &alignment != nil {
// var ginthelp C.gint
// sizeOf := unsafe.Sizeof(ginthelp)
// for i := 0; i < int(size); i++ {
// goAlignmentElement := TabAlign(*((*C.gint)(unsafe.Pointer(location))))
// goAlignments = append(goAlignments, goAlignmentElement)
// location += sizeOf
// }
// }
// if &location != nil {
// var ginthelp C.gint
// sizeOf := unsafe.Sizeof(ginthelp)
// for i := 0; i < int(size); i++ {
// goLocationElement := int(*((*C.gint)(unsafe.Pointer(location))))
// goLocations = append(goLocations, goLocationElement)
// location += sizeOf
// }
// // TODO: free locations
// }
// return goAlignments, goLocations
// }
// GetPositionsInPixels is a wrapper around pango_tab_array_get_positions_in_pixels().
func (v *TabArray) GetPositionsInPixels() bool {
return gobool(C.pango_tab_array_get_positions_in_pixels(v.native()))
}
//void pango_layout_set_spacing (PangoLayout *layout,
// int spacing);
//int pango_layout_get_spacing (PangoLayout *layout);
//void pango_layout_set_justify (PangoLayout *layout,
// gboolean justify);
//gboolean pango_layout_get_justify (PangoLayout *layout);
//void pango_layout_set_auto_dir (PangoLayout *layout,
// gboolean auto_dir);
//gboolean pango_layout_get_auto_dir (PangoLayout *layout);
//void pango_layout_set_alignment (PangoLayout *layout,
// PangoAlignment alignment);
//PangoAlignment pango_layout_get_alignment (PangoLayout *layout);
//
//void pango_layout_set_single_paragraph_mode (PangoLayout *layout,
// gboolean setting);
//gboolean pango_layout_get_single_paragraph_mode (PangoLayout *layout);
//
//void pango_layout_set_ellipsize (PangoLayout *layout,
// PangoEllipsizeMode ellipsize);
//PangoEllipsizeMode pango_layout_get_ellipsize (PangoLayout *layout);
//gboolean pango_layout_is_ellipsized (PangoLayout *layout);
//
//int pango_layout_get_unknown_glyphs_count (PangoLayout *layout);
//
//void pango_layout_context_changed (PangoLayout *layout);
//guint pango_layout_get_serial (PangoLayout *layout);
//
//void pango_layout_get_log_attrs (PangoLayout *layout,
// PangoLogAttr **attrs,
// gint *n_attrs);
//
//const PangoLogAttr *pango_layout_get_log_attrs_readonly (PangoLayout *layout,
// gint *n_attrs);
//
//void pango_layout_index_to_pos (PangoLayout *layout,
// int index_,
// PangoRectangle *pos);
//void pango_layout_index_to_line_x (PangoLayout *layout,
// int index_,
// gboolean trailing,
// int *line,
// int *x_pos);
//void pango_layout_get_cursor_pos (PangoLayout *layout,
// int index_,
// PangoRectangle *strong_pos,
// PangoRectangle *weak_pos);
//void pango_layout_move_cursor_visually (PangoLayout *layout,
// gboolean strong,
// int old_index,
// int old_trailing,
// int direction,
// int *new_index,
// int *new_trailing);
//gboolean pango_layout_xy_to_index (PangoLayout *layout,
// int x,
// int y,
// int *index_,
// int *trailing);
//void pango_layout_get_extents (PangoLayout *layout,
// PangoRectangle *ink_rect,
// PangoRectangle *logical_rect);
//void pango_layout_get_pixel_extents (PangoLayout *layout,
// PangoRectangle *ink_rect,
// PangoRectangle *logical_rect);
//void pango_layout_get_pixel_size (PangoLayout *layout,
// int *width,
// int *height);
//int pango_layout_get_baseline (PangoLayout *layout);
//
//int pango_layout_get_line_count (PangoLayout *layout);
//PangoLayoutLine *pango_layout_get_line (PangoLayout *layout,
// int line);
//PangoLayoutLine *pango_layout_get_line_readonly (PangoLayout *layout,
// int line);
//GSList * pango_layout_get_lines (PangoLayout *layout);
//GSList * pango_layout_get_lines_readonly (PangoLayout *layout);
//
//
//#define PANGO_TYPE_LAYOUT_LINE (pango_layout_line_get_type ())
//
//GType pango_layout_line_get_type (void) G_GNUC_CONST;
//
//PangoLayoutLine *pango_layout_line_ref (PangoLayoutLine *line);
//void pango_layout_line_unref (PangoLayoutLine *line);
//
//gboolean pango_layout_line_x_to_index (PangoLayoutLine *line,
// int x_pos,
// int *index_,
// int *trailing);
//void pango_layout_line_index_to_x (PangoLayoutLine *line,
// int index_,
// gboolean trailing,
// int *x_pos);
//void pango_layout_line_get_x_ranges (PangoLayoutLine *line,
// int start_index,
// int end_index,
// int **ranges,
// int *n_ranges);
//void pango_layout_line_get_extents (PangoLayoutLine *line,
// PangoRectangle *ink_rect,
// PangoRectangle *logical_rect);
//void pango_layout_line_get_pixel_extents (PangoLayoutLine *layout_line,
// PangoRectangle *ink_rect,
// PangoRectangle *logical_rect);
//
//typedef struct _PangoLayoutIter PangoLayoutIter;
//
//#define PANGO_TYPE_LAYOUT_ITER (pango_layout_iter_get_type ())
//
//GType pango_layout_iter_get_type (void) G_GNUC_CONST;
//
//PangoLayoutIter *pango_layout_get_iter (PangoLayout *layout);
//PangoLayoutIter *pango_layout_iter_copy (PangoLayoutIter *iter);
//void pango_layout_iter_free (PangoLayoutIter *iter);
//
//int pango_layout_iter_get_index (PangoLayoutIter *iter);
//PangoLayoutRun *pango_layout_iter_get_run (PangoLayoutIter *iter);
//PangoLayoutRun *pango_layout_iter_get_run_readonly (PangoLayoutIter *iter);
//PangoLayoutLine *pango_layout_iter_get_line (PangoLayoutIter *iter);
//PangoLayoutLine *pango_layout_iter_get_line_readonly (PangoLayoutIter *iter);
//gboolean pango_layout_iter_at_last_line (PangoLayoutIter *iter);
//PangoLayout *pango_layout_iter_get_layout (PangoLayoutIter *iter);
//
//gboolean pango_layout_iter_next_char (PangoLayoutIter *iter);
//gboolean pango_layout_iter_next_cluster (PangoLayoutIter *iter);
//gboolean pango_layout_iter_next_run (PangoLayoutIter *iter);
//gboolean pango_layout_iter_next_line (PangoLayoutIter *iter);
//
//void pango_layout_iter_get_char_extents (PangoLayoutIter *iter,
// PangoRectangle *logical_rect);
//void pango_layout_iter_get_cluster_extents (PangoLayoutIter *iter,
// PangoRectangle *ink_rect,
// PangoRectangle *logical_rect);
//void pango_layout_iter_get_run_extents (PangoLayoutIter *iter,
// PangoRectangle *ink_rect,
// PangoRectangle *logical_rect);
//void pango_layout_iter_get_line_extents (PangoLayoutIter *iter,
// PangoRectangle *ink_rect,
// PangoRectangle *logical_rect);
/* All the yranges meet, unlike the logical_rect's (i.e. the yranges
* assign between-line spacing to the nearest line)
*/
//void pango_layout_iter_get_line_yrange (PangoLayoutIter *iter,
// int *y0_,
// int *y1_);
//void pango_layout_iter_get_layout_extents (PangoLayoutIter *iter,
// PangoRectangle *ink_rect,
// PangoRectangle *logical_rect);
//int pango_layout_iter_get_baseline (PangoLayoutIter *iter);
//