display_face library
The display-style seam (docs/m4-design.md §B): how a theme draws the calculator display's glyphs and the panel behind them.
Most themes draw the display with a font and have no DisplayFace
(CalcThemeData.displayFace == null). A face (Retro's 7-segment LCD)
draws some characters itself — digits, the decimal point, minus, E —
while every other glyph (×, ÷, letters, brackets) stays in the
theme's font. Layout never changes: the text is laid out by a normal
TextPainter with the face-drawn characters transparent
(DisplayFace.maskedSpan), and the face paints its glyphs into those
characters' boxes (DisplayFace.paintGlyphs). Measuring, fitting,
caret positions and hit testing are therefore exactly the font's, and
screen readers keep reading the same text (painting adds no semantics).
Classes
- DisplayFace
- Draws display glyphs and the display panel for a theme family.
- DisplayPanelPainter
- Paints a DisplayFace's panel behind the display.
- FaceText
- One line of display text drawn with a DisplayFace: a Text replacement (no wrapping, no text scaling) for faces that paint glyphs.
- RenderFaceText
- Render object of FaceText.