1// Package pango was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package pango
3
4import (
5 "structs"
6 "unsafe"
7
8 "github.com/ebitengine/purego"
9
10 "github.com/bnema/puregotk/pkg/core"
11 "github.com/bnema/puregotk/v4/gio"
12 "github.com/bnema/puregotk/v4/glib"
13 "github.com/bnema/puregotk/v4/gobject"
14 "github.com/bnema/puregotk/v4/gobject/types"
15)
16
17type FontClass struct {
18 _ structs.HostLayout
19
20 ParentClass gobject.ObjectClass
21
22 xDescribe uintptr
23
24 xGetCoverage uintptr
25
26 xGetGlyphExtents uintptr
27
28 xGetMetrics uintptr
29
30 xGetFontMap uintptr
31
32 xDescribeAbsolute uintptr
33
34 xGetFeatures uintptr
35
36 xCreateHbFont uintptr
37}
38
39func (x *FontClass) GoPointer() uintptr {
40 return uintptr(unsafe.Pointer(x))
41}
42
43// OverrideDescribe sets the "describe" callback function.
44func (x *FontClass) OverrideDescribe(cb func(*Font) *FontDescription) {
45 if cb == nil {
46 x.xDescribe = 0
47 } else {
48 x.xDescribe = purego.NewCallback(func(FontVarp uintptr) *FontDescription {
49 return cb(FontNewFromInternalPtr(FontVarp))
50 })
51 }
52}
53
54// GetDescribe gets the "describe" callback function.
55func (x *FontClass) GetDescribe() func(*Font) *FontDescription {
56 if x.xDescribe == 0 {
57 return nil
58 }
59 var rawCallback func(FontVarp uintptr) *FontDescription
60 purego.RegisterFunc(&rawCallback, x.xDescribe)
61 return func(FontVar *Font) *FontDescription {
62 return rawCallback(FontVar.GoPointer())
63 }
64}
65
66// OverrideGetCoverage sets the "get_coverage" callback function.
67func (x *FontClass) OverrideGetCoverage(cb func(*Font, *Language) *Coverage) {
68 if cb == nil {
69 x.xGetCoverage = 0
70 } else {
71 x.xGetCoverage = purego.NewCallback(func(FontVarp uintptr, LanguageVarp *Language) uintptr {
72 ret := cb(FontNewFromInternalPtr(FontVarp), LanguageVarp)
73 if ret == nil {
74 return 0
75 }
76 return ret.GoPointer()
77 })
78 }
79}
80
81// GetGetCoverage gets the "get_coverage" callback function.
82func (x *FontClass) GetGetCoverage() func(*Font, *Language) *Coverage {
83 if x.xGetCoverage == 0 {
84 return nil
85 }
86 var rawCallback func(FontVarp uintptr, LanguageVarp *Language) uintptr
87 purego.RegisterFunc(&rawCallback, x.xGetCoverage)
88 return func(FontVar *Font, LanguageVar *Language) *Coverage {
89 rawRet := rawCallback(FontVar.GoPointer(), LanguageVar)
90 if rawRet == 0 {
91 return nil
92 }
93 ret := &Coverage{}
94 ret.Ptr = rawRet
95 return ret
96 }
97}
98
99// OverrideGetGlyphExtents sets the "get_glyph_extents" callback function.
100func (x *FontClass) OverrideGetGlyphExtents(cb func(*Font, Glyph, *Rectangle, *Rectangle)) {
101 if cb == nil {
102 x.xGetGlyphExtents = 0
103 } else {
104 x.xGetGlyphExtents = purego.NewCallback(func(FontVarp uintptr, GlyphVarp Glyph, InkRectVarp *Rectangle, LogicalRectVarp *Rectangle) {
105 cb(FontNewFromInternalPtr(FontVarp), GlyphVarp, InkRectVarp, LogicalRectVarp)
106 })
107 }
108}
109
110// GetGetGlyphExtents gets the "get_glyph_extents" callback function.
111func (x *FontClass) GetGetGlyphExtents() func(*Font, Glyph, *Rectangle, *Rectangle) {
112 if x.xGetGlyphExtents == 0 {
113 return nil
114 }
115 var rawCallback func(FontVarp uintptr, GlyphVarp Glyph, InkRectVarp *Rectangle, LogicalRectVarp *Rectangle)
116 purego.RegisterFunc(&rawCallback, x.xGetGlyphExtents)
117 return func(FontVar *Font, GlyphVar Glyph, InkRectVar *Rectangle, LogicalRectVar *Rectangle) {
118 rawCallback(FontVar.GoPointer(), GlyphVar, InkRectVar, LogicalRectVar)
119 }
120}
121
122// OverrideGetMetrics sets the "get_metrics" callback function.
123func (x *FontClass) OverrideGetMetrics(cb func(*Font, *Language) *FontMetrics) {
124 if cb == nil {
125 x.xGetMetrics = 0
126 } else {
127 x.xGetMetrics = purego.NewCallback(func(FontVarp uintptr, LanguageVarp *Language) *FontMetrics {
128 return cb(FontNewFromInternalPtr(FontVarp), LanguageVarp)
129 })
130 }
131}
132
133// GetGetMetrics gets the "get_metrics" callback function.
134func (x *FontClass) GetGetMetrics() func(*Font, *Language) *FontMetrics {
135 if x.xGetMetrics == 0 {
136 return nil
137 }
138 var rawCallback func(FontVarp uintptr, LanguageVarp *Language) *FontMetrics
139 purego.RegisterFunc(&rawCallback, x.xGetMetrics)
140 return func(FontVar *Font, LanguageVar *Language) *FontMetrics {
141 return rawCallback(FontVar.GoPointer(), LanguageVar)
142 }
143}
144
145// OverrideGetFontMap sets the "get_font_map" callback function.
146func (x *FontClass) OverrideGetFontMap(cb func(*Font) *FontMap) {
147 if cb == nil {
148 x.xGetFontMap = 0
149 } else {
150 x.xGetFontMap = purego.NewCallback(func(FontVarp uintptr) uintptr {
151 ret := cb(FontNewFromInternalPtr(FontVarp))
152 if ret == nil {
153 return 0
154 }
155 return ret.GoPointer()
156 })
157 }
158}
159
160// GetGetFontMap gets the "get_font_map" callback function.
161func (x *FontClass) GetGetFontMap() func(*Font) *FontMap {
162 if x.xGetFontMap == 0 {
163 return nil
164 }
165 var rawCallback func(FontVarp uintptr) uintptr
166 purego.RegisterFunc(&rawCallback, x.xGetFontMap)
167 return func(FontVar *Font) *FontMap {
168 rawRet := rawCallback(FontVar.GoPointer())
169 if rawRet == 0 {
170 return nil
171 }
172 ret := &FontMap{}
173 ret.Ptr = rawRet
174 return ret
175 }
176}
177
178// OverrideDescribeAbsolute sets the "describe_absolute" callback function.
179func (x *FontClass) OverrideDescribeAbsolute(cb func(*Font) *FontDescription) {
180 if cb == nil {
181 x.xDescribeAbsolute = 0
182 } else {
183 x.xDescribeAbsolute = purego.NewCallback(func(FontVarp uintptr) *FontDescription {
184 return cb(FontNewFromInternalPtr(FontVarp))
185 })
186 }
187}
188
189// GetDescribeAbsolute gets the "describe_absolute" callback function.
190func (x *FontClass) GetDescribeAbsolute() func(*Font) *FontDescription {
191 if x.xDescribeAbsolute == 0 {
192 return nil
193 }
194 var rawCallback func(FontVarp uintptr) *FontDescription
195 purego.RegisterFunc(&rawCallback, x.xDescribeAbsolute)
196 return func(FontVar *Font) *FontDescription {
197 return rawCallback(FontVar.GoPointer())
198 }
199}
200
201// OverrideGetFeatures sets the "get_features" callback function.
202func (x *FontClass) OverrideGetFeatures(cb func(*Font, *[]uintptr, uint, uint)) {
203 if cb == nil {
204 x.xGetFeatures = 0
205 } else {
206 x.xGetFeatures = purego.NewCallback(func(FontVarp uintptr, FeaturesVarp *[]uintptr, LenVarp uint, NumFeaturesVarp uint) {
207 cb(FontNewFromInternalPtr(FontVarp), FeaturesVarp, LenVarp, NumFeaturesVarp)
208 })
209 }
210}
211
212// GetGetFeatures gets the "get_features" callback function.
213func (x *FontClass) GetGetFeatures() func(*Font, *[]uintptr, uint, uint) {
214 if x.xGetFeatures == 0 {
215 return nil
216 }
217 var rawCallback func(FontVarp uintptr, FeaturesVarp *[]uintptr, LenVarp uint, NumFeaturesVarp uint)
218 purego.RegisterFunc(&rawCallback, x.xGetFeatures)
219 return func(FontVar *Font, FeaturesVar *[]uintptr, LenVar uint, NumFeaturesVar uint) {
220 rawCallback(FontVar.GoPointer(), FeaturesVar, LenVar, NumFeaturesVar)
221 }
222}
223
224// OverrideCreateHbFont sets the "create_hb_font" callback function.
225func (x *FontClass) OverrideCreateHbFont(cb func(*Font) uintptr) {
226 if cb == nil {
227 x.xCreateHbFont = 0
228 } else {
229 x.xCreateHbFont = purego.NewCallback(func(FontVarp uintptr) uintptr {
230 return cb(FontNewFromInternalPtr(FontVarp))
231 })
232 }
233}
234
235// GetCreateHbFont gets the "create_hb_font" callback function.
236func (x *FontClass) GetCreateHbFont() func(*Font) uintptr {
237 if x.xCreateHbFont == 0 {
238 return nil
239 }
240 var rawCallback func(FontVarp uintptr) uintptr
241 purego.RegisterFunc(&rawCallback, x.xCreateHbFont)
242 return func(FontVar *Font) uintptr {
243 return rawCallback(FontVar.GoPointer())
244 }
245}
246
247// A `PangoFontDescription` describes a font in an implementation-independent
248// manner.
249//
250// `PangoFontDescription` structures are used both to list what fonts are
251// available on the system and also for specifying the characteristics of
252// a font to load.
253type FontDescription struct {
254 _ structs.HostLayout
255}
256
257var xFontDescriptionGLibType func() types.GType
258
259func FontDescriptionGLibType() types.GType {
260 return xFontDescriptionGLibType()
261}
262
263func (x *FontDescription) GoPointer() uintptr {
264 return uintptr(unsafe.Pointer(x))
265}
266
267var xNewFontDescription func() *FontDescription
268
269// Creates a new font description structure with all fields unset.
270func NewFontDescription() *FontDescription {
271
272 cret := xNewFontDescription()
273 return cret
274}
275
276var xFontDescriptionBetterMatch func(uintptr, *FontDescription, *FontDescription) bool
277
278// Determines if the style attributes of @new_match are a closer match
279// for @desc than those of @old_match are, or if @old_match is %NULL,
280// determines if @new_match is a match at all.
281//
282// Approximate matching is done for weight and style; other style attributes
283// must match exactly. Style attributes are all attributes other than family
284// and size-related attributes. Approximate matching for style considers
285// %PANGO_STYLE_OBLIQUE and %PANGO_STYLE_ITALIC as matches, but not as good
286// a match as when the styles are equal.
287//
288// Note that @old_match must match @desc.
289func (x *FontDescription) BetterMatch(OldMatchVar *FontDescription, NewMatchVar *FontDescription) bool {
290
291 cret := xFontDescriptionBetterMatch(x.GoPointer(), OldMatchVar, NewMatchVar)
292 return cret
293}
294
295var xFontDescriptionCopy func(uintptr) *FontDescription
296
297// Make a copy of a `PangoFontDescription`.
298func (x *FontDescription) Copy() *FontDescription {
299
300 cret := xFontDescriptionCopy(x.GoPointer())
301 return cret
302}
303
304var xFontDescriptionCopyStatic func(uintptr) *FontDescription
305
306// Make a copy of a `PangoFontDescription`, but don't duplicate
307// allocated fields.
308//
309// This is like [method@Pango.FontDescription.copy], but only a shallow
310// copy is made of the family name and other allocated fields. The result
311// can only be used until @desc is modified or freed. This is meant
312// to be used when the copy is only needed temporarily.
313func (x *FontDescription) CopyStatic() *FontDescription {
314
315 cret := xFontDescriptionCopyStatic(x.GoPointer())
316 return cret
317}
318
319var xFontDescriptionEqual func(uintptr, *FontDescription) bool
320
321// Compares two font descriptions for equality.
322//
323// Two font descriptions are considered equal if the fonts they describe
324// are provably identical. This means that their masks do not have to match,
325// as long as other fields are all the same. (Two font descriptions may
326// result in identical fonts being loaded, but still compare %FALSE.)
327func (x *FontDescription) Equal(Desc2Var *FontDescription) bool {
328
329 cret := xFontDescriptionEqual(x.GoPointer(), Desc2Var)
330 return cret
331}
332
333var xFontDescriptionFree func(uintptr)
334
335// Frees a font description.
336func (x *FontDescription) Free() {
337
338 xFontDescriptionFree(x.GoPointer())
339
340}
341
342var xFontDescriptionGetColor func(uintptr) FontColor
343
344// Returns the color field of the font description.
345//
346// This field determines whether the font description should
347// match fonts that have color glyphs, or fonts that don't.
348func (x *FontDescription) GetColor() FontColor {
349
350 cret := xFontDescriptionGetColor(x.GoPointer())
351 return cret
352}
353
354var xFontDescriptionGetFamily func(uintptr) string
355
356// Gets the family name field of a font description.
357//
358// See [method@Pango.FontDescription.set_family].
359func (x *FontDescription) GetFamily() string {
360
361 cret := xFontDescriptionGetFamily(x.GoPointer())
362 return cret
363}
364
365var xFontDescriptionGetFeatures func(uintptr) string
366
367// Gets the features field of a font description.
368//
369// See [method@Pango.FontDescription.set_features].
370func (x *FontDescription) GetFeatures() string {
371
372 cret := xFontDescriptionGetFeatures(x.GoPointer())
373 return cret
374}
375
376var xFontDescriptionGetGravity func(uintptr) Gravity
377
378// Gets the gravity field of a font description.
379//
380// See [method@Pango.FontDescription.set_gravity].
381func (x *FontDescription) GetGravity() Gravity {
382
383 cret := xFontDescriptionGetGravity(x.GoPointer())
384 return cret
385}
386
387var xFontDescriptionGetSetFields func(uintptr) FontMask
388
389// Determines which fields in a font description have been set.
390func (x *FontDescription) GetSetFields() FontMask {
391
392 cret := xFontDescriptionGetSetFields(x.GoPointer())
393 return cret
394}
395
396var xFontDescriptionGetSize func(uintptr) int
397
398// Gets the size field of a font description.
399//
400// See [method@Pango.FontDescription.set_size].
401func (x *FontDescription) GetSize() int {
402
403 cret := xFontDescriptionGetSize(x.GoPointer())
404 return cret
405}
406
407var xFontDescriptionGetSizeIsAbsolute func(uintptr) bool
408
409// Determines whether the size of the font is in points (not absolute)
410// or device units (absolute).
411//
412// See [method@Pango.FontDescription.set_size]
413// and [method@Pango.FontDescription.set_absolute_size].
414func (x *FontDescription) GetSizeIsAbsolute() bool {
415
416 cret := xFontDescriptionGetSizeIsAbsolute(x.GoPointer())
417 return cret
418}
419
420var xFontDescriptionGetStretch func(uintptr) Stretch
421
422// Gets the stretch field of a font description.
423//
424// See [method@Pango.FontDescription.set_stretch].
425func (x *FontDescription) GetStretch() Stretch {
426
427 cret := xFontDescriptionGetStretch(x.GoPointer())
428 return cret
429}
430
431var xFontDescriptionGetStyle func(uintptr) Style
432
433// Gets the style field of a `PangoFontDescription`.
434//
435// See [method@Pango.FontDescription.set_style].
436func (x *FontDescription) GetStyle() Style {
437
438 cret := xFontDescriptionGetStyle(x.GoPointer())
439 return cret
440}
441
442var xFontDescriptionGetVariant func(uintptr) Variant
443
444// Gets the variant field of a `PangoFontDescription`.
445//
446// See [method@Pango.FontDescription.set_variant].
447func (x *FontDescription) GetVariant() Variant {
448
449 cret := xFontDescriptionGetVariant(x.GoPointer())
450 return cret
451}
452
453var xFontDescriptionGetVariations func(uintptr) string
454
455// Gets the variations field of a font description.
456//
457// See [method@Pango.FontDescription.set_variations].
458func (x *FontDescription) GetVariations() string {
459
460 cret := xFontDescriptionGetVariations(x.GoPointer())
461 return cret
462}
463
464var xFontDescriptionGetWeight func(uintptr) Weight
465
466// Gets the weight field of a font description.
467//
468// See [method@Pango.FontDescription.set_weight].
469func (x *FontDescription) GetWeight() Weight {
470
471 cret := xFontDescriptionGetWeight(x.GoPointer())
472 return cret
473}
474
475var xFontDescriptionHash func(uintptr) uint
476
477// Computes a hash of a `PangoFontDescription` structure.
478//
479// This is suitable to be used, for example, as an argument
480// to g_hash_table_new(). The hash value is independent of @desc->mask.
481func (x *FontDescription) Hash() uint {
482
483 cret := xFontDescriptionHash(x.GoPointer())
484 return cret
485}
486
487var xFontDescriptionMerge func(uintptr, *FontDescription, bool)
488
489// Merges the fields that are set in @desc_to_merge into the fields in
490// @desc.
491//
492// If @replace_existing is %FALSE, only fields in @desc that
493// are not already set are affected. If %TRUE, then fields that are
494// already set will be replaced as well.
495//
496// If @desc_to_merge is %NULL, this function performs nothing.
497func (x *FontDescription) Merge(DescToMergeVar *FontDescription, ReplaceExistingVar bool) {
498
499 xFontDescriptionMerge(x.GoPointer(), DescToMergeVar, ReplaceExistingVar)
500
501}
502
503var xFontDescriptionMergeStatic func(uintptr, *FontDescription, bool)
504
505// Merges the fields that are set in @desc_to_merge into the fields in
506// @desc, without copying allocated fields.
507//
508// This is like [method@Pango.FontDescription.merge], but only a shallow copy
509// is made of the family name and other allocated fields. @desc can only
510// be used until @desc_to_merge is modified or freed. This is meant to
511// be used when the merged font description is only needed temporarily.
512func (x *FontDescription) MergeStatic(DescToMergeVar *FontDescription, ReplaceExistingVar bool) {
513
514 xFontDescriptionMergeStatic(x.GoPointer(), DescToMergeVar, ReplaceExistingVar)
515
516}
517
518var xFontDescriptionSetAbsoluteSize func(uintptr, float64)
519
520// Sets the size field of a font description, in device units.
521//
522// This is mutually exclusive with [method@Pango.FontDescription.set_size]
523// which sets the font size in points.
524func (x *FontDescription) SetAbsoluteSize(SizeVar float64) {
525
526 xFontDescriptionSetAbsoluteSize(x.GoPointer(), SizeVar)
527
528}
529
530var xFontDescriptionSetColor func(uintptr, FontColor)
531
532// Sets the color field of a font description.
533//
534// This field determines whether the font description should
535// match fonts that have color glyphs, or fonts that don't.
536func (x *FontDescription) SetColor(ColorVar FontColor) {
537
538 xFontDescriptionSetColor(x.GoPointer(), ColorVar)
539
540}
541
542var xFontDescriptionSetFamily func(uintptr, string)
543
544// Sets the family name field of a font description.
545//
546// The family
547// name represents a family of related font styles, and will
548// resolve to a particular `PangoFontFamily`. In some uses of
549// `PangoFontDescription`, it is also possible to use a comma
550// separated list of family names for this field.
551func (x *FontDescription) SetFamily(FamilyVar string) {
552
553 xFontDescriptionSetFamily(x.GoPointer(), FamilyVar)
554
555}
556
557var xFontDescriptionSetFamilyStatic func(uintptr, string)
558
559// Sets the family name field of a font description, without copying the string.
560//
561// This is like [method@Pango.FontDescription.set_family], except that no
562// copy of @family is made. The caller must make sure that the
563// string passed in stays around until @desc has been freed or the
564// name is set again. This function can be used if @family is a static
565// string such as a C string literal, or if @desc is only needed temporarily.
566func (x *FontDescription) SetFamilyStatic(FamilyVar string) {
567
568 xFontDescriptionSetFamilyStatic(x.GoPointer(), FamilyVar)
569
570}
571
572var xFontDescriptionSetFeatures func(uintptr, uintptr)
573
574// Sets the features field of a font description.
575//
576// OpenType font features allow to enable or disable certain optional
577// features of a font, such as tabular numbers.
578//
579// The format of the features string is comma-separated list of
580// feature assignments, with each assignment being one of these forms:
581//
582// FEATURE=n
583//
584// where FEATURE must be a 4 character tag that identifies and OpenType
585// feature, and n an integer (depending on the feature, the allowed
586// values may be 0, 1 or bigger numbers). Unknown features are ignored.
587//
588// Note that font features set in this way are enabled for the entire text
589// that is using the font, which is not appropriate for all OpenType features.
590// The intended use case is to select character variations (features cv01 - c99),
591// style sets (ss01 - ss20) and the like.
592//
593// Pango does not currently have a way to find supported OpenType features
594// of a font. Both harfbuzz and freetype have API for this. See for example
595// [hb_ot_layout_table_get_feature_tags](https://harfbuzz.github.io/harfbuzz-hb-ot-layout.html#hb-ot-layout-table-get-feature-tags).
596//
597// Features that are not supported by the font are silently ignored.
598func (x *FontDescription) SetFeatures(FeaturesVar *string) {
599
600 FeaturesVarPtr := core.GStrdupNullable(FeaturesVar)
601 defer core.GFreeNullable(FeaturesVarPtr)
602
603 xFontDescriptionSetFeatures(x.GoPointer(), FeaturesVarPtr)
604
605}
606
607var xFontDescriptionSetFeaturesStatic func(uintptr, string)
608
609// Sets the features field of a font description.
610//
611// This is like [method@Pango.FontDescription.set_features], except
612// that no copy of @featuresis made. The caller must make sure that
613// the string passed in stays around until @desc has been freed
614// or the name is set again. This function can be used if
615// @features is a static string such as a C string literal,
616// or if @desc is only needed temporarily.
617func (x *FontDescription) SetFeaturesStatic(FeaturesVar string) {
618
619 xFontDescriptionSetFeaturesStatic(x.GoPointer(), FeaturesVar)
620
621}
622
623var xFontDescriptionSetGravity func(uintptr, Gravity)
624
625// Sets the gravity field of a font description.
626//
627// The gravity field
628// specifies how the glyphs should be rotated. If @gravity is
629// %PANGO_GRAVITY_AUTO, this actually unsets the gravity mask on
630// the font description.
631//
632// This function is seldom useful to the user. Gravity should normally
633// be set on a `PangoContext`.
634func (x *FontDescription) SetGravity(GravityVar Gravity) {
635
636 xFontDescriptionSetGravity(x.GoPointer(), GravityVar)
637
638}
639
640var xFontDescriptionSetSize func(uintptr, int)
641
642// Sets the size field of a font description in fractional points.
643//
644// This is mutually exclusive with
645// [method@Pango.FontDescription.set_absolute_size].
646func (x *FontDescription) SetSize(SizeVar int) {
647
648 xFontDescriptionSetSize(x.GoPointer(), SizeVar)
649
650}
651
652var xFontDescriptionSetStretch func(uintptr, Stretch)
653
654// Sets the stretch field of a font description.
655//
656// The [enum@Pango.Stretch] field specifies how narrow or
657// wide the font should be.
658func (x *FontDescription) SetStretch(StretchVar Stretch) {
659
660 xFontDescriptionSetStretch(x.GoPointer(), StretchVar)
661
662}
663
664var xFontDescriptionSetStyle func(uintptr, Style)
665
666// Sets the style field of a `PangoFontDescription`.
667//
668// The [enum@Pango.Style] enumeration describes whether the font is
669// slanted and the manner in which it is slanted; it can be either
670// %PANGO_STYLE_NORMAL, %PANGO_STYLE_ITALIC, or %PANGO_STYLE_OBLIQUE.
671//
672// Most fonts will either have a italic style or an oblique style,
673// but not both, and font matching in Pango will match italic
674// specifications with oblique fonts and vice-versa if an exact
675// match is not found.
676func (x *FontDescription) SetStyle(StyleVar Style) {
677
678 xFontDescriptionSetStyle(x.GoPointer(), StyleVar)
679
680}
681
682var xFontDescriptionSetVariant func(uintptr, Variant)
683
684// Sets the variant field of a font description.
685//
686// The [enum@Pango.Variant] can either be %PANGO_VARIANT_NORMAL
687// or %PANGO_VARIANT_SMALL_CAPS.
688func (x *FontDescription) SetVariant(VariantVar Variant) {
689
690 xFontDescriptionSetVariant(x.GoPointer(), VariantVar)
691
692}
693
694var xFontDescriptionSetVariations func(uintptr, uintptr)
695
696// Sets the variations field of a font description.
697//
698// OpenType font variations allow to select a font instance by
699// specifying values for a number of axes, such as width or weight.
700//
701// The format of the variations string is
702//
703// AXIS1=VALUE,AXIS2=VALUE...
704//
705// with each AXIS a 4 character tag that identifies a font axis,
706// and each VALUE a floating point number. Unknown axes are ignored,
707// and values are clamped to their allowed range.
708//
709// Pango does not currently have a way to find supported axes of
710// a font. Both harfbuzz and freetype have API for this. See
711// for example [hb_ot_var_get_axis_infos](https://harfbuzz.github.io/harfbuzz-hb-ot-var.html#hb-ot-var-get-axis-infos).
712func (x *FontDescription) SetVariations(VariationsVar *string) {
713
714 VariationsVarPtr := core.GStrdupNullable(VariationsVar)
715 defer core.GFreeNullable(VariationsVarPtr)
716
717 xFontDescriptionSetVariations(x.GoPointer(), VariationsVarPtr)
718
719}
720
721var xFontDescriptionSetVariationsStatic func(uintptr, string)
722
723// Sets the variations field of a font description.
724//
725// This is like [method@Pango.FontDescription.set_variations], except
726// that no copy of @variations is made. The caller must make sure that
727// the string passed in stays around until @desc has been freed
728// or the name is set again. This function can be used if
729// @variations is a static string such as a C string literal,
730// or if @desc is only needed temporarily.
731func (x *FontDescription) SetVariationsStatic(VariationsVar string) {
732
733 xFontDescriptionSetVariationsStatic(x.GoPointer(), VariationsVar)
734
735}
736
737var xFontDescriptionSetWeight func(uintptr, Weight)
738
739// Sets the weight field of a font description.
740//
741// The weight field
742// specifies how bold or light the font should be. In addition
743// to the values of the [enum@Pango.Weight] enumeration, other
744// intermediate numeric values are possible.
745func (x *FontDescription) SetWeight(WeightVar Weight) {
746
747 xFontDescriptionSetWeight(x.GoPointer(), WeightVar)
748
749}
750
751var xFontDescriptionToFilename func(uintptr) string
752
753// Creates a filename representation of a font description.
754//
755// The filename is identical to the result from calling
756// [method@Pango.FontDescription.to_string], but with underscores
757// instead of characters that are untypical in filenames, and in
758// lower case only.
759func (x *FontDescription) ToFilename() string {
760
761 cret := xFontDescriptionToFilename(x.GoPointer())
762 return cret
763}
764
765var xFontDescriptionToString func(uintptr) string
766
767// Creates a string representation of a font description.
768//
769// See [func@Pango.FontDescription.from_string] for a description
770// of the format of the string representation. The family list in
771// the string description will only have a terminating comma if
772// the last word of the list is a valid style option.
773func (x *FontDescription) ToString() string {
774
775 cret := xFontDescriptionToString(x.GoPointer())
776 return cret
777}
778
779var xFontDescriptionUnsetFields func(uintptr, FontMask)
780
781// Unsets some of the fields in a `PangoFontDescription`.
782//
783// The unset fields will get back to their default values.
784func (x *FontDescription) UnsetFields(ToUnsetVar FontMask) {
785
786 xFontDescriptionUnsetFields(x.GoPointer(), ToUnsetVar)
787
788}
789
790type FontFaceClass struct {
791 _ structs.HostLayout
792
793 ParentClass gobject.ObjectClass
794
795 xGetFaceName uintptr
796
797 xDescribe uintptr
798
799 xListSizes uintptr
800
801 xIsSynthesized uintptr
802
803 xGetFamily uintptr
804
805 xPangoReserved3 uintptr
806
807 xPangoReserved4 uintptr
808}
809
810func (x *FontFaceClass) GoPointer() uintptr {
811 return uintptr(unsafe.Pointer(x))
812}
813
814// OverrideGetFaceName sets the "get_face_name" callback function.
815func (x *FontFaceClass) OverrideGetFaceName(cb func(*FontFace) string) {
816 if cb == nil {
817 x.xGetFaceName = 0
818 } else {
819 x.xGetFaceName = purego.NewCallback(func(FaceVarp uintptr) string {
820 return cb(FontFaceNewFromInternalPtr(FaceVarp))
821 })
822 }
823}
824
825// GetGetFaceName gets the "get_face_name" callback function.
826func (x *FontFaceClass) GetGetFaceName() func(*FontFace) string {
827 if x.xGetFaceName == 0 {
828 return nil
829 }
830 var rawCallback func(FaceVarp uintptr) string
831 purego.RegisterFunc(&rawCallback, x.xGetFaceName)
832 return func(FaceVar *FontFace) string {
833 return rawCallback(FaceVar.GoPointer())
834 }
835}
836
837// OverrideDescribe sets the "describe" callback function.
838func (x *FontFaceClass) OverrideDescribe(cb func(*FontFace) *FontDescription) {
839 if cb == nil {
840 x.xDescribe = 0
841 } else {
842 x.xDescribe = purego.NewCallback(func(FaceVarp uintptr) *FontDescription {
843 return cb(FontFaceNewFromInternalPtr(FaceVarp))
844 })
845 }
846}
847
848// GetDescribe gets the "describe" callback function.
849func (x *FontFaceClass) GetDescribe() func(*FontFace) *FontDescription {
850 if x.xDescribe == 0 {
851 return nil
852 }
853 var rawCallback func(FaceVarp uintptr) *FontDescription
854 purego.RegisterFunc(&rawCallback, x.xDescribe)
855 return func(FaceVar *FontFace) *FontDescription {
856 return rawCallback(FaceVar.GoPointer())
857 }
858}
859
860// OverrideListSizes sets the "list_sizes" callback function.
861func (x *FontFaceClass) OverrideListSizes(cb func(*FontFace, *[]int, *int)) {
862 if cb == nil {
863 x.xListSizes = 0
864 } else {
865 x.xListSizes = purego.NewCallback(func(FaceVarp uintptr, SizesVarp *[]int, NSizesVarp *int) {
866 cb(FontFaceNewFromInternalPtr(FaceVarp), SizesVarp, NSizesVarp)
867 })
868 }
869}
870
871// GetListSizes gets the "list_sizes" callback function.
872func (x *FontFaceClass) GetListSizes() func(*FontFace, *[]int, *int) {
873 if x.xListSizes == 0 {
874 return nil
875 }
876 var rawCallback func(FaceVarp uintptr, SizesVarp *[]int, NSizesVarp *int)
877 purego.RegisterFunc(&rawCallback, x.xListSizes)
878 return func(FaceVar *FontFace, SizesVar *[]int, NSizesVar *int) {
879 rawCallback(FaceVar.GoPointer(), SizesVar, NSizesVar)
880 }
881}
882
883// OverrideIsSynthesized sets the "is_synthesized" callback function.
884func (x *FontFaceClass) OverrideIsSynthesized(cb func(*FontFace) bool) {
885 if cb == nil {
886 x.xIsSynthesized = 0
887 } else {
888 x.xIsSynthesized = purego.NewCallback(func(FaceVarp uintptr) bool {
889 return cb(FontFaceNewFromInternalPtr(FaceVarp))
890 })
891 }
892}
893
894// GetIsSynthesized gets the "is_synthesized" callback function.
895func (x *FontFaceClass) GetIsSynthesized() func(*FontFace) bool {
896 if x.xIsSynthesized == 0 {
897 return nil
898 }
899 var rawCallback func(FaceVarp uintptr) bool
900 purego.RegisterFunc(&rawCallback, x.xIsSynthesized)
901 return func(FaceVar *FontFace) bool {
902 return rawCallback(FaceVar.GoPointer())
903 }
904}
905
906// OverrideGetFamily sets the "get_family" callback function.
907func (x *FontFaceClass) OverrideGetFamily(cb func(*FontFace) *FontFamily) {
908 if cb == nil {
909 x.xGetFamily = 0
910 } else {
911 x.xGetFamily = purego.NewCallback(func(FaceVarp uintptr) uintptr {
912 ret := cb(FontFaceNewFromInternalPtr(FaceVarp))
913 if ret == nil {
914 return 0
915 }
916 return ret.GoPointer()
917 })
918 }
919}
920
921// GetGetFamily gets the "get_family" callback function.
922func (x *FontFaceClass) GetGetFamily() func(*FontFace) *FontFamily {
923 if x.xGetFamily == 0 {
924 return nil
925 }
926 var rawCallback func(FaceVarp uintptr) uintptr
927 purego.RegisterFunc(&rawCallback, x.xGetFamily)
928 return func(FaceVar *FontFace) *FontFamily {
929 rawRet := rawCallback(FaceVar.GoPointer())
930 if rawRet == 0 {
931 return nil
932 }
933 ret := &FontFamily{}
934 ret.Ptr = rawRet
935 return ret
936 }
937}
938
939// OverridePangoReserved3 sets the "_pango_reserved3" callback function.
940func (x *FontFaceClass) OverridePangoReserved3(cb func()) {
941 if cb == nil {
942 x.xPangoReserved3 = 0
943 } else {
944 x.xPangoReserved3 = purego.NewCallback(func() {
945 cb()
946 })
947 }
948}
949
950// GetPangoReserved3 gets the "_pango_reserved3" callback function.
951func (x *FontFaceClass) GetPangoReserved3() func() {
952 if x.xPangoReserved3 == 0 {
953 return nil
954 }
955 var rawCallback func()
956 purego.RegisterFunc(&rawCallback, x.xPangoReserved3)
957 return func() {
958 rawCallback()
959 }
960}
961
962// OverridePangoReserved4 sets the "_pango_reserved4" callback function.
963func (x *FontFaceClass) OverridePangoReserved4(cb func()) {
964 if cb == nil {
965 x.xPangoReserved4 = 0
966 } else {
967 x.xPangoReserved4 = purego.NewCallback(func() {
968 cb()
969 })
970 }
971}
972
973// GetPangoReserved4 gets the "_pango_reserved4" callback function.
974func (x *FontFaceClass) GetPangoReserved4() func() {
975 if x.xPangoReserved4 == 0 {
976 return nil
977 }
978 var rawCallback func()
979 purego.RegisterFunc(&rawCallback, x.xPangoReserved4)
980 return func() {
981 rawCallback()
982 }
983}
984
985type FontFamilyClass struct {
986 _ structs.HostLayout
987
988 ParentClass gobject.ObjectClass
989
990 xListFaces uintptr
991
992 xGetName uintptr
993
994 xIsMonospace uintptr
995
996 xIsVariable uintptr
997
998 xGetFace uintptr
999
1000 xPangoReserved2 uintptr
1001}
1002
1003func (x *FontFamilyClass) GoPointer() uintptr {
1004 return uintptr(unsafe.Pointer(x))
1005}
1006
1007// OverrideListFaces sets the "list_faces" callback function.
1008func (x *FontFamilyClass) OverrideListFaces(cb func(*FontFamily, *uintptr, *int)) {
1009 if cb == nil {
1010 x.xListFaces = 0
1011 } else {
1012 x.xListFaces = purego.NewCallback(func(FamilyVarp uintptr, FacesVarp *uintptr, NFacesVarp *int) {
1013 cb(FontFamilyNewFromInternalPtr(FamilyVarp), FacesVarp, NFacesVarp)
1014 })
1015 }
1016}
1017
1018// GetListFaces gets the "list_faces" callback function.
1019func (x *FontFamilyClass) GetListFaces() func(*FontFamily, *uintptr, *int) {
1020 if x.xListFaces == 0 {
1021 return nil
1022 }
1023 var rawCallback func(FamilyVarp uintptr, FacesVarp *uintptr, NFacesVarp *int)
1024 purego.RegisterFunc(&rawCallback, x.xListFaces)
1025 return func(FamilyVar *FontFamily, FacesVar *uintptr, NFacesVar *int) {
1026 rawCallback(FamilyVar.GoPointer(), FacesVar, NFacesVar)
1027 }
1028}
1029
1030// OverrideGetName sets the "get_name" callback function.
1031func (x *FontFamilyClass) OverrideGetName(cb func(*FontFamily) string) {
1032 if cb == nil {
1033 x.xGetName = 0
1034 } else {
1035 x.xGetName = purego.NewCallback(func(FamilyVarp uintptr) string {
1036 return cb(FontFamilyNewFromInternalPtr(FamilyVarp))
1037 })
1038 }
1039}
1040
1041// GetGetName gets the "get_name" callback function.
1042func (x *FontFamilyClass) GetGetName() func(*FontFamily) string {
1043 if x.xGetName == 0 {
1044 return nil
1045 }
1046 var rawCallback func(FamilyVarp uintptr) string
1047 purego.RegisterFunc(&rawCallback, x.xGetName)
1048 return func(FamilyVar *FontFamily) string {
1049 return rawCallback(FamilyVar.GoPointer())
1050 }
1051}
1052
1053// OverrideIsMonospace sets the "is_monospace" callback function.
1054func (x *FontFamilyClass) OverrideIsMonospace(cb func(*FontFamily) bool) {
1055 if cb == nil {
1056 x.xIsMonospace = 0
1057 } else {
1058 x.xIsMonospace = purego.NewCallback(func(FamilyVarp uintptr) bool {
1059 return cb(FontFamilyNewFromInternalPtr(FamilyVarp))
1060 })
1061 }
1062}
1063
1064// GetIsMonospace gets the "is_monospace" callback function.
1065func (x *FontFamilyClass) GetIsMonospace() func(*FontFamily) bool {
1066 if x.xIsMonospace == 0 {
1067 return nil
1068 }
1069 var rawCallback func(FamilyVarp uintptr) bool
1070 purego.RegisterFunc(&rawCallback, x.xIsMonospace)
1071 return func(FamilyVar *FontFamily) bool {
1072 return rawCallback(FamilyVar.GoPointer())
1073 }
1074}
1075
1076// OverrideIsVariable sets the "is_variable" callback function.
1077func (x *FontFamilyClass) OverrideIsVariable(cb func(*FontFamily) bool) {
1078 if cb == nil {
1079 x.xIsVariable = 0
1080 } else {
1081 x.xIsVariable = purego.NewCallback(func(FamilyVarp uintptr) bool {
1082 return cb(FontFamilyNewFromInternalPtr(FamilyVarp))
1083 })
1084 }
1085}
1086
1087// GetIsVariable gets the "is_variable" callback function.
1088func (x *FontFamilyClass) GetIsVariable() func(*FontFamily) bool {
1089 if x.xIsVariable == 0 {
1090 return nil
1091 }
1092 var rawCallback func(FamilyVarp uintptr) bool
1093 purego.RegisterFunc(&rawCallback, x.xIsVariable)
1094 return func(FamilyVar *FontFamily) bool {
1095 return rawCallback(FamilyVar.GoPointer())
1096 }
1097}
1098
1099// OverrideGetFace sets the "get_face" callback function.
1100func (x *FontFamilyClass) OverrideGetFace(cb func(*FontFamily, string) *FontFace) {
1101 if cb == nil {
1102 x.xGetFace = 0
1103 } else {
1104 x.xGetFace = purego.NewCallback(func(FamilyVarp uintptr, NameVarp string) uintptr {
1105 ret := cb(FontFamilyNewFromInternalPtr(FamilyVarp), NameVarp)
1106 if ret == nil {
1107 return 0
1108 }
1109 return ret.GoPointer()
1110 })
1111 }
1112}
1113
1114// GetGetFace gets the "get_face" callback function.
1115func (x *FontFamilyClass) GetGetFace() func(*FontFamily, string) *FontFace {
1116 if x.xGetFace == 0 {
1117 return nil
1118 }
1119 var rawCallback func(FamilyVarp uintptr, NameVarp string) uintptr
1120 purego.RegisterFunc(&rawCallback, x.xGetFace)
1121 return func(FamilyVar *FontFamily, NameVar string) *FontFace {
1122 rawRet := rawCallback(FamilyVar.GoPointer(), NameVar)
1123 if rawRet == 0 {
1124 return nil
1125 }
1126 ret := &FontFace{}
1127 ret.Ptr = rawRet
1128 return ret
1129 }
1130}
1131
1132// OverridePangoReserved2 sets the "_pango_reserved2" callback function.
1133func (x *FontFamilyClass) OverridePangoReserved2(cb func()) {
1134 if cb == nil {
1135 x.xPangoReserved2 = 0
1136 } else {
1137 x.xPangoReserved2 = purego.NewCallback(func() {
1138 cb()
1139 })
1140 }
1141}
1142
1143// GetPangoReserved2 gets the "_pango_reserved2" callback function.
1144func (x *FontFamilyClass) GetPangoReserved2() func() {
1145 if x.xPangoReserved2 == 0 {
1146 return nil
1147 }
1148 var rawCallback func()
1149 purego.RegisterFunc(&rawCallback, x.xPangoReserved2)
1150 return func() {
1151 rawCallback()
1152 }
1153}
1154
1155// A `PangoFontMetrics` structure holds the overall metric information
1156// for a font.
1157//
1158// The information in a `PangoFontMetrics` structure may be restricted
1159// to a script. The fields of this structure are private to implementations
1160// of a font backend. See the documentation of the corresponding getters
1161// for documentation of their meaning.
1162//
1163// For an overview of the most important metrics, see:
1164//
1165// <picture>
1166//
1167// <source srcset="fontmetrics-dark.png" media="(prefers-color-scheme: dark)">
1168// <img alt="Font metrics" src="fontmetrics-light.png">
1169//
1170// </picture>
1171type FontMetrics struct {
1172 _ structs.HostLayout
1173
1174 RefCount uint
1175
1176 Ascent int
1177
1178 Descent int
1179
1180 Height int
1181
1182 ApproximateCharWidth int
1183
1184 ApproximateDigitWidth int
1185
1186 UnderlinePosition int
1187
1188 UnderlineThickness int
1189
1190 StrikethroughPosition int
1191
1192 StrikethroughThickness int
1193}
1194
1195var xFontMetricsGLibType func() types.GType
1196
1197func FontMetricsGLibType() types.GType {
1198 return xFontMetricsGLibType()
1199}
1200
1201func (x *FontMetrics) GoPointer() uintptr {
1202 return uintptr(unsafe.Pointer(x))
1203}
1204
1205var xFontMetricsGetApproximateCharWidth func(uintptr) int
1206
1207// Gets the approximate character width for a font metrics structure.
1208//
1209// This is merely a representative value useful, for example, for
1210// determining the initial size for a window. Actual characters in
1211// text will be wider and narrower than this.
1212func (x *FontMetrics) GetApproximateCharWidth() int {
1213
1214 cret := xFontMetricsGetApproximateCharWidth(x.GoPointer())
1215 return cret
1216}
1217
1218var xFontMetricsGetApproximateDigitWidth func(uintptr) int
1219
1220// Gets the approximate digit width for a font metrics structure.
1221//
1222// This is merely a representative value useful, for example, for
1223// determining the initial size for a window. Actual digits in
1224// text can be wider or narrower than this, though this value
1225// is generally somewhat more accurate than the result of
1226// pango_font_metrics_get_approximate_char_width() for digits.
1227func (x *FontMetrics) GetApproximateDigitWidth() int {
1228
1229 cret := xFontMetricsGetApproximateDigitWidth(x.GoPointer())
1230 return cret
1231}
1232
1233var xFontMetricsGetAscent func(uintptr) int
1234
1235// Gets the ascent from a font metrics structure.
1236//
1237// The ascent is the distance from the baseline to the logical top
1238// of a line of text. (The logical top may be above or below the top
1239// of the actual drawn ink. It is necessary to lay out the text to
1240// figure where the ink will be.)
1241func (x *FontMetrics) GetAscent() int {
1242
1243 cret := xFontMetricsGetAscent(x.GoPointer())
1244 return cret
1245}
1246
1247var xFontMetricsGetDescent func(uintptr) int
1248
1249// Gets the descent from a font metrics structure.
1250//
1251// The descent is the distance from the baseline to the logical bottom
1252// of a line of text. (The logical bottom may be above or below the
1253// bottom of the actual drawn ink. It is necessary to lay out the text
1254// to figure where the ink will be.)
1255func (x *FontMetrics) GetDescent() int {
1256
1257 cret := xFontMetricsGetDescent(x.GoPointer())
1258 return cret
1259}
1260
1261var xFontMetricsGetHeight func(uintptr) int
1262
1263// Gets the line height from a font metrics structure.
1264//
1265// The line height is the recommended distance between successive
1266// baselines in wrapped text using this font.
1267//
1268// If the line height is not available, 0 is returned.
1269func (x *FontMetrics) GetHeight() int {
1270
1271 cret := xFontMetricsGetHeight(x.GoPointer())
1272 return cret
1273}
1274
1275var xFontMetricsGetStrikethroughPosition func(uintptr) int
1276
1277// Gets the suggested position to draw the strikethrough.
1278//
1279// The value returned is the distance *above* the
1280// baseline of the top of the strikethrough.
1281func (x *FontMetrics) GetStrikethroughPosition() int {
1282
1283 cret := xFontMetricsGetStrikethroughPosition(x.GoPointer())
1284 return cret
1285}
1286
1287var xFontMetricsGetStrikethroughThickness func(uintptr) int
1288
1289// Gets the suggested thickness to draw for the strikethrough.
1290func (x *FontMetrics) GetStrikethroughThickness() int {
1291
1292 cret := xFontMetricsGetStrikethroughThickness(x.GoPointer())
1293 return cret
1294}
1295
1296var xFontMetricsGetUnderlinePosition func(uintptr) int
1297
1298// Gets the suggested position to draw the underline.
1299//
1300// The value returned is the distance *above* the baseline of the top
1301// of the underline. Since most fonts have underline positions beneath
1302// the baseline, this value is typically negative.
1303func (x *FontMetrics) GetUnderlinePosition() int {
1304
1305 cret := xFontMetricsGetUnderlinePosition(x.GoPointer())
1306 return cret
1307}
1308
1309var xFontMetricsGetUnderlineThickness func(uintptr) int
1310
1311// Gets the suggested thickness to draw for the underline.
1312func (x *FontMetrics) GetUnderlineThickness() int {
1313
1314 cret := xFontMetricsGetUnderlineThickness(x.GoPointer())
1315 return cret
1316}
1317
1318var xFontMetricsRef func(uintptr) *FontMetrics
1319
1320// Increase the reference count of a font metrics structure by one.
1321func (x *FontMetrics) Ref() *FontMetrics {
1322
1323 cret := xFontMetricsRef(x.GoPointer())
1324 return cret
1325}
1326
1327var xFontMetricsUnref func(uintptr)
1328
1329// Decrease the reference count of a font metrics structure by one.
1330//
1331// If the result is zero, frees the structure and any associated memory.
1332func (x *FontMetrics) Unref() {
1333
1334 xFontMetricsUnref(x.GoPointer())
1335
1336}
1337
1338const (
1339 // A `PangoGlyph` value that indicates a zero-width empty glpyh.
1340 //
1341 // This is useful for example in shaper modules, to use as the glyph for
1342 // various zero-width Unicode characters (those passing [func@is_zero_width]).
1343 GLYPH_EMPTY Glyph = 268435455
1344 // A `PangoGlyph` value for invalid input.
1345 //
1346 // `PangoLayout` produces one such glyph per invalid input UTF-8 byte and such
1347 // a glyph is rendered as a crossed box.
1348 //
1349 // Note that this value is defined such that it has the %PANGO_GLYPH_UNKNOWN_FLAG
1350 // set.
1351 GLYPH_INVALID_INPUT Glyph = 4294967295
1352 // Flag used in `PangoGlyph` to turn a `gunichar` value of a valid Unicode
1353 // character into an unknown-character glyph for that `gunichar`.
1354 //
1355 // Such unknown-character glyphs may be rendered as a 'hex box'.
1356 GLYPH_UNKNOWN_FLAG Glyph = 268435456
1357)
1358
1359// The bits in a `PangoFontMask` correspond to the set fields in a
1360// `PangoFontDescription`.
1361type FontMask int
1362
1363var xFontMaskGLibType func() types.GType
1364
1365func FontMaskGLibType() types.GType {
1366 return xFontMaskGLibType()
1367}
1368
1369const (
1370
1371 // the font family is specified.
1372 FontMaskFamilyValue FontMask = 1
1373 // the font style is specified.
1374 FontMaskStyleValue FontMask = 2
1375 // the font variant is specified.
1376 FontMaskVariantValue FontMask = 4
1377 // the font weight is specified.
1378 FontMaskWeightValue FontMask = 8
1379 // the font stretch is specified.
1380 FontMaskStretchValue FontMask = 16
1381 // the font size is specified.
1382 FontMaskSizeValue FontMask = 32
1383 // The font gravity is specified.
1384 FontMaskGravityValue FontMask = 64
1385 // OpenType font variations are specified.
1386 FontMaskVariationsValue FontMask = 128
1387 // OpenType font features are specified.
1388 FontMaskFeaturesValue FontMask = 256
1389 // Font color is specified.
1390 FontMaskColorValue FontMask = 512
1391)
1392
1393// Specifies whether a font should or should not have color glyphs.
1394type FontColor int
1395
1396var xFontColorGLibType func() types.GType
1397
1398func FontColorGLibType() types.GType {
1399 return xFontColorGLibType()
1400}
1401
1402const (
1403
1404 // The font should not have color glyphs
1405 FontColorForbiddenValue FontColor = 0
1406 // The font should have color glyphs
1407 FontColorRequiredValue FontColor = 1
1408 // The font may or may not use color
1409 FontColorDontCareValue FontColor = 2
1410)
1411
1412// An enumeration specifying the width of the font relative to other designs
1413// within a family.
1414type Stretch int
1415
1416var xStretchGLibType func() types.GType
1417
1418func StretchGLibType() types.GType {
1419 return xStretchGLibType()
1420}
1421
1422const (
1423
1424 // ultra condensed width
1425 StretchUltraCondensedValue Stretch = 0
1426 // extra condensed width
1427 StretchExtraCondensedValue Stretch = 1
1428 // condensed width
1429 StretchCondensedValue Stretch = 2
1430 // semi condensed width
1431 StretchSemiCondensedValue Stretch = 3
1432 // the normal width
1433 StretchNormalValue Stretch = 4
1434 // semi expanded width
1435 StretchSemiExpandedValue Stretch = 5
1436 // expanded width
1437 StretchExpandedValue Stretch = 6
1438 // extra expanded width
1439 StretchExtraExpandedValue Stretch = 7
1440 // ultra expanded width
1441 StretchUltraExpandedValue Stretch = 8
1442)
1443
1444// An enumeration specifying the various slant styles possible for a font.
1445type Style int
1446
1447var xStyleGLibType func() types.GType
1448
1449func StyleGLibType() types.GType {
1450 return xStyleGLibType()
1451}
1452
1453const (
1454
1455 // the font is upright.
1456 StyleNormalValue Style = 0
1457 // the font is slanted, but in a roman style.
1458 StyleObliqueValue Style = 1
1459 // the font is slanted in an italic style.
1460 StyleItalicValue Style = 2
1461)
1462
1463// An enumeration specifying capitalization variant of the font.
1464type Variant int
1465
1466var xVariantGLibType func() types.GType
1467
1468func VariantGLibType() types.GType {
1469 return xVariantGLibType()
1470}
1471
1472const (
1473
1474 // A normal font.
1475 VariantNormalValue Variant = 0
1476 // A font with the lower case characters
1477 // replaced by smaller variants of the capital characters.
1478 VariantSmallCapsValue Variant = 1
1479 // A font with all characters
1480 // replaced by smaller variants of the capital characters. Since: 1.50
1481 VariantAllSmallCapsValue Variant = 2
1482 // A font with the lower case characters
1483 // replaced by smaller variants of the capital characters.
1484 // Petite Caps can be even smaller than Small Caps. Since: 1.50
1485 VariantPetiteCapsValue Variant = 3
1486 // A font with all characters
1487 // replaced by smaller variants of the capital characters.
1488 // Petite Caps can be even smaller than Small Caps. Since: 1.50
1489 VariantAllPetiteCapsValue Variant = 4
1490 // A font with the upper case characters
1491 // replaced by smaller variants of the capital letters. Since: 1.50
1492 VariantUnicaseValue Variant = 5
1493 // A font with capital letters that
1494 // are more suitable for all-uppercase titles. Since: 1.50
1495 VariantTitleCapsValue Variant = 6
1496)
1497
1498// An enumeration specifying the weight (boldness) of a font.
1499//
1500// Weight is specified as a numeric value ranging from 100 to 1000.
1501// This enumeration simply provides some common, predefined values.
1502type Weight int
1503
1504var xWeightGLibType func() types.GType
1505
1506func WeightGLibType() types.GType {
1507 return xWeightGLibType()
1508}
1509
1510const (
1511
1512 // the thin weight (= 100) Since: 1.24
1513 WeightThinValue Weight = 100
1514 // the ultralight weight (= 200)
1515 WeightUltralightValue Weight = 200
1516 // the light weight (= 300)
1517 WeightLightValue Weight = 300
1518 // the semilight weight (= 350) Since: 1.36.7
1519 WeightSemilightValue Weight = 350
1520 // the book weight (= 380) Since: 1.24)
1521 WeightBookValue Weight = 380
1522 // the default weight (= 400)
1523 WeightNormalValue Weight = 400
1524 // the medium weight (= 500) Since: 1.24
1525 WeightMediumValue Weight = 500
1526 // the semibold weight (= 600)
1527 WeightSemiboldValue Weight = 600
1528 // the bold weight (= 700)
1529 WeightBoldValue Weight = 700
1530 // the ultrabold weight (= 800)
1531 WeightUltraboldValue Weight = 800
1532 // the heavy weight (= 900)
1533 WeightHeavyValue Weight = 900
1534 // the ultraheavy weight (= 1000) Since: 1.24
1535 WeightUltraheavyValue Weight = 1000
1536)
1537
1538var xFontDescriptionFromString func(string) *FontDescription
1539
1540// Creates a new font description from a string representation.
1541//
1542// The string must have the form
1543//
1544// [FAMILY-LIST] [STYLE-OPTIONS] [SIZE] [VARIATIONS] [FEATURES]
1545//
1546// where FAMILY-LIST is a comma-separated list of families optionally
1547// terminated by a comma, STYLE_OPTIONS is a whitespace-separated list
1548// of words where each word describes one of style, variant, weight,
1549// stretch, or gravity, and SIZE is a decimal number (size in points)
1550// or optionally followed by the unit modifier "px" for absolute size.
1551//
1552// The following words are understood as styles:
1553// "Normal", "Roman", "Oblique", "Italic".
1554//
1555// The following words are understood as variants:
1556// "Small-Caps", "All-Small-Caps", "Petite-Caps", "All-Petite-Caps",
1557// "Unicase", "Title-Caps".
1558//
1559// The following words are understood as weights:
1560// "Thin", "Ultra-Light", "Extra-Light", "Light", "Semi-Light",
1561// "Demi-Light", "Book", "Regular", "Medium", "Semi-Bold", "Demi-Bold",
1562// "Bold", "Ultra-Bold", "Extra-Bold", "Heavy", "Black", "Ultra-Black",
1563// "Extra-Black".
1564//
1565// The following words are understood as stretch values:
1566// "Ultra-Condensed", "Extra-Condensed", "Condensed", "Semi-Condensed",
1567// "Semi-Expanded", "Expanded", "Extra-Expanded", "Ultra-Expanded".
1568//
1569// The following words are understood as gravity values:
1570// "Not-Rotated", "South", "Upside-Down", "North", "Rotated-Left",
1571// "East", "Rotated-Right", "West".
1572//
1573// The following words are understood as color values:
1574// "With-Color", "Without-Color".
1575//
1576// VARIATIONS is a comma-separated list of font variations
1577// of the form @<U+200D>axis1=value,axis2=value,...
1578//
1579// FEATURES is a comma-separated list of font features of the form
1580// \#<U+200D>feature1=value,feature2=value,...
1581// The =value part can be ommitted if the value is 1.
1582//
1583// Any one of the options may be absent. If FAMILY-LIST is absent, then
1584// the family_name field of the resulting font description will be
1585// initialized to %NULL. If STYLE-OPTIONS is missing, then all style
1586// options will be set to the default values. If SIZE is missing, the
1587// size in the resulting font description will be set to 0.
1588//
1589// A typical example:
1590//
1591// Cantarell Italic Light 15 @<U+200D>wght=200 #<U+200D>tnum=1
1592func FontDescriptionFromString(StrVar string) *FontDescription {
1593
1594 cret := xFontDescriptionFromString(StrVar)
1595 return cret
1596}
1597
1598// A `PangoFont` is used to represent a font in a
1599// rendering-system-independent manner.
1600type Font struct {
1601 gobject.Object
1602}
1603
1604var xFontGLibType func() types.GType
1605
1606func FontGLibType() types.GType {
1607 return xFontGLibType()
1608}
1609
1610func FontNewFromInternalPtr(ptr uintptr) *Font {
1611 cls := &Font{}
1612 cls.Ptr = ptr
1613 return cls
1614}
1615
1616var xFontDescribe func(uintptr) *FontDescription
1617
1618// Returns a description of the font, with font size set in points.
1619//
1620// Use [method@Pango.Font.describe_with_absolute_size] if you want
1621// the font size in device units.
1622func (x *Font) Describe() *FontDescription {
1623
1624 cret := xFontDescribe(x.GoPointer())
1625 return cret
1626}
1627
1628var xFontDescribeWithAbsoluteSize func(uintptr) *FontDescription
1629
1630// Returns a description of the font, with absolute font size set
1631// in device units.
1632//
1633// Use [method@Pango.Font.describe] if you want the font size in points.
1634func (x *Font) DescribeWithAbsoluteSize() *FontDescription {
1635
1636 cret := xFontDescribeWithAbsoluteSize(x.GoPointer())
1637 return cret
1638}
1639
1640var xFontGetCoverage func(uintptr, *Language) uintptr
1641
1642// Computes the coverage map for a given font and language tag.
1643func (x *Font) GetCoverage(LanguageVar *Language) *Coverage {
1644 var cls *Coverage
1645
1646 cret := xFontGetCoverage(x.GoPointer(), LanguageVar)
1647
1648 if cret == 0 {
1649 return nil
1650 }
1651 cls = &Coverage{}
1652 cls.Ptr = cret
1653 return cls
1654}
1655
1656var xFontGetFace func(uintptr) uintptr
1657
1658// Gets the `PangoFontFace` to which @font belongs.
1659//
1660// Note that this function can return `NULL` in cases
1661// where the font outlives its font map.
1662func (x *Font) GetFace() *FontFace {
1663 var cls *FontFace
1664
1665 cret := xFontGetFace(x.GoPointer())
1666
1667 if cret == 0 {
1668 return nil
1669 }
1670 gobject.IncreaseRef(cret)
1671 cls = &FontFace{}
1672 cls.Ptr = cret
1673 return cls
1674}
1675
1676var xFontGetFeatures func(uintptr, *[]uintptr, uint, uint)
1677
1678// Obtain the OpenType features that are provided by the font.
1679//
1680// These are passed to the rendering system, together with features
1681// that have been explicitly set via attributes.
1682//
1683// Note that this does not include OpenType features which the
1684// rendering system enables by default.
1685func (x *Font) GetFeatures(FeaturesVar *[]uintptr, LenVar uint, NumFeaturesVar uint) {
1686
1687 xFontGetFeatures(x.GoPointer(), FeaturesVar, LenVar, NumFeaturesVar)
1688
1689}
1690
1691var xFontGetFontMap func(uintptr) uintptr
1692
1693// Gets the font map for which the font was created.
1694//
1695// Note that the font maintains a *weak* reference to
1696// the font map, so if all references to font map are
1697// dropped, the font map will be finalized even if there
1698// are fonts created with the font map that are still alive.
1699// In that case this function will return %NULL.
1700//
1701// It is the responsibility of the user to ensure that the
1702// font map is kept alive. In most uses this is not an issue
1703// as a `PangoContext` holds a reference to the font map.
1704func (x *Font) GetFontMap() *FontMap {
1705 var cls *FontMap
1706
1707 cret := xFontGetFontMap(x.GoPointer())
1708
1709 if cret == 0 {
1710 return nil
1711 }
1712 gobject.IncreaseRef(cret)
1713 cls = &FontMap{}
1714 cls.Ptr = cret
1715 return cls
1716}
1717
1718var xFontGetGlyphExtents func(uintptr, Glyph, *Rectangle, *Rectangle)
1719
1720// Gets the logical and ink extents of a glyph within a font.
1721//
1722// The coordinate system for each rectangle has its origin at the
1723// base line and horizontal origin of the character with increasing
1724// coordinates extending to the right and down. The macros PANGO_ASCENT(),
1725// PANGO_DESCENT(), PANGO_LBEARING(), and PANGO_RBEARING() can be used to convert
1726// from the extents rectangle to more traditional font metrics. The units
1727// of the rectangles are in 1/PANGO_SCALE of a device unit.
1728//
1729// If @font is %NULL, this function gracefully sets some sane values in the
1730// output variables and returns.
1731func (x *Font) GetGlyphExtents(GlyphVar Glyph, InkRectVar *Rectangle, LogicalRectVar *Rectangle) {
1732
1733 xFontGetGlyphExtents(x.GoPointer(), GlyphVar, InkRectVar, LogicalRectVar)
1734
1735}
1736
1737var xFontGetHbFont func(uintptr) uintptr
1738
1739// Get a `hb_font_t` object backing this font.
1740//
1741// Note that the objects returned by this function are cached
1742// and immutable. If you need to make changes to the `hb_font_t`,
1743// use [hb_font_create_sub_font()](https://harfbuzz.github.io/harfbuzz-hb-font.html#hb-font-create-sub-font).
1744func (x *Font) GetHbFont() uintptr {
1745
1746 cret := xFontGetHbFont(x.GoPointer())
1747 return cret
1748}
1749
1750var xFontGetLanguages func(uintptr) uintptr
1751
1752// Returns the languages that are supported by @font.
1753//
1754// If the font backend does not provide this information,
1755// %NULL is returned. For the fontconfig backend, this
1756// corresponds to the FC_LANG member of the FcPattern.
1757//
1758// The returned array is only valid as long as the font
1759// and its fontmap are valid.
1760func (x *Font) GetLanguages() uintptr {
1761
1762 cret := xFontGetLanguages(x.GoPointer())
1763 return cret
1764}
1765
1766var xFontGetMetrics func(uintptr, *Language) *FontMetrics
1767
1768// Gets overall metric information for a font.
1769//
1770// Since the metrics may be substantially different for different scripts,
1771// a language tag can be provided to indicate that the metrics should be
1772// retrieved that correspond to the script(s) used by that language.
1773//
1774// If @font is %NULL, this function gracefully sets some sane values in the
1775// output variables and returns.
1776func (x *Font) GetMetrics(LanguageVar *Language) *FontMetrics {
1777
1778 cret := xFontGetMetrics(x.GoPointer(), LanguageVar)
1779 return cret
1780}
1781
1782var xFontHasChar func(uintptr, uint32) bool
1783
1784// Returns whether the font provides a glyph for this character.
1785func (x *Font) HasChar(WcVar uint32) bool {
1786
1787 cret := xFontHasChar(x.GoPointer(), WcVar)
1788 return cret
1789}
1790
1791var xFontSerialize func(uintptr) *glib.Bytes
1792
1793// Serializes the @font in a way that can be uniquely identified.
1794//
1795// There are no guarantees about the format of the output across different
1796// versions of Pango.
1797//
1798// The intended use of this function is testing, benchmarking and debugging.
1799// The format is not meant as a permanent storage format.
1800//
1801// To recreate a font from its serialized form, use [func@Pango.Font.deserialize].
1802func (x *Font) Serialize() *glib.Bytes {
1803
1804 cret := xFontSerialize(x.GoPointer())
1805 return cret
1806}
1807
1808func (c *Font) GoPointer() uintptr {
1809 if c == nil {
1810 return 0
1811 }
1812 return c.Ptr
1813}
1814
1815func (c *Font) SetGoPointer(ptr uintptr) {
1816 c.Ptr = ptr
1817}
1818
1819var xFontDescriptionsFree func(uintptr, int)
1820
1821// Frees an array of font descriptions.
1822func FontDescriptionsFree(DescsVar uintptr, NDescsVar int) {
1823
1824 xFontDescriptionsFree(DescsVar, NDescsVar)
1825
1826}
1827
1828var xFontDeserialize func(uintptr, *glib.Bytes, **glib.Error) uintptr
1829
1830// Loads data previously created via [method@Pango.Font.serialize].
1831//
1832// For a discussion of the supported format, see that function.
1833//
1834// Note: to verify that the returned font is identical to
1835// the one that was serialized, you can compare @bytes to the
1836// result of serializing the font again.
1837func FontDeserialize(ContextVar *Context, BytesVar *glib.Bytes) (*Font, error) {
1838 var cls *Font
1839 var cerr *glib.Error
1840
1841 cret := xFontDeserialize(ContextVar.GoPointer(), BytesVar, &cerr)
1842
1843 if cret == 0 {
1844 return nil, cerr
1845 }
1846 cls = &Font{}
1847 cls.Ptr = cret
1848 if cerr == nil {
1849 return cls, nil
1850 }
1851 return cls, cerr
1852
1853}
1854
1855// A `PangoFontFace` is used to represent a group of fonts with
1856// the same family, slant, weight, and width, but varying sizes.
1857type FontFace struct {
1858 gobject.Object
1859}
1860
1861var xFontFaceGLibType func() types.GType
1862
1863func FontFaceGLibType() types.GType {
1864 return xFontFaceGLibType()
1865}
1866
1867func FontFaceNewFromInternalPtr(ptr uintptr) *FontFace {
1868 cls := &FontFace{}
1869 cls.Ptr = ptr
1870 return cls
1871}
1872
1873var xFontFaceDescribe func(uintptr) *FontDescription
1874
1875// Returns a font description that matches the face.
1876//
1877// The resulting font description will have the family, style,
1878// variant, weight and stretch of the face, but its size field
1879// will be unset.
1880func (x *FontFace) Describe() *FontDescription {
1881
1882 cret := xFontFaceDescribe(x.GoPointer())
1883 return cret
1884}
1885
1886var xFontFaceGetFaceName func(uintptr) string
1887
1888// Gets a name representing the style of this face.
1889//
1890// Note that a font family may contain multiple faces
1891// with the same name (e.g. a variable and a non-variable
1892// face for the same style).
1893func (x *FontFace) GetFaceName() string {
1894
1895 cret := xFontFaceGetFaceName(x.GoPointer())
1896 return cret
1897}
1898
1899var xFontFaceGetFamily func(uintptr) uintptr
1900
1901// Gets the `PangoFontFamily` that @face belongs to.
1902func (x *FontFace) GetFamily() *FontFamily {
1903 var cls *FontFamily
1904
1905 cret := xFontFaceGetFamily(x.GoPointer())
1906
1907 if cret == 0 {
1908 return nil
1909 }
1910 gobject.IncreaseRef(cret)
1911 cls = &FontFamily{}
1912 cls.Ptr = cret
1913 return cls
1914}
1915
1916var xFontFaceIsSynthesized func(uintptr) bool
1917
1918// Returns whether a `PangoFontFace` is synthesized.
1919//
1920// This will be the case if the underlying font rendering engine
1921// creates this face from another face, by shearing, emboldening,
1922// lightening or modifying it in some other way.
1923func (x *FontFace) IsSynthesized() bool {
1924
1925 cret := xFontFaceIsSynthesized(x.GoPointer())
1926 return cret
1927}
1928
1929var xFontFaceListSizes func(uintptr, *[]int, *int)
1930
1931// List the available sizes for a font.
1932//
1933// This is only applicable to bitmap fonts. For scalable fonts, stores
1934// %NULL at the location pointed to by @sizes and 0 at the location pointed
1935// to by @n_sizes. The sizes returned are in Pango units and are sorted
1936// in ascending order.
1937func (x *FontFace) ListSizes(SizesVar *[]int, NSizesVar *int) {
1938
1939 xFontFaceListSizes(x.GoPointer(), SizesVar, NSizesVar)
1940
1941}
1942
1943func (c *FontFace) GoPointer() uintptr {
1944 if c == nil {
1945 return 0
1946 }
1947 return c.Ptr
1948}
1949
1950func (c *FontFace) SetGoPointer(ptr uintptr) {
1951 c.Ptr = ptr
1952}
1953
1954// A `PangoFontFamily` is used to represent a family of related
1955// font faces.
1956//
1957// The font faces in a family share a common design, but differ in
1958// slant, weight, width or other aspects.
1959type FontFamily struct {
1960 gobject.Object
1961}
1962
1963var xFontFamilyGLibType func() types.GType
1964
1965func FontFamilyGLibType() types.GType {
1966 return xFontFamilyGLibType()
1967}
1968
1969func FontFamilyNewFromInternalPtr(ptr uintptr) *FontFamily {
1970 cls := &FontFamily{}
1971 cls.Ptr = ptr
1972 return cls
1973}
1974
1975var xFontFamilyGetFace func(uintptr, uintptr) uintptr
1976
1977// Gets the `PangoFontFace` of @family with the given name.
1978func (x *FontFamily) GetFace(NameVar *string) *FontFace {
1979 var cls *FontFace
1980
1981 NameVarPtr := core.GStrdupNullable(NameVar)
1982 defer core.GFreeNullable(NameVarPtr)
1983
1984 cret := xFontFamilyGetFace(x.GoPointer(), NameVarPtr)
1985
1986 if cret == 0 {
1987 return nil
1988 }
1989 gobject.IncreaseRef(cret)
1990 cls = &FontFace{}
1991 cls.Ptr = cret
1992 return cls
1993}
1994
1995var xFontFamilyGetName func(uintptr) string
1996
1997// Gets the name of the family.
1998//
1999// The name is unique among all fonts for the font backend and can
2000// be used in a `PangoFontDescription` to specify that a face from
2001// this family is desired.
2002func (x *FontFamily) GetName() string {
2003
2004 cret := xFontFamilyGetName(x.GoPointer())
2005 return cret
2006}
2007
2008var xFontFamilyIsMonospace func(uintptr) bool
2009
2010// A monospace font is a font designed for text display where the the
2011// characters form a regular grid.
2012//
2013// For Western languages this would
2014// mean that the advance width of all characters are the same, but
2015// this categorization also includes Asian fonts which include
2016// double-width characters: characters that occupy two grid cells.
2017// g_unichar_iswide() returns a result that indicates whether a
2018// character is typically double-width in a monospace font.
2019//
2020// The best way to find out the grid-cell size is to call
2021// [method@Pango.FontMetrics.get_approximate_digit_width], since the
2022// results of [method@Pango.FontMetrics.get_approximate_char_width] may
2023// be affected by double-width characters.
2024func (x *FontFamily) IsMonospace() bool {
2025
2026 cret := xFontFamilyIsMonospace(x.GoPointer())
2027 return cret
2028}
2029
2030var xFontFamilyIsVariable func(uintptr) bool
2031
2032// A variable font is a font which has axes that can be modified to
2033// produce different faces.
2034//
2035// Such axes are also known as _variations_; see
2036// [method@Pango.FontDescription.set_variations] for more information.
2037func (x *FontFamily) IsVariable() bool {
2038
2039 cret := xFontFamilyIsVariable(x.GoPointer())
2040 return cret
2041}
2042
2043var xFontFamilyListFaces func(uintptr, *uintptr, *int)
2044
2045// Lists the different font faces that make up @family.
2046//
2047// The faces in a family share a common design, but differ in slant, weight,
2048// width and other aspects.
2049//
2050// Note that the returned faces are not in any particular order, and
2051// multiple faces may have the same name or characteristics.
2052//
2053// `PangoFontFamily` also implemented the [iface@Gio.ListModel] interface
2054// for enumerating faces.
2055func (x *FontFamily) ListFaces(FacesVar *uintptr, NFacesVar *int) {
2056
2057 xFontFamilyListFaces(x.GoPointer(), FacesVar, NFacesVar)
2058
2059}
2060
2061func (c *FontFamily) GoPointer() uintptr {
2062 if c == nil {
2063 return 0
2064 }
2065 return c.Ptr
2066}
2067
2068func (c *FontFamily) SetGoPointer(ptr uintptr) {
2069 c.Ptr = ptr
2070}
2071
2072// GetPropertyIsMonospace gets the "is-monospace" property.
2073// Is this a monospace font
2074func (x *FontFamily) GetPropertyIsMonospace() bool {
2075 var v gobject.Value
2076 x.GetProperty("is-monospace", &v)
2077 return v.GetBoolean()
2078}
2079
2080// GetPropertyIsVariable gets the "is-variable" property.
2081// Is this a variable font
2082func (x *FontFamily) GetPropertyIsVariable() bool {
2083 var v gobject.Value
2084 x.GetProperty("is-variable", &v)
2085 return v.GetBoolean()
2086}
2087
2088// GetPropertyNItems gets the "n-items" property.
2089// The number of items contained in this list.
2090func (x *FontFamily) GetPropertyNItems() uint {
2091 var v gobject.Value
2092 x.GetProperty("n-items", &v)
2093 return v.GetUint()
2094}
2095
2096// GetPropertyName gets the "name" property.
2097// The name of the family
2098func (x *FontFamily) GetPropertyName() string {
2099 var v gobject.Value
2100 x.GetProperty("name", &v)
2101 return v.GetString()
2102}
2103
2104// Get the item at @position.
2105//
2106// If @position is greater than the number of items in @list, %NULL is
2107// returned.
2108//
2109// %NULL is never returned for an index that is smaller than the length
2110// of the list.
2111//
2112// See also: g_list_model_get_n_items()
2113func (x *FontFamily) GetItem(PositionVar uint) uintptr {
2114
2115 cret := gio.XGListModelGetItem(x.GoPointer(), PositionVar)
2116 return cret
2117}
2118
2119// Gets the type of the items in @list.
2120//
2121// All items returned from g_list_model_get_item() are of the type
2122// returned by this function, or a subtype, or if the type is an
2123// interface, they are an implementation of that interface.
2124//
2125// The item type of a #GListModel can not change during the life of the
2126// model.
2127func (x *FontFamily) GetItemType() types.GType {
2128
2129 cret := gio.XGListModelGetItemType(x.GoPointer())
2130 return cret
2131}
2132
2133// Gets the number of items in @list.
2134//
2135// Depending on the model implementation, calling this function may be
2136// less efficient than iterating the list with increasing values for
2137// @position until g_list_model_get_item() returns %NULL.
2138func (x *FontFamily) GetNItems() uint {
2139
2140 cret := gio.XGListModelGetNItems(x.GoPointer())
2141 return cret
2142}
2143
2144// Get the item at @position.
2145//
2146// If @position is greater than the number of items in @list, %NULL is
2147// returned.
2148//
2149// %NULL is never returned for an index that is smaller than the length
2150// of the list.
2151//
2152// This function is meant to be used by language bindings in place
2153// of g_list_model_get_item().
2154//
2155// See also: g_list_model_get_n_items()
2156func (x *FontFamily) GetObject(PositionVar uint) *gobject.Object {
2157 var cls *gobject.Object
2158
2159 cret := gio.XGListModelGetObject(x.GoPointer(), PositionVar)
2160
2161 if cret == 0 {
2162 return nil
2163 }
2164 cls = &gobject.Object{}
2165 cls.Ptr = cret
2166 return cls
2167}
2168
2169// Emits the #GListModel::items-changed signal on @list.
2170//
2171// This function should only be called by classes implementing
2172// #GListModel. It has to be called after the internal representation
2173// of @list has been updated, because handlers connected to this signal
2174// might query the new state of the list.
2175//
2176// Implementations must only make changes to the model (as visible to
2177// its consumer) in places that will not cause problems for that
2178// consumer. For models that are driven directly by a write API (such
2179// as #GListStore), changes can be reported in response to uses of that
2180// API. For models that represent remote data, changes should only be
2181// made from a fresh mainloop dispatch. It is particularly not
2182// permitted to make changes in response to a call to the #GListModel
2183// consumer API.
2184//
2185// Stated another way: in general, it is assumed that code making a
2186// series of accesses to the model via the API, without returning to the
2187// mainloop, and without calling other code, will continue to view the
2188// same contents of the model.
2189func (x *FontFamily) ItemsChanged(PositionVar uint, RemovedVar uint, AddedVar uint) {
2190
2191 gio.XGListModelItemsChanged(x.GoPointer(), PositionVar, RemovedVar, AddedVar)
2192
2193}
2194
2195func init() {
2196 core.SetPackageName("PANGO", "pango")
2197 core.SetSharedLibraries("PANGO", []string{"libpango-1.0.so.0"})
2198 var libs []uintptr
2199 for _, libPath := range core.GetPaths("PANGO") {
2200 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
2201 if err != nil {
2202 panic(err)
2203 }
2204 libs = append(libs, lib)
2205 }
2206
2207 core.PuregoSafeRegister(&xFontMaskGLibType, libs, "pango_font_mask_get_type")
2208
2209 core.PuregoSafeRegister(&xFontColorGLibType, libs, "pango_font_color_get_type")
2210
2211 core.PuregoSafeRegister(&xStretchGLibType, libs, "pango_stretch_get_type")
2212
2213 core.PuregoSafeRegister(&xStyleGLibType, libs, "pango_style_get_type")
2214
2215 core.PuregoSafeRegister(&xVariantGLibType, libs, "pango_variant_get_type")
2216
2217 core.PuregoSafeRegister(&xWeightGLibType, libs, "pango_weight_get_type")
2218
2219 core.PuregoSafeRegister(&xFontDescriptionFromString, libs, "pango_font_description_from_string")
2220
2221 core.PuregoSafeRegister(&xFontDescriptionGLibType, libs, "pango_font_description_get_type")
2222
2223 core.PuregoSafeRegister(&xNewFontDescription, libs, "pango_font_description_new")
2224
2225 core.PuregoSafeRegister(&xFontDescriptionBetterMatch, libs, "pango_font_description_better_match")
2226 core.PuregoSafeRegister(&xFontDescriptionCopy, libs, "pango_font_description_copy")
2227 core.PuregoSafeRegister(&xFontDescriptionCopyStatic, libs, "pango_font_description_copy_static")
2228 core.PuregoSafeRegister(&xFontDescriptionEqual, libs, "pango_font_description_equal")
2229 core.PuregoSafeRegister(&xFontDescriptionFree, libs, "pango_font_description_free")
2230 core.PuregoSafeRegister(&xFontDescriptionGetColor, libs, "pango_font_description_get_color")
2231 core.PuregoSafeRegister(&xFontDescriptionGetFamily, libs, "pango_font_description_get_family")
2232 core.PuregoSafeRegister(&xFontDescriptionGetFeatures, libs, "pango_font_description_get_features")
2233 core.PuregoSafeRegister(&xFontDescriptionGetGravity, libs, "pango_font_description_get_gravity")
2234 core.PuregoSafeRegister(&xFontDescriptionGetSetFields, libs, "pango_font_description_get_set_fields")
2235 core.PuregoSafeRegister(&xFontDescriptionGetSize, libs, "pango_font_description_get_size")
2236 core.PuregoSafeRegister(&xFontDescriptionGetSizeIsAbsolute, libs, "pango_font_description_get_size_is_absolute")
2237 core.PuregoSafeRegister(&xFontDescriptionGetStretch, libs, "pango_font_description_get_stretch")
2238 core.PuregoSafeRegister(&xFontDescriptionGetStyle, libs, "pango_font_description_get_style")
2239 core.PuregoSafeRegister(&xFontDescriptionGetVariant, libs, "pango_font_description_get_variant")
2240 core.PuregoSafeRegister(&xFontDescriptionGetVariations, libs, "pango_font_description_get_variations")
2241 core.PuregoSafeRegister(&xFontDescriptionGetWeight, libs, "pango_font_description_get_weight")
2242 core.PuregoSafeRegister(&xFontDescriptionHash, libs, "pango_font_description_hash")
2243 core.PuregoSafeRegister(&xFontDescriptionMerge, libs, "pango_font_description_merge")
2244 core.PuregoSafeRegister(&xFontDescriptionMergeStatic, libs, "pango_font_description_merge_static")
2245 core.PuregoSafeRegister(&xFontDescriptionSetAbsoluteSize, libs, "pango_font_description_set_absolute_size")
2246 core.PuregoSafeRegister(&xFontDescriptionSetColor, libs, "pango_font_description_set_color")
2247 core.PuregoSafeRegister(&xFontDescriptionSetFamily, libs, "pango_font_description_set_family")
2248 core.PuregoSafeRegister(&xFontDescriptionSetFamilyStatic, libs, "pango_font_description_set_family_static")
2249 core.PuregoSafeRegister(&xFontDescriptionSetFeatures, libs, "pango_font_description_set_features")
2250 core.PuregoSafeRegister(&xFontDescriptionSetFeaturesStatic, libs, "pango_font_description_set_features_static")
2251 core.PuregoSafeRegister(&xFontDescriptionSetGravity, libs, "pango_font_description_set_gravity")
2252 core.PuregoSafeRegister(&xFontDescriptionSetSize, libs, "pango_font_description_set_size")
2253 core.PuregoSafeRegister(&xFontDescriptionSetStretch, libs, "pango_font_description_set_stretch")
2254 core.PuregoSafeRegister(&xFontDescriptionSetStyle, libs, "pango_font_description_set_style")
2255 core.PuregoSafeRegister(&xFontDescriptionSetVariant, libs, "pango_font_description_set_variant")
2256 core.PuregoSafeRegister(&xFontDescriptionSetVariations, libs, "pango_font_description_set_variations")
2257 core.PuregoSafeRegister(&xFontDescriptionSetVariationsStatic, libs, "pango_font_description_set_variations_static")
2258 core.PuregoSafeRegister(&xFontDescriptionSetWeight, libs, "pango_font_description_set_weight")
2259 core.PuregoSafeRegister(&xFontDescriptionToFilename, libs, "pango_font_description_to_filename")
2260 core.PuregoSafeRegister(&xFontDescriptionToString, libs, "pango_font_description_to_string")
2261 core.PuregoSafeRegister(&xFontDescriptionUnsetFields, libs, "pango_font_description_unset_fields")
2262
2263 core.PuregoSafeRegister(&xFontMetricsGLibType, libs, "pango_font_metrics_get_type")
2264
2265 core.PuregoSafeRegister(&xFontMetricsGetApproximateCharWidth, libs, "pango_font_metrics_get_approximate_char_width")
2266 core.PuregoSafeRegister(&xFontMetricsGetApproximateDigitWidth, libs, "pango_font_metrics_get_approximate_digit_width")
2267 core.PuregoSafeRegister(&xFontMetricsGetAscent, libs, "pango_font_metrics_get_ascent")
2268 core.PuregoSafeRegister(&xFontMetricsGetDescent, libs, "pango_font_metrics_get_descent")
2269 core.PuregoSafeRegister(&xFontMetricsGetHeight, libs, "pango_font_metrics_get_height")
2270 core.PuregoSafeRegister(&xFontMetricsGetStrikethroughPosition, libs, "pango_font_metrics_get_strikethrough_position")
2271 core.PuregoSafeRegister(&xFontMetricsGetStrikethroughThickness, libs, "pango_font_metrics_get_strikethrough_thickness")
2272 core.PuregoSafeRegister(&xFontMetricsGetUnderlinePosition, libs, "pango_font_metrics_get_underline_position")
2273 core.PuregoSafeRegister(&xFontMetricsGetUnderlineThickness, libs, "pango_font_metrics_get_underline_thickness")
2274 core.PuregoSafeRegister(&xFontMetricsRef, libs, "pango_font_metrics_ref")
2275 core.PuregoSafeRegister(&xFontMetricsUnref, libs, "pango_font_metrics_unref")
2276
2277 core.PuregoSafeRegister(&xFontGLibType, libs, "pango_font_get_type")
2278
2279 core.PuregoSafeRegister(&xFontDescribe, libs, "pango_font_describe")
2280 core.PuregoSafeRegister(&xFontDescribeWithAbsoluteSize, libs, "pango_font_describe_with_absolute_size")
2281 core.PuregoSafeRegister(&xFontGetCoverage, libs, "pango_font_get_coverage")
2282 core.PuregoSafeRegister(&xFontGetFace, libs, "pango_font_get_face")
2283 core.PuregoSafeRegister(&xFontGetFeatures, libs, "pango_font_get_features")
2284 core.PuregoSafeRegister(&xFontGetFontMap, libs, "pango_font_get_font_map")
2285 core.PuregoSafeRegister(&xFontGetGlyphExtents, libs, "pango_font_get_glyph_extents")
2286 core.PuregoSafeRegister(&xFontGetHbFont, libs, "pango_font_get_hb_font")
2287 core.PuregoSafeRegister(&xFontGetLanguages, libs, "pango_font_get_languages")
2288 core.PuregoSafeRegister(&xFontGetMetrics, libs, "pango_font_get_metrics")
2289 core.PuregoSafeRegister(&xFontHasChar, libs, "pango_font_has_char")
2290 core.PuregoSafeRegister(&xFontSerialize, libs, "pango_font_serialize")
2291
2292 core.PuregoSafeRegister(&xFontDescriptionsFree, libs, "pango_font_descriptions_free")
2293 core.PuregoSafeRegister(&xFontDeserialize, libs, "pango_font_deserialize")
2294
2295 core.PuregoSafeRegister(&xFontFaceGLibType, libs, "pango_font_face_get_type")
2296
2297 core.PuregoSafeRegister(&xFontFaceDescribe, libs, "pango_font_face_describe")
2298 core.PuregoSafeRegister(&xFontFaceGetFaceName, libs, "pango_font_face_get_face_name")
2299 core.PuregoSafeRegister(&xFontFaceGetFamily, libs, "pango_font_face_get_family")
2300 core.PuregoSafeRegister(&xFontFaceIsSynthesized, libs, "pango_font_face_is_synthesized")
2301 core.PuregoSafeRegister(&xFontFaceListSizes, libs, "pango_font_face_list_sizes")
2302
2303 core.PuregoSafeRegister(&xFontFamilyGLibType, libs, "pango_font_family_get_type")
2304
2305 core.PuregoSafeRegister(&xFontFamilyGetFace, libs, "pango_font_family_get_face")
2306 core.PuregoSafeRegister(&xFontFamilyGetName, libs, "pango_font_family_get_name")
2307 core.PuregoSafeRegister(&xFontFamilyIsMonospace, libs, "pango_font_family_is_monospace")
2308 core.PuregoSafeRegister(&xFontFamilyIsVariable, libs, "pango_font_family_is_variable")
2309 core.PuregoSafeRegister(&xFontFamilyListFaces, libs, "pango_font_family_list_faces")
2310
2311}