Skip to main content

Crate cellix_render

Crate cellix_render 

Source
Expand description

The cell grid every Cellix view draws to. Backends only present a grid, so every feature works on the text-cell tier and the pixel tiers alike.

Structs§

Bitmap
Pixels made elsewhere. id stands for the content, so a tile hashes it and not every byte.
Bounds
Cell
A screen cell. An empty symbol is the right half of a wide character.
CellMeasure
The text-cell tier, and tests.
Font
How a run of painted text is set.
FontMeasure
The pixel tiers: the same fonts and sizes the rasterizer draws with.
Grid
Image
A tightly packed RGB image, matching the Kitty protocol’s f=24.
Piece
One cell of an icon that is width by height cells.
Rect
Rgb
Run
A span of changed cells on one row.
SoftwareRasterizer
CPU rendering. Glyphs are rasterized once and blended into their cells, so text stays locked to the grid and a row costs little more than a copy.
Strip
One bar in a minimap, in 256ths of its box.
Style

Enums§

Icon
Paint
Pixels
What a bitmap’s bytes are.

Constants§

ALL_CORNERS
BOTTOM_LEFT
BOTTOM_RIGHT
EMOJI_AIR
The air after an emoji in a line of words, as a share of the text’s size.
FIELD_AIR
How far a text box stands inside its row, above and below: the box is seven eighths of its row, which holds words of 13 pt raised in it with their tails off its lower edge, and leaves 4 px between two boxes in rows one under the other.
GLYPH
Rows tall an icon beside a name is: 16 pt where a row is 18.5 pt, VS Code’s size.
INTERFACE_SIZE
Interface text is drawn at this size relative to the row height: 13 pt in a terminal set to 14 pt, whose row is 18.5 pt, which is the size VS Code sets its own words at.
SMALL_GLYPH
Rows tall an icon inside a text box or a chip is, where one of GLYPH would stand against the box’s edges: 13 pt.
TOP_LEFT
TOP_RIGHT
UNIT
Paint positions are in 64ths of a cell, so they can sit between cells and still hash.

Traits§

Measure
Measures text, in cells, one advance per char.
Rasterizer
Turns one row of a grid into an image.

Functions§

built_in_emoji_holds
Whether the emoji font in the binary holds an emoji, whole: one it only has the parts of would be drawn as those, side by side. This is what a machine with no emoji font of its own can show, so it’s what’s worth offering.
on_large_button
Whether a click at at (columns and rows, with their fractions) lands on the large button Grid::large_button paints at (x, y), width cells wide. It takes the whole of what’s painted, which stands a little past its row above and below. A terminal without pixel reports gives the middle of a cell, so there it’s the button’s row.
units
Converts cells to paint units.