BitmapFontContractSuite
abstract class BitmapFontContractSuite
Package: dev.joid.test.contract · Module: tool-testkit · Source: BitmapFontContractSuite.java
The contract tests of the drawing of bitmap fonts by a render bridge: whole texels and the same ink at every scale.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
| BitmapFontContractSuite() | Creates the suite, for a subclass. |
Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
void | startBackend() | Creates the snapshot backend at the first test of the class, at 128×64 pixels, and resets the matrices and the state before each test. |
void | stopBackend() static | Destroys the snapshot backend after the last test of the class. |
void | drawsWholeTexelsAtAWholeNumberOfPixels() | Checks that a glyph scaled by 1, 2 or 0.5 covers whole texels, without blur. |
void | givesEveryTexelColumnTheSameInkAtAFractionalScale() | Checks that at a fractional scale every column of texels of a glyph gets the same amount of ink. |
void | drawsTheSameGlyphFromEveryAtlas() | Checks that a glyph gives the same pixels from any atlas that holds it. |
For subclasses
Section titled “For subclasses”| Returns | Signature | Summary |
|---|---|---|
ISnapshotBackend | createBackend() hook abstract protected | JOID calls it once, at the first test of the class. |
Creation details
Section titled “Creation details”BitmapFontContractSuite
Section titled “BitmapFontContractSuite”BitmapFontContractSuite()
Creates the suite, for a subclass.
Method details
Section titled “Method details”startBackend
Section titled “startBackend”void startBackend()
Creates the snapshot backend at the first test of the class, at 128×64 pixels, and resets the matrices and the state before each test.
stopBackend
Section titled “stopBackend”void stopBackend() static
Destroys the snapshot backend after the last test of the class.
drawsWholeTexelsAtAWholeNumberOfPixels
Section titled “drawsWholeTexelsAtAWholeNumberOfPixels”void drawsWholeTexelsAtAWholeNumberOfPixels()
Checks that a glyph scaled by 1, 2 or 0.5 covers whole texels, without blur.
givesEveryTexelColumnTheSameInkAtAFractionalScale
Section titled “givesEveryTexelColumnTheSameInkAtAFractionalScale”void givesEveryTexelColumnTheSameInkAtAFractionalScale()
Checks that at a fractional scale every column of texels of a glyph gets the same amount of ink.
drawsTheSameGlyphFromEveryAtlas
Section titled “drawsTheSameGlyphFromEveryAtlas”void drawsTheSameGlyphFromEveryAtlas()
Checks that a glyph gives the same pixels from any atlas that holds it.
createBackend
Section titled “createBackend”ISnapshotBackend createBackend() hook abstract protected
JOID calls it once, at the first test of the class. Return a new snapshot backend of your backend, not created yet.
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
