Haiku API Bindings
unicode_block
Not logged in

Documentation | InterfaceKit | unicode_block

SYNOPSIS

Perl

use HaikuR1::Font qw(be_plain_font B_CYRILLIC_BLOCK);

my $blocks = be_plain_font->Blocks();
if ($blocks->Includes(B_CYRILLIC_BLOCK) {
    # do something
}

Python

from HaikuR1.InterfaceKit import be_plain_font, B_CYRILLIC_BLOCK

blocks = be_plain_font.Blocks()
if blocks.Includes(B_CYRILLIC_BLOCK):
    # do something

DESCRIPTION

Exposes the unicode_block object. Each bit of a unicode_block's internal storage represents one unicode block. Haiku currently supports 71 unicode blocks, represented by the unicode_block constants below.

Font.Blocks returns a unicode_block with the bit set for each block it supports; by comparing the unicode_block returned by Font.Blocks to the constants below you can determine which unicode blocks a font supports.

> warning!

As of Unicode 9, there are 273 defined unicode blocks, so Haiku's support is not complete. In fact, Haiku doesn't completely cover all of unicode plane 0, and doesn't cover any of the other planes at all.

Additionally, Font.Blocks has not yet been implemented; the underlying C++ method is a stub that returns a unicode_block with all bits set.

METHODS

Constructor

Builds a unicode_block object. (Generally you don't build your own; you get one by calling Font.Blocks or you use one of the constants.)

Perl

HaikuR1::unicode_block->new($block2, $block1);

Python

unicode_block(block2, block1)

copy

Copies the contents of another object into this object.

Perl

$unicode_block->copy($copy_from);

Python

unicode_block.copy(copy_from)

Includes

Returns true if the given block is a subset of this block.

Perl

$unicode_block->Includes($block);

Python

unicode_block.Includes(block)

OPERATORS

==

Returns true if the two blocks are equal.

!=

Returns true if the two blocks are not equal.

&

Returns the intersection of the two blocks.

|

Returns the union of the two blocks.

CONSTANTS

Perl

use HaikuR1::Font qw(:unicode_blocks)

Python

Python does not support export tags.