Skip to content

RichText

Manual in pseudo-code

richtext - rich text rendering plugin for Kirikiri

Provides high-quality text rendering by combining typesetting with minikin (the Android text layout engine) and glyph drawing with the Kirikiri Z engine's unified font engine (glyphware). Because font data and glyph rasterization are shared with the engine, the output matches Layer.drawText and Elements dialogs in appearance.

Features: - Fallback across multiple fonts - Multilingual support (including RTL) - Emoji support - Styling with HTML-like tags - Decorations such as outlines and shadows - Paragraph layout (automatic line wrapping) - Progressive display (using ParagraphLayout / StyledLayout)

Members

Methods

Constants


registerFont

Method

Arguments

Arguments Default Description
path  
name  
index 0

registerVariableFont

Method

Arguments

Arguments Default Description
path  
name  
weight  
italic false
index 0

unregisterFont

Method

Arguments

Arguments Default Description
name  

registerCollection

Method

Arguments

Arguments Default Description
collectionName  
fontNames  

unregisterCollection

Method

Arguments

Arguments Default Description
collectionName  

registerLocale

Method

Arguments

Arguments Default Description
locale  

HALIGN_LEFT

Constant

Value: 0

Description

Left-aligned


HALIGN_CENTER

Constant

Value: 1

Description

Centered


HALIGN_RIGHT

Constant

Value: 2

Description

Right-aligned


HALIGN_JUSTIFY

Constant

Value: 3

Description

Justified


VALIGN_TOP

Constant

Value: 0

Description

Top-aligned


VALIGN_MIDDLE

Constant

Value: 1

Description

Vertically centered


VALIGN_BOTTOM

Constant

Value: 2

Description

Bottom-aligned


BREAK_GREEDY

Constant

Value: 0

Description

Fast (decides immediately at each break opportunity)


BREAK_HIGH_QUALITY

Constant

Value: 1

Description

High quality (Knuth-Plass algorithm)


BREAK_BALANCED

Constant

Value: 2

Description

Balanced (evens out line lengths)


BIDI_LTR

Constant

Value: 0

Description

Left to right


BIDI_RTL

Constant

Value: 1

Description

Right to left


BIDI_DEFAULT_LTR

Constant

Value: 2

Description

Default left to right


BIDI_DEFAULT_RTL

Constant

Value: 3

Description

Default right to left