Skip to content

ITextMarkup

interface ITextMarkup
Package: dev.joid.lib.font.markup · Module: core · Source: ITextMarkup.java

A markup tag that a text reads inline, such as a bold or a color tag, which changes the style of the characters after it.

Register it with TextMarkup.register so that every text reads it, or give it to one style with TextInfo.markups. A tag takes no width, is never cut when a line wraps, and stays in the text that modifiers see untouched.

ReturnsSignatureSummary
intparse(String text, int index, TextStyle style) abstractJOID calls it at each character of a text while it lays it out or measures it, on the render thread.

int parse(String text, int index, TextStyle style) abstract

JOID calls it at each character of a text while it lays it out or measures it, on the render thread. When a tag of yours starts at index, change style (weight, color, font, effects; TextStyle.reset for a closing tag) and return the number of characters of the tag; otherwise return 0.


fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses

Report a problem with this page