nx_manga_bubble.nx
buildroot/runtime/nx_manga_bubble.nx
about
nx_manga_bubble.nx -- R2 of the mangagen lane (comparewatch- contract mangagen_mb_bubble_draw):
SPEECH BUBBLES onto a manga page. Composes the incumbents rather than re-implementing any of them:
nx_aa_raster aa_render -- the anti-aliased polygon fill (nonzero winding, CW fills)
nx_nishi_font_core nf_draw_text_mem / nf_adv_px -- OUR OWN stroke letterforms and their metrics
nx_img_to_rgb / nx_png_write -- the page in, the page out
THE DONE-RULE, pre-declared on /compare/mangagen before a line of this was written:
"Bubble geometry + tails + sovereign TTF raster; overflow REFUSES, never silently clips."
So text that cannot fit the bubble's inner box is a REFUSAL naming the measured overflow -- never a
silent crop, never a shrink-to-fit that quietly rewrites the author's lettering.
usage: nx_manga_bubble <in.png|blank:WxH> <out.png> <cx> <cy> <rx> <ry> <tipx> <tipy> <tdir 0-23> <ch> <text...>
license_tier: ORIGINAL expect_exit: 0
dependencies 6 imports · 0 importers
imports: nx_str.nxnx_syscalls.nxnx_aa_raster.nxnx_png_write.nxnx_img_to_rgb.nxnx_nishi_font_core.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 18 | const MB_MAGIC_8192: i64 = 8192 |
| 26 | const MB_N: i64 = 24 |
| 27 | const MB_SS: i64 = 4 |
| 29 | const MB_INSCRIBED_PERMIL: i64 = 707 |
| 31 | const MB_STROKE_DEFAULT: i64 = 3 |
| 32 | const MB_LEAD_DIV: i64 = 4 |
| 33 | const MB_MARGIN_PX: i64 = 8 |
| 34 | const MB_INK_R: i64 = 16 |
| 35 | const MB_INK_G: i64 = 16 |
| 36 | const MB_INK_B: i64 = 20 |
| 37 | const MB_PAPER: i64 = 255 |
| 38 | const MB_TEXT_INK: i64 = 0 |
| 39 | const MB_MASK: i64 = 1048576 |
| 40 | const MB_PTS: i64 = 512 |
| 41 | const MB_LINES: i64 = 24 |
functions
| 42 | func mb_puts(s: *u8) -> i64 { sys_write(1, s, nx_str_len(s)); return 0 } |
| 43 | func mb_pi(v: i64) -> i64 |
| 58 | func mb_atoi(s: *u8) -> i64 called by 1: main |
| 74 | func mb_tables(cs: *i64, sn: *i64) -> i64 called by 1: mb_bubble_draw |
| 86 | func mb_ring(xs: *i64, ys: *i64, cst: *i64, cln: *i64, gb: *i64, cs: *i64, sn: *i64, cx: i64, cy: i64, rx: i64, ry: i64) -> i64 called by 1: mb_bubble_draw |
| 102 | func mb_tail(xs: *i64, ys: *i64, cst: *i64, cln: *i64, gb: *i64, cs: *i64, sn: *i64, spec: *i64, grow: i64) -> i64 called by 1: mb_bubble_draw |
| 127 | func mb_cov(fb: *i64, W: i64, H: i64, cov: *u8, ir: i64, ig: i64, ib: i64) -> i64 called by 1: mb_bubble_draw |
| 149 | func mb_wrap(txt: *u8, tlen: i64, adv: i64, boxw: i64, ls: *i64, le: *i64) -> i64 called by 1: mb_bubble_draw |
| 188 | func mb_bubble_draw(fb: *i64, W: i64, H: i64, spec: *i64, txt: *u8, tlen: i64, mask: *u8) -> i64 |
| 258 | func main(argc: i64, argv: *i64) -> i64 |