TICKIT_REN...R_HLINE_AT(3)
π NAME π
tickit_renderbuffer_hline_at, tickit_renderbuffer_vline_at β create line regions
okay so bestie, these two are literally your line-drawing besties from the tickit renderbuffer world. They make lines. That's it, that's the vibe. β¨
π SYNOPSIS π
#include <tickit.h>
void tickit_renderbuffer_hline_at(TickitRenderBuffer *rb,
int line, int startcol, int endcol,
TickitLineStyle style, TickitLineCaps caps);
void tickit_renderbuffer_vline_at(TickitRenderBuffer *rb,
int startline, int endline, int col,
TickitLineStyle style, TickitLineCaps caps);
Link with -ltickit.
π¦ DESCRIPTION π¦
So here's the tea β β tickit_renderbuffer_hline_at() creates a horizontal line segment on the given line, sitting between the given columns, and both of those columns are inclusive. Yes bestie, inclusive, we're not doing that off-by-one nonsense here.
Then tickit_renderbuffer_vline_at() creates a vertical line segment on the given column, running between the given lines, and both of those are inclusive too. Slay. π
The style argument should be one of these TickitLineStyle constants:
TICKIT_LINE_SINGLEβ a single thin lineTICKIT_LINE_DOUBLEβ a pair of double thin linesTICKIT_LINE_THICKβ a single thick line
Now, lowkey important lore π«Ά: line drawing happens using the Unicode line-drawing characters, which means not every possible combination of line segments with differing styles meeting up in one cell is actually supported by Unicode. Like, Unicode said "I can't do that one, sorry babe." The following sets of styles may be relied upon:
- Any possible combination of only SINGLE segments, THICK segments, or both.
- Any combination of only DOUBLE segments, except cells that only have one of the four borders occupied.
- Any combination of SINGLE and DOUBLE segments except where the style changes between SINGLE to DOUBLE on a vertical or horizontal run.
Everything else? Not directly supported. That means any combination of DOUBLE and THICK in the same cell, or any attempt to change from SINGLE to DOUBLE in either the vertical or horizontal direction. To handle these cases, a cell may be rendered with a substitution character which replaces a DOUBLE or THICK segment with a SINGLE one within that cell. The effect is that the overall shape of the line is retained, but close to the edge or corner it will have the wrong segment type. So like, the vibe is right but the fit is off. π
Conceptually β and stay with me here, this is the main character paragraph β every cell involved in line drawing has a potential line segment type at each of its four borders to its neighbours. Horizontal lines are drawn through the vertical centre of each cell, and vertical lines are drawn through the horizontal centre. Geometry class but make it cute. πβ¨
Then there's a choice of how to handle the ends of line segments: should the segment go to the centre of each cell, or should it continue through the entire body of the cell and stop at the boundary? By default, line segments will start and end at the centre of the cells, so that horizontal and vertical lines meeting in a cell will form a neat corner. π«Ά When drawing isolated lines such as horizontal or vertical rules, it is preferable that the line go right through the cells at the start and end. To control this behaviour, the caps bitmask argument should be one of the following TickitLineCaps constants:
CAP_STARTβ indicates that the line should consume the entire start cellCAP_ENDβ indicates that the line should consume the entire end cellCAP_BOTHβ is a convenient shortcut specifying both behaviours
π RETURN VALUE π
This function returns no value. That's it. Nothing. Zero. Empty-handed but with gorgeous lines. π
β SEE ALSO β
tickit_renderbuffer_new(3), tickit_renderbuffer_blit(3), tickit_renderbuffer_flush_to_term(3), tickit_renderbuffer(7), tickit(7)
Byeee bestie π this one's from the Library Functions Manual, page TICKIT_REN...R_HLINE_AT(3) β go draw something iconic with it, no cap. π
π¦ where this page comes from
- alpine 3.24: libtickit-doc 0.4.6-r0 Β· MIT
- debian bookworm: libtickit-dev 0.4.3-1 Β· MIT
- debian trixie: libtickit-dev 0.4.3-2 Β· MIT
- fedora 43: libtickit-devel 0.4.5-2.fc43 Β· MIT
- fedora 43: libtickit-devel 0.4.5-2.fc43 Β· MIT
- fedora 44: libtickit-devel 0.4.5-3.fc44 Β· MIT
- fedora 44: libtickit-devel 0.4.5-3.fc44 Β· MIT
- nixos 26.05: libtickit 0.4.5
- nixpkgs unstable: libtickit 0.4.6
- ubuntu jammy: libtickit-dev 0.4.1-1 Β· MIT
- ubuntu noble: libtickit-dev 0.4.3-1.1build1 Β· MIT
- ubuntu questing: libtickit-dev 0.4.3-2
- ubuntu resolute: libtickit-dev 0.4.3-2build1 Β· MIT
- ubuntu stonking: libtickit-dev 0.4.3-2build1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms