Skip to content

Pango.Coverage

class — extends GObject.Object

A PangoCoverage structure is a map from Unicode characters to CoverageLevel values.

It is often necessary in Pango to determine if a particular font can represent a particular character, and also how well it can represent that character. The PangoCoverage is a data structure that is used to represent that information. It is an opaque structure with no public fields.

Constructors

new

@classmethod
def new(cls) -> Coverage

Create a new PangoCoverage

Methods

copy

def copy(self) -> Coverage

Copy an existing PangoCoverage.

get

def get(self, index_: int) -> CoverageLevel

Determine whether a particular index is covered by coverage.

Parameters:

  • index_ — the index to check

max

def max(self, other: Coverage) -> None

:::warning Deprecated since 1.44 This API is deprecated. :::

Set the coverage for each index in coverage to be the max (better) value of the current coverage for the index and the coverage for the corresponding index in other.

Parameters:

  • other — another PangoCoverage

ref

def ref(self) -> Coverage

:::warning Deprecated since 1.52 This API is deprecated. :::

Increase the reference count on the PangoCoverage by one.

set

def set(self, index_: int, level: CoverageLevel | int) -> None

Modify a particular index within coverage

Parameters:

  • index_ — the index to modify
  • level — the new level for index_

to_bytes

def to_bytes(self) -> list[int]

:::warning Deprecated since 1.44 This API is deprecated. :::

Convert a PangoCoverage structure into a flat binary format.

unref

def unref(self) -> None

:::warning Deprecated since 1.52 This API is deprecated. :::

Decrease the reference count on the PangoCoverage by one.

If the result is zero, free the coverage and all associated memory.

Static functions

from_bytes

@staticmethod
def from_bytes(bytes: list[int]) -> Coverage | None

:::warning Deprecated since 1.44 This API is deprecated. :::

Convert data generated from Coverage.to_bytes back to a PangoCoverage.

Parameters:

  • bytes — binary data representing a PangoCoverage