gtk4-path-tool(1)
π gtk4-path-tool β the GskPath utility, bestie edition π
okay so welcome to gtk4-path-tool, a lil command-line bestie from the GTK commands crew that does stuff to paths. yes, like paths paths. sit down, get comfy, we're gonna slay this π¦
β¨ SYNOPSIS β¨
gtk4-path-tool <COMMAND> [OPTIONS...] <PATH>
gtk4-path-tool decompose [OPTIONS...] <PATH>
gtk4-path-tool show [OPTIONS...] <PATH>...
gtk4-path-tool render [OPTIONS...] <PATH>...
gtk4-path-tool reverse [OPTIONS...] <PATH>
gtk4-path-tool info [OPTIONS...] <PATH>
πΈ DESCRIPTION πΈ
so like, gtk4-path-tool can do a whole bunch of different tasks on paths. it's giving multitasking icon π
and the paths? they're written in SVG syntax, as strings like this:
"M 100 100 C 100 200 200 200 200 100 Z"
β¨ now here's the lil trick you need to know: if you wanna read a path from a file, you use a filename that starts with a . or a /. and if you wanna read a path from stdin, you just use -. that's it. that's the whole vibe.
π COMMANDS π
π Decomposing
the decompose command approximates the path with one made of simpler elements. and if you run it with no options at all, the curves get approximated by line segments. lowkey a glow-down but in the cute way.
--allow-quadβ let quadratic BΓ©zier curves be used in the generated path π--allow-cubicβ let cubic BΓ©zier curves be used in the generated path--allow-conicβ let conic BΓ©zier curves be used in the generated path
π¦ Showing
the show command pops your path up in a window so you can actually look at it. the interior of the path is filled (yes queen). and the window has some interactive key bindings so you can play with it:
- + / - change the zoom level π
- p toggles display of points
- c toggles display of controls
- i toggles display of intersections
- f changes the fill rule
and here are the options:
--fillβ fill the path (this is the default, no need to do the most π )--strokeβ stroke the path instead of filling it--pointsβ show points on the path--controlsβ show control points--intersectionsβ if you give two paths, show their intersections. if you give one path, show its self-intersections. very β¨metaβ¨ of it.--fill-rule=VALUEβ the fill rule used to figure out what areas are inside the path. possible values arewindingoreven-odd. default iswinding.--fg-color=COLORβ the color used to fill the interior of the path or to stroke the path. if you don't specify,blackis used.--bg-color=COLORβ the color used to render the background behind the path. if you don't specify,whiteis used.--point-color=COLORβ the color used to render the points. if you don't specify,redis used.--intersection-color=COLORβ the color used to render intersections. if you don't specify,greenis used.--line-width=VALUEβ the line width to use for the stroke.VALUEmust be a positive number. default line width is1.--line-cap=VALUEβ the cap style to use at line ends. possible values arebutt,roundorsquare. see the SVG specification for the details on these styles. default cap style isbutt.--line-join=VALUEβ the join style to use at line joins. possible values aremiter,miter-clip,round,bevelorarcs. see the SVG specification for the details on these styles. default join style ismiter.--miter-limit=VALUEβ the limit at which to clip miters at line joins. default value is4.--dashes=VALUEβ the dash pattern to use for this stroke. a dash pattern is a comma-separated list of alternating non-negative numbers, and each number is the length of alternate "on" and "off" portions of the stroke. if the dash pattern is empty, dashing is disabled, which is the default. see the SVG specification for the details on dashing.--dash-offset=VALUEβ the offset into the dash pattern where dashing should begin. default value is0.--zoom=NUMBERβ set the zoom level to the given number (between1and20).
π Rendering
the render command renders the given path as a PNG image. it's giving "I'm a file now." π
--fillβ fill the path (this is the default)--strokeβ stroke the path instead of filling it--pointsβ show points on the path--controlsβ show control points--intersectionsβ if you give two paths, show their intersections. if you give one path, show its self-intersections.--fill-rule=VALUEβ the fill rule used to figure out what areas are inside the path. possible values arewindingoreven-odd. default iswinding.--fg-color=COLORβ the color used to fill the interior of the path or to stroke the path. if you don't specify,blackis used.--bg-color=COLORβ the color used to render the background behind the path. if you don't specify,whiteis used.--point-color=COLORβ the color used to render the points. if you don't specify,redis used.--intersection-color=COLORβ the color used to render intersections. if you don't specify,greenis used.--output-file=FILEβ the file to save the PNG image to. if you don't specify,"path.png"is used. β¨--line-width=VALUEβ the line width to use for the stroke.VALUEmust be a positive number. default line width is1.--line-cap=VALUEβ the cap style to use at line ends. possible values arebutt,roundorsquare. see the SVG specification for the details on these styles. default cap style isbutt.--line-join=VALUEβ the join style to use at line joins. possible values aremiter,miter-clip,round,bevelorarcs. see the SVG specification for the details on these styles. default join style ismiter.--miter-limit=VALUEβ the limit at which to clip miters at line joins. default value is4.--dashes=VALUEβ the dash pattern to use for this stroke. a dash pattern is a comma-separated list of alternating non-negative numbers, and each number is the length of alternate "on" and "off" portions of the stroke. if the dash pattern is empty, dashing is disabled, which is the default. see the SVG specification for the details on dashing.--dash-offset=VALUEβ the offset into the dash pattern where dashing should begin. default value is0.--zoom=NUMBERβ set the zoom level to the given number (between1and20).
π Reversing
the reverse command changes the direction of the path. and the resulting path starts where the original path ends. it walked in, did a 180, and left. iconic behavior honestly π
π§ Info
the info command shows various information about the given path β like its bounding box and such. she's nosy and we love her for it π«Ά
π REFERENCES π
- SVG Path Specification, <https://www.w3.org/TR/SVG2/paths.html>
and that's the whole page, bestie!! this lil manual lives in the GTK section as gtk4-path-tool(1) β go forth and render some absolutely stunning paths, no cap πβ¨ππ¦πΈ
π¦ where this page comes from
- ubuntu stonking: libgtk-4-bin 4.24.1+ds-1 Β· LGPL-2.0-or-later AND LGPL-2.1-or-later AND sun-permissive AND lcs-telegraphics-permissive AND X11R5-permissive AND MIT AND BSD-3-clause-Google AND Apache-2.0 AND CC0-1.0 AND ZPL-2.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms