ITextEffect
interface ITextEffect
Package: dev.joid.lib.font.effect · Module: core · Source: ITextEffect.java
An effect on the glyphs of a text, which can move, recolor or replace each glyph and draw behind or over it.
Description
Section titled “Description”Give effects to a TextInfo with effects(...), or add them from a markup tag with TextStyle.effect.
JOID calls the three hooks for every glyph, on the render thread, in this order: apply for each glyph, then background, then the glyphs are drawn, then decorate.
A shadow glyph goes through decorate only: test ITextGlyph.isShadow there to skip it.
Learn more
Section titled “Learn more”Methods
Section titled “Methods”For subclasses
Section titled “For subclasses”| Returns | Signature | Summary |
|---|---|---|
void | apply(ITextGlyph glyph) hook default | JOID calls it once per glyph before anything is drawn. |
void | background(ITextGlyph glyph) hook default | JOID calls it once per glyph after apply, before the glyphs are drawn: draw a highlight or a box behind the glyph, in design pixels, with DrawUtils. |
void | decorate(ITextGlyph glyph) hook default | JOID calls it once per glyph after the glyphs are drawn: draw an underline, a strike-through or a cursor over the glyph. |
Method details
Section titled “Method details”void apply(ITextGlyph glyph) hook default
JOID calls it once per glyph before anything is drawn.
Change the glyph there: its offset, its color or its codepoint; reading ITextGlyph.getIndex and the clock gives per-character animations such as a wave.
background
Section titled “background”void background(ITextGlyph glyph) hook default
JOID calls it once per glyph after apply, before the glyphs are drawn: draw a highlight or a box behind the glyph, in design pixels, with DrawUtils.
decorate
Section titled “decorate”void decorate(ITextGlyph glyph) hook default
JOID calls it once per glyph after the glyphs are drawn: draw an underline, a strike-through or a cursor over the glyph.
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
