Skip to content

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.

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.

ReturnsSignatureSummary
BitmapTextRenderer() protectedCreates the renderer with the bitmap shader of JOID.

ReturnsSignatureSummary
voiddrawGlyph(TextGlyph glyph) protectedDraws 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.
ReturnsSignatureSummary
voidbegin() hook protectedBinds the shader and starts the pass with no texture bound.
booleanisGridAligned() hook protectedAlways true: bitmap glyphs sit on whole screen pixels.
BitmapCellgetCell(TextGlyph glyph) hook abstract protectedJOID calls it for every glyph it draws, on the render thread.
Inherited from GlyphTextRenderer (6)

getWidth · getHeight · drawText · getLineHeight · getBaseline · layout

BitmapTextRenderer() protected

Creates the renderer with the bitmap shader of JOID.

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.

boolean isGridAligned() hook protected

Always true: bitmap glyphs sit on whole screen pixels.

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

Report a problem with this page