Flags

Details

class HarfBuzz.buffer_diff_flags_t(value)

Bases: GObject.GFlags

Flags from comparing two HarfBuzz.buffer_t's.

Buffer with different HarfBuzz.buffer_content_type_t cannot be meaningfully compared in any further detail.

For buffers with differing length, the per-glyph comparison is not attempted, though we do still scan reference buffer for dotted circle and .notdef glyphs.

If the buffers have the same length, we compare them glyph-by-glyph and report which aspect(s) of the glyph info/position are different.

New in version 1.5.0.

EQUAL = 0

equal buffers.

CONTENT_TYPE_MISMATCH = 1

buffers with different HarfBuzz.buffer_content_type_t.

POSITION_MISMATCH = 128

difference in HarfBuzz.glyph_position_t.

CODEPOINT_MISMATCH = 16

difference in HarfBuzz.glyph_info_t.codepoint

LENGTH_MISMATCH = 2

buffers with differing length.

CLUSTER_MISMATCH = 32

difference in HarfBuzz.glyph_info_t.cluster

NOTDEF_PRESENT = 4

.notdef glyph is present in the reference buffer.

GLYPH_FLAGS_MISMATCH = 64

difference in HarfBuzz.glyph_flags_t.

DOTTED_CIRCLE_PRESENT = 8

dotted circle glyph is present in the reference buffer.

class HarfBuzz.buffer_flags_t(value)

Bases: GObject.GFlags

Flags for HarfBuzz.buffer_t.

New in version 0.9.20.

DEFAULT = 0

the default buffer flag.

BOT = 1

flag indicating that special handling of the beginning of text paragraph can be applied to this buffer. Should usually be set, unless you are passing to the buffer only part of the text without the full context.

PRODUCE_SAFE_TO_INSERT_TATWEEL = 128

flag indicating that the HarfBuzz.glyph_flags_t.SAFE_TO_INSERT_TATWEEL glyph-flag should be produced by the shaper. By default it will not be produced.

New in version 5.1.0.

DO_NOT_INSERT_DOTTED_CIRCLE = 16

flag indicating that a dotted circle should not be inserted in the rendering of incorrect character sequences (such at <0905 093E>).

New in version 2.4.0.

EOT = 2

flag indicating that special handling of the end of text paragraph can be applied to this buffer, similar to HarfBuzz.buffer_flags_t.BOT.

DEFINED = 255

All currently defined flags:

New in version 4.4.0.

VERIFY = 32

flag indicating that the HarfBuzz.shape() call and its variants should perform various verification processes on the results of the shaping operation on the buffer. If the verification fails, then either a buffer message is sent, if a message handler is installed on the buffer, or a message is written to standard error. In either case, the shaping result might be modified to show the failed output.

New in version 3.4.0.

PRESERVE_DEFAULT_IGNORABLES = 4

flag indication that character with Default_Ignorable Unicode property should use the corresponding glyph from the font, instead of hiding them (done by replacing them with the space glyph and zeroing the advance width.) This flag takes precedence over HarfBuzz.buffer_flags_t.REMOVE_DEFAULT_IGNORABLES.

PRODUCE_UNSAFE_TO_CONCAT = 64

flag indicating that the HarfBuzz.glyph_flags_t.UNSAFE_TO_CONCAT glyph-flag should be produced by the shaper. By default it will not be produced since it incurs a cost.

New in version 4.0.0.

REMOVE_DEFAULT_IGNORABLES = 8

flag indication that character with Default_Ignorable Unicode property should be removed from glyph string instead of hiding them (done by replacing them with the space glyph and zeroing the advance width.) HarfBuzz.buffer_flags_t.PRESERVE_DEFAULT_IGNORABLES takes precedence over this flag.

New in version 1.8.0.

class HarfBuzz.buffer_serialize_flags_t(value)

Bases: GObject.GFlags

Flags that control what glyph information are serialized in HarfBuzz.buffer_serialize_glyphs().

New in version 0.9.20.

DEFAULT = 0

serialize glyph names, clusters and positions.

NO_CLUSTERS = 1

do not serialize glyph cluster.

GLYPH_FLAGS = 16

serialize glyph flags.

New in version 1.5.0.

NO_POSITIONS = 2

do not serialize glyph position information.

NO_ADVANCES = 32

do not serialize glyph advances, glyph offsets will reflect absolute glyph positions.

New in version 1.8.0.

NO_GLYPH_NAMES = 4

do no serialize glyph name.

DEFINED = 63

All currently defined flags.

New in version 4.4.0.

GLYPH_EXTENTS = 8

serialize glyph extents.

class HarfBuzz.glyph_flags_t(value)

Bases: GObject.GFlags

Flags for HarfBuzz.glyph_info_t.

New in version 1.5.0.

UNSAFE_TO_BREAK = 1

Indicates that if input text is broken at the beginning of the cluster this glyph is part of, then both sides need to be re-shaped, as the result might be different. On the flip side, it means that when this flag is not present, then it is safe to break the glyph-run at the beginning of this cluster, and the two sides will represent the exact same result one would get if breaking input text at the beginning of this cluster and shaping the two sides separately. This can be used to optimize paragraph layout, by avoiding re-shaping of each line after line-breaking.

UNSAFE_TO_CONCAT = 2

Indicates that if input text is changed on one side of the beginning of the cluster this glyph is part of, then the shaping results for the other side might change. Note that the absence of this flag will NOT by itself mean that it IS safe to concat text. Only two pieces of text both of which clear of this flag can be concatenated safely. This can be used to optimize paragraph layout, by avoiding re-shaping of each line after line-breaking, by limiting the reshaping to a small piece around the breaking position only, even if the breaking position carries the HarfBuzz.glyph_flags_t.UNSAFE_TO_BREAK or when hyphenation or other text transformation happens at line-break position, in the following way: 1. Iterate back from the line-break position until the first cluster start position that is NOT unsafe-to-concat, 2. shape the segment from there till the end of line, 3. check whether the resulting glyph-run also is clear of the unsafe-to-concat at its start-of-text position; if it is, just splice it into place and the line is shaped; If not, move on to a position further back that is clear of unsafe-to-concat and retry from there, and repeat. At the start of next line a similar algorithm can be implemented. That is: 1. Iterate forward from the line-break position until the first cluster start position that is NOT unsafe-to-concat, 2. shape the segment from beginning of the line to that position, 3. check whether the resulting glyph-run also is clear of the unsafe-to-concat at its end-of-text position; if it is, just splice it into place and the beginning is shaped; If not, move on to a position further forward that is clear of unsafe-to-concat and retry up to there, and repeat. A slight complication will arise in the implementation of the algorithm above, because while our buffer API has a way to return flags for position corresponding to start-of-text, there is currently no position corresponding to end-of-text. This limitation can be alleviated by shaping more text than needed and looking for unsafe-to-concat flag within text clusters. The HarfBuzz.glyph_flags_t.UNSAFE_TO_BREAK flag will always imply this flag. To use this flag, you must enable the buffer flag HarfBuzz.buffer_flags_t.PRODUCE_UNSAFE_TO_CONCAT during shaping, otherwise the buffer flag will not be reliably produced.

New in version 4.0.0.

SAFE_TO_INSERT_TATWEEL = 4

In scripts that use elongation (Arabic, Mongolian, Syriac, etc.), this flag signifies that it is safe to insert a U+0640 TATWEEL character before this cluster for elongation. This flag does not determine the script-specific elongation places, but only when it is safe to do the elongation without interrupting text shaping.

New in version 5.1.0.

DEFINED = 7

All the currently defined flags.

class HarfBuzz.ot_color_palette_flags_t(value)

Bases: GObject.GFlags

Flags that describe the properties of color palette.

New in version 2.1.0.

DEFAULT = 0

Default indicating that there is nothing special to note about a color palette.

USABLE_WITH_LIGHT_BACKGROUND = 1

Flag indicating that the color palette is appropriate to use when displaying the font on a light background such as white.

USABLE_WITH_DARK_BACKGROUND = 2

Flag indicating that the color palette is appropriate to use when displaying the font on a dark background such as black.

class HarfBuzz.ot_math_glyph_part_flags_t(value)

Bases: GObject.GFlags

Flags for math glyph parts.

New in version 1.3.3.

EXTENDER = 1

This is an extender glyph part that can be repeated to reach the desired length.

class HarfBuzz.ot_var_axis_flags_t(value)

Bases: GObject.GFlags

Flags for HarfBuzz.ot_var_axis_info_t.

New in version 2.2.0.

HIDDEN = 1

The axis should not be exposed directly in user interfaces.