BitmapTextRenderer
abstract class BitmapTextRenderer<F extends IFontFace>
Extends: GlyphTextRenderer<F>
Package: dev.joid.lib.font.impl.bitmap · Module: core · Source: BitmapTextRenderer.java
Base class of the text renderers of pixel fonts, which draws each glyph from the BitmapCell you return.
Description
Section titled “Description”Extend it for your BitmapFont and implement getCell; layout, markups, effects, shadows and colors come from GlyphTextRenderer.
The origin, the baseline and the offsets of the glyphs snap to whole screen pixels, and the texture of each cell is sampled with NEAREST filtering and filtered by area in the shader.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
| BitmapTextRenderer() protected | Creates the renderer with the bitmap shader of JOID. |
Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
void | drawGlyph(TextGlyph | Draws the cell of the glyph, scaled from its bitmap size to the size of the glyph, slanted when the style is italic and the face is not. |
For subclasses
Section titled “For subclasses”| Returns | Signature | Summary |
|---|---|---|
void | begin() hook protected | Binds the shader and starts the pass with no texture bound. |
boolean | isGridAligned() hook protected | Always true: bitmap glyphs sit on whole screen pixels. |
BitmapCell | getCell(TextGlyph | JOID calls it for every glyph it draws, on the render thread. |
Inherited from GlyphTextRenderer (6)
getWidth · getHeight · drawText · getLineHeight · getBaseline · layout
Creation details
Section titled “Creation details”BitmapTextRenderer
Section titled “BitmapTextRenderer”BitmapTextRenderer() protected
Creates the renderer with the bitmap shader of JOID.
Method details
Section titled “Method details”drawGlyph
Section titled “drawGlyph”void drawGlyph(TextGlyph<F> glyph) protected
Draws the cell of the glyph, scaled from its bitmap size to the size of the glyph, slanted when the style is italic and the face is not.
A glyph whose cell is null draws nothing.
void begin() hook protected
Binds the shader and starts the pass with no texture bound.
isGridAligned
Section titled “isGridAligned”boolean isGridAligned() hook protected
Always true: bitmap glyphs sit on whole screen pixels.
getCell
Section titled “getCell”BitmapCell getCell(TextGlyph<F> glyph) hook abstract protected
JOID calls it for every glyph it draws, on the render thread.
Return the BitmapCell of the glyph’s codepoint in its face, or null to skip it.
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
