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.
Description
Section titled “Description”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.
Learn more
Section titled “Learn more”Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
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. |
Method details
Section titled “Method details”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
