FL.objects.Encoding.Encoding

class FL.objects.Encoding.Encoding(encoding_or_none: Encoding | None = None)

Bases: UserList[EncodingRecord], Copyable

Encoding - class to represent Encoding

__init__(encoding_or_none: Encoding | None = None) None

Encoding() - generic constructor, creates Encoding Encoding(Encoding) - copy constructor

Parameters:

encoding_or_none (Encoding | None, optional) – _description_. Defaults to None.

Methods

FillUnencoded()

FillUnicodes()

FindName(name)

Find a glyph name in the encoding and return its index or -1.

Load(filename)

Opens encoding from .ENC format.

Save(filename, EncodingTitle, Id)

Saves encoding in .ENC format.

__init__([encoding_or_none])

Encoding() - generic constructor, creates Encoding Encoding(Encoding) - copy constructor

append(item)

Append an EncodingRecord to the end of the encoding.

clear()

copy()

count(value)

extend(other)

S.extend(iterable) -- extend sequence by appending elements from the iterable

index(value, [start, [stop]])

Raises ValueError if the value is not present.

insert(i, item)

Insert an EncodingRecord at index.

load_font_default()

pop([index])

Raise IndexError if list is empty or index is out of range.

remove(item)

S.remove(value) -- remove first occurrence of value.

reverse()

S.reverse() -- reverse IN PLACE

sort(*args, **kwds)

Attributes

data

parent

Encoding's parent object, Font

FindName(name: str) int

Find a glyph name in the encoding and return its index or -1.

Parameters:

name (str) – The glyph name

Load(filename: str) None

Opens encoding from .ENC format.

Parameters:

filename (str) – _description_

Save(filename: str, EncodingTitle: str, Id: int) None

Saves encoding in .ENC format.

Parameters:
  • filename (str) – _description_

  • EncodingTitle (str) – _description_

  • Id (int) – _description_

append(item: EncodingRecord) None

Append an EncodingRecord to the end of the encoding.

Parameters:

encoding_record (EncodingRecord) – _description_

clear() None -- remove all items from S
count(value) integer -- return number of occurrences of value
extend(other)

S.extend(iterable) – extend sequence by appending elements from the iterable

index(value[, start[, stop]]) integer -- return first index of value.

Raises ValueError if the value is not present.

Supporting start and stop arguments is optional, but recommended.

insert(i: int, item: EncodingRecord) None

Insert an EncodingRecord at index.

Parameters:
property parent: Font | None

Encoding’s parent object, Font

pop([index]) item -- remove and return item at index (default last).

Raise IndexError if list is empty or index is out of range.

remove(item)

S.remove(value) – remove first occurrence of value. Raise ValueError if the value is not present.

reverse()

S.reverse() – reverse IN PLACE