struct Cairo::TextCluster

Overview

Wrapper for LibCairo::TextClusterT.

The TextCluster class holds information about a single text cluster. A text cluster is a minimal mapping of some glyphs corresponding to some UTF-8 text.

For a cluster to be valid, both num_bytes and num_glyphs should be non-negative, and at least one should be non-zero. Note that clusters with zero glyphs are not as well supported as normal clusters. For example, PDF rendering applications typically ignore those clusters when PDF text is being selected.

See Context#show_text_glyphs for how clusters are used in advanced text operations.

Defined in:

cairo/text_cluster.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(num_bytes : Int32, num_glyphs : Int32) #

[View source]
def self.new(cluster : LibCairo::TextClusterT) #

[View source]
def self.new(cluster : LibCairo::PTextClusterT) #

[View source]
def self.new #

[View source]

Instance Method Detail

def num_bytes : Int32 #

The number of bytes of UTF-8 text covered by cluster.


[View source]
def num_bytes=(num_bytes : Int32) #

[View source]
def num_glyphs : Int32 #

The number of glyphs covered by cluster.


[View source]
def num_glyphs=(num_glyphs : Int32) #

[View source]
def to_cairo_cluster : LibCairo::TextClusterT #

[View source]
def to_unsafe : LibCairo::PTextClusterT #

[View source]