### Install Freeze with Go Source: https://github.com/charmbracelet/freeze/blob/main/README.md Install the latest version of Freeze directly using Go. This requires Go to be installed on your system. ```sh go install github.com/charmbracelet/freeze@latest ``` -------------------------------- ### Install Freeze with Nix Source: https://github.com/charmbracelet/freeze/blob/main/README.md Install Freeze using the Nix package manager. ```sh # Nix nix-env -iA nixpkgs.charm-freeze ``` -------------------------------- ### Install Freeze via Homebrew, Go, or Arch Linux Source: https://context7.com/charmbracelet/freeze/llms.txt Installation instructions for Freeze using different package managers. ```sh # macOS / Linux via Homebrew brew install charmbracelet/tap/freeze ``` ```sh # Go toolchain go install github.com/charmbracelet/freeze@latest ``` ```sh # Arch Linux yay -S freeze ``` -------------------------------- ### Install Freeze with yay Source: https://github.com/charmbracelet/freeze/blob/main/README.md Install Freeze on Arch Linux using the yay AUR helper. ```sh # Arch Linux (btw) yay -S freeze ``` -------------------------------- ### Install Freeze with Homebrew Source: https://github.com/charmbracelet/freeze/blob/main/README.md Install Freeze on macOS or Linux using Homebrew. Ensure you have the charmbracelet tap added. ```sh # macOS or Linux brew install charmbracelet/tap/freeze ``` -------------------------------- ### Example Freeze JSON Configuration Source: https://github.com/charmbracelet/freeze/blob/main/README.md An example of a JSON configuration file for Freeze. This file defines various visual properties for the generated screenshots, such as window borders, shadows, padding, and fonts. ```json { "window": false, "border": { "radius": 0, "width": 0, "color": "#515151" }, "shadow": false, "padding": [20, 40, 20, 20], "margin": "0", "font": { "family": "JetBrains Mono", "size": 14 }, "line_height": 1.2 } ``` -------------------------------- ### Example Custom Configuration JSON Source: https://context7.com/charmbracelet/freeze/llms.txt This JSON file defines custom styling for the Freeze output, including window properties, theme, background color, border, shadow, padding, margin, and font settings. ```json { "window": true, "theme": "dracula", "background": "#282A36", "border": { "radius": 12, "width": 1, "color": "#44475A" }, "shadow": { "blur": 20, "x": 0, "y": 10 }, "padding": [20, 40, 20, 20], "margin": [40, 60, 50, 60], "font": { "family": "JetBrains Mono", "size": 14, "ligatures": true }, "line_height": 1.2 } ``` -------------------------------- ### Apply a Theme to Code Image Source: https://github.com/charmbracelet/freeze/blob/main/README.md Customize the appearance of the generated code image by specifying a color theme using the --theme flag. This example uses the 'dracula' theme. ```bash freeze artichoke.hs --theme dracula ``` -------------------------------- ### Specify Language for Code Image Source: https://github.com/charmbracelet/freeze/blob/main/README.md When Freeze cannot auto-detect the language, use the --language flag to specify it. This example explicitly sets the language to Haskell. ```bash cat artichoke.hs | freeze --language haskell ``` -------------------------------- ### Display Line Numbers and Select Line Ranges Source: https://context7.com/charmbracelet/freeze/llms.txt Use `--show-line-numbers` to display line numbers in the gutter and `--lines start,end` to capture a specific range of lines. Line numbers are 1-indexed. ```sh freeze main.go --show-line-numbers ``` ```sh freeze main.go --show-line-numbers --lines 10,25 -o snippet.png ``` ```sh freeze main.go --lines 42,42 -o line42.png ``` -------------------------------- ### Set and Get SVG Dimensions Source: https://context7.com/charmbracelet/freeze/llms.txt Updates or reads the width and height attributes of an SVG element. ```go import "github.com/charmbracelet/freeze/svg" // SetDimensions / GetDimensions update or read width/height attributes. svg.SetDimensions(imageElement, 800.0, 400.0) w, h := svg.GetDimensions(imageElement) ``` -------------------------------- ### Using Configuration Flags with Freeze Source: https://github.com/charmbracelet/freeze/blob/main/README.md Demonstrates how to specify configuration files or presets using the -c or --config flag with the freeze command. This allows for customization of screenshot appearance. ```bash freeze -c base main.go freeze -c full main.go freeze -c user main.go # alias for ~/.config/freeze/user.json freeze -c ./custom.json main.go ``` -------------------------------- ### Set Background and Theme Source: https://context7.com/charmbracelet/freeze/llms.txt Apply a white background and the 'github' theme to the output image. This is useful for creating screenshots that match specific documentation styles. ```bash freeze main.go --background "#FFFFFF" --theme github -o light.png ``` -------------------------------- ### Apply Full Preset via CLI Source: https://context7.com/charmbracelet/freeze/llms.txt Use the `-c full` flag to apply the 'full' configuration preset for generating a macOS-style screenshot. ```bash freeze -c full main.go -o full.png ``` -------------------------------- ### Apply Base Preset via CLI Source: https://context7.com/charmbracelet/freeze/llms.txt Use the `-c base` flag to apply the 'base' configuration preset for generating a minimal screenshot. ```bash freeze -c base main.go -o base.png ``` -------------------------------- ### Select Syntax Theme with --theme Source: https://context7.com/charmbracelet/freeze/llms.txt Choose a Chroma colour theme for syntax highlighting. Available themes include 'dracula', 'monokai', 'github', and 'nord'. The 'charm' theme is the default. ```sh # Use the Dracula theme freeze artichoke.hs --theme dracula -o dracula.png ``` ```sh # Use GitHub's light theme freeze main.go --theme github -o github.png ``` ```sh # List available themes (Chroma's registry) freeze --help # themes shown in the --theme flag description ``` -------------------------------- ### Load Configuration Presets and Custom JSON Source: https://context7.com/charmbracelet/freeze/llms.txt Use the `--config` flag to load built-in presets like 'base' or 'full', a saved user configuration, or an arbitrary JSON file. Command-line flags override loaded configurations. ```sh freeze -c base main.go ``` ```sh freeze -c full main.go -o full.png ``` ```sh freeze -c user main.go ``` ```sh freeze -c ./custom.json main.go ``` -------------------------------- ### Enter Interactive Mode Source: https://github.com/charmbracelet/freeze/blob/main/README.md Launch Freeze in interactive mode to easily customize settings. This mode provides a TUI for configuration. ```bash freeze --interactive ``` -------------------------------- ### Specify Output File and Format with --output Source: https://context7.com/charmbracelet/freeze/llms.txt Define the destination file and its format (.svg, .png, .webp). PNG and WebP are rasterized at 4x scale. Defaults to 'freeze.png' if output is omitted and stdout is a TTY. ```sh freeze main.go -o screenshot.svg # Vector SVG ``` ```sh freeze main.go -o screenshot.png # Raster PNG (4x scale, high-DPI) ``` ```sh freeze main.go -o screenshot.webp # WebP ``` ```sh # Brace expansion to produce all three simultaneously freeze main.go -o screenshot.{svg,png,webp} ``` -------------------------------- ### Launch Interactive TUI Configuration Source: https://context7.com/charmbracelet/freeze/llms.txt Use the `--interactive` or `-i` flag to launch a TUI for interactively adjusting all settings. Settings are saved to `~/.config/freeze/user.json` on exit. ```sh freeze --interactive main.go ``` ```sh freeze -i main.go ``` ```sh freeze -i -c full main.go ``` -------------------------------- ### Screenshot Go File with Decorations Source: https://context7.com/charmbracelet/freeze/llms.txt Generates a PNG screenshot of a Go file with various decorations applied, including theme, window borders, shadows, padding, margins, font settings, and line numbers. ```sh freeze main.go \ --theme dracula \ --window \ --border.radius 10 \ --border.width 1 \ --border.color "#44475A" \ --shadow.blur 20 \ --shadow.y 10 \ --padding 20,40 \ --margin 40,60 \ --font.size 14 \ --line-height 1.4 \ --show-line-numbers \ -o main-full.png ``` -------------------------------- ### Base Configuration Preset Source: https://context7.com/charmbracelet/freeze/llms.txt Apply the 'base' preset for a minimal, flat screenshot. This configuration disables window controls, shadows, and border rounding, using a dark background. ```json { "window": false, "theme": "charm", "border": { "radius": 0, "width": 0, "color": "#515151" }, "shadow": { "blur": 0, "x": 0, "y": 0 }, "padding": [20, 40, 20, 20], "margin": "0", "background": "#171717", "font": { "family": "JetBrains Mono", "size": 14, "ligatures": true }, "line_height": 1.2 } ``` -------------------------------- ### Full Configuration Preset Source: https://context7.com/charmbracelet/freeze/llms.txt Apply the 'full' preset for a macOS-style screenshot. This includes window controls, rounded borders, outer shadow, and generous margins. ```json { "window": true, "theme": "charm", "border": { "radius": 8, "width": 1, "color": "#515151" }, "shadow": { "blur": 24, "x": 0, "y": 12 }, "padding": [20, 40, 20, 20], "margin": [50, 60, 70, 60], "background": "#171717", "font": { "family": "JetBrains Mono", "size": 14, "ligatures": true }, "line_height": 1.2 } ``` -------------------------------- ### Configure Window Border Source: https://context7.com/charmbracelet/freeze/llms.txt Add a border with configurable radius, thickness, and color using `--border.radius`, `--border.width`, and `--border.color`. The `-r` flag is a shorthand for `--border.radius`. ```sh freeze artichoke.hs --border.radius 8 ``` ```sh freeze main.go \ --border.radius 8 \ --border.width 1 \ --border.color "#515151" \ -o bordered.png ``` ```sh freeze main.go -r 12 ``` -------------------------------- ### Use JSON Config for Styling Source: https://context7.com/charmbracelet/freeze/llms.txt Applies a custom style to a code screenshot using a JSON configuration file. This allows for repeatable and complex styling. ```sh cat > my-style.json <<'EOF' { "theme": "monokai", "background": "#272822", "border": { "radius": 6, "width": 0, "color": "#515151" }, "shadow": { "blur": 16, "x": 0, "y": 8 }, "padding": [24, 48, 24, 24], "margin": [32, 48, 40, 48], "font": { "family": "JetBrains Mono", "size": 13, "ligatures": true }, "line_height": 1.3, "window": false } EOF freeze -c my-style.json main.go -o styled.png ``` -------------------------------- ### Freeze Config Struct Definition Source: https://context7.com/charmbracelet/freeze/llms.txt The `Config` struct in Go defines all rendering options, populated from CLI flags, JSON files, or interactive input. It includes settings for input, window appearance, text rendering, and decorations. ```go type Config struct { Input string // positional: file path or "-" for stdin // Window Background string // e.g. "#171717" Margin []float64 // 1, 2, or 4 values (CSS shorthand) Padding []float64 // 1, 2, or 4 values (CSS shorthand) Window bool // show macOS-style window controls Width float64 // fixed canvas width (0 = auto) Height float64 // fixed canvas height (0 = auto) // Settings Config string // preset name or file path Language string // Chroma language name or "ansi" Theme string // Chroma theme name Wrap int // wrap at column (0 = disabled) Output string // destination file path Execute string // shell command to run and capture ExecuteTimeout time.Duration // Decoration Border Border // radius, width, color Shadow Shadow // blur, x, y // Font Font Font // family, file, size, ligatures // Line LineHeight float64 Lines []int // [start, end] 1-indexed slice window ShowLineNumbers bool } ``` -------------------------------- ### Pipe and Screenshot Code Snippet Source: https://context7.com/charmbracelet/freeze/llms.txt Pipes a specific range of lines from a Go file to freeze for creating a code snippet screenshot with a specified language and theme. ```sh sed -n '10,30p' main.go | freeze --language go --theme nord -o snippet.png ``` -------------------------------- ### Enable macOS-Style Window Controls Source: https://context7.com/charmbracelet/freeze/llms.txt Use the `--window` or `-w` flag to render macOS-style traffic-light window controls. This automatically adds 15px of top padding and is enabled by default in the `full` preset. ```sh freeze artichoke.hs --window -o window.png ``` ```sh freeze main.go \ --window \ --border.radius 10 \ --border.width 1 \ --border.color "#3A3A3A" \ --shadow.blur 20 \ --shadow.y 12 \ -o macos.png ``` -------------------------------- ### Add Window Controls Source: https://github.com/charmbracelet/freeze/blob/main/README.md Include macOS-style window controls (close, minimize, maximize buttons) in the terminal output. ```bash freeze artichoke.hs --window ``` -------------------------------- ### Specify Font Properties Source: https://github.com/charmbracelet/freeze/blob/main/README.md Set the font family, size, and line height for the output image. Defaults are 'JetBrains Mono', 14px, and 1.2em. Font files can also be embedded. ```bash freeze artichoke.hs \ --font.family "SF Mono" \ --font.size 16 \ --line-height 1.4 ``` -------------------------------- ### Enable Line Wrapping with Font Size Adjustment Source: https://context7.com/charmbracelet/freeze/llms.txt Combine line wrapping with a specific font size. This ensures that wrapped lines are rendered legibly at the desired size. ```bash freeze main.go --wrap 100 --font.size 12 -o wrapped100.png ``` -------------------------------- ### Read File Content Source: https://context7.com/charmbracelet/freeze/llms.txt Reads the entire content of a specified file. Returns the content as a string and an error if any. ```go import "github.com/charmbracelet/freeze/input" // ReadFile reads the full content of a file. content, err := input.ReadFile("main.go") ``` -------------------------------- ### Generate Image of Code Source: https://github.com/charmbracelet/freeze/blob/main/README.md Use this command to generate an image of a code file. The output format is inferred from the file extension or can be specified with the -o flag. ```sh freeze artichoke.hs -o artichoke.png ``` -------------------------------- ### Capture Terminal Output with --execute Source: https://context7.com/charmbracelet/freeze/llms.txt Run a command and capture its ANSI output as an SVG image. Supports custom timeouts and capturing TUI applications. ```sh # Screenshot the output of `eza -lah` freeze --execute "eza -lah" -o eza.png ``` ```sh # Screenshot a tree listing with a custom timeout freeze -x "tree -L 3" --execute.timeout 5s -o tree.png ``` ```sh # Screenshot a tmux pane (useful for capturing TUI applications) tmux capture-pane -pet 1 | freeze -c full -o helix.png ``` -------------------------------- ### Embed Custom Font File Source: https://context7.com/charmbracelet/freeze/llms.txt Embed a custom font file like 'Fira Code' using the `--font.file` option. Ensure the font path is correct for the system. ```bash freeze main.go \ --font.family "Fira Code" \ --font.file /usr/share/fonts/FiraCode-Regular.ttf \ -o fira.png ``` -------------------------------- ### Check for rsvg-convert Binary Source: https://context7.com/charmbracelet/freeze/llms.txt Verifies if the `rsvg-convert` binary is available in the system's PATH, which is used by libsvgConvert for faster PNG conversion. ```sh # rsvg-convert is used automatically when installed which rsvg-convert # /usr/bin/rsvg-convert → libsvgConvert path ``` -------------------------------- ### Set Fixed Canvas Width Source: https://context7.com/charmbracelet/freeze/llms.txt Force a specific pixel width for the output image using `--width`. The height will be calculated automatically. Content overflowing the width will be clipped. ```bash freeze main.go --width 800 -o fixed-width.png ``` -------------------------------- ### Capture Tmux Pane Source: https://github.com/charmbracelet/freeze/blob/main/README.md Capture a tmux pane and pipe its content to freeze for creating screenshots of TUIs. Use '-c full' for capturing the entire pane. ```bash hx # in a separate pane tmux capture-pane -pet 1 | freeze -c full ``` -------------------------------- ### Enable Font Ligatures Source: https://github.com/charmbracelet/freeze/blob/main/README.md Apply the --font.ligatures flag to enable font ligatures in the output image. ```bash freeze artichoke.hs --font.ligatures ``` -------------------------------- ### Control Padding and Margin Source: https://context7.com/charmbracelet/freeze/llms.txt Use `--padding` and `--margin` flags with 1, 2, or 4 comma-separated values to control internal and external whitespace, respectively. Values follow CSS shorthand rules. ```sh freeze main.go --padding 20 ``` ```sh freeze main.go --padding 20,40 ``` ```sh freeze main.go --padding 20,60,20,40 ``` ```sh freeze main.go --margin 40 --padding 20 -o spaced.png ``` -------------------------------- ### Force Syntax Language with --language Source: https://context7.com/charmbracelet/freeze/llms.txt Override automatic language detection for syntax highlighting, useful for files without extensions or piped text. Use 'ansi' for pre-coloured terminal output. ```sh # Force Haskell highlighting on a file without an extension cat artichoke | freeze --language haskell -o artichoke.png ``` ```sh # Highlight a Go snippet piped via stdin echo 'fmt.Println("hello")' | freeze --language go ``` ```sh # Use the special "ansi" language to render pre-coloured terminal output cat coloured_log.txt | freeze --language ansi -o log.png ``` -------------------------------- ### Create SVG Window Controls Source: https://context7.com/charmbracelet/freeze/llms.txt Generates an SVG element containing three colored circles, typically used for window controls. Requires radius and position. ```go import "github.com/charmbracelet/freeze/svg" // NewWindowControls returns an element with three coloured circles. windowBar := svg.NewWindowControls(5.5, 19.0, 12.0) // r, x, y ``` -------------------------------- ### Set Fixed Canvas Width and Height Source: https://context7.com/charmbracelet/freeze/llms.txt Set both the width and height for the output image. This provides precise control over the canvas dimensions, clipping content that exceeds these limits. ```bash freeze main.go --width 900 --height 600 -o fixed.png ``` -------------------------------- ### Read Input from io.Reader Source: https://context7.com/charmbracelet/freeze/llms.txt Reads all bytes from any io.Reader, such as os.Stdin. Useful for piping data into the program. ```go import "github.com/charmbracelet/freeze/input" // ReadInput reads all bytes from any io.Reader (e.g. os.Stdin). content, err := input.ReadInput(os.Stdin) ``` -------------------------------- ### Capture Source Code to SVG Source: https://context7.com/charmbracelet/freeze/llms.txt Generate an SVG image from a source code file. The output filename defaults to '.svg' when run in a TTY. ```sh # Produce artichoke.svg in the current directory freeze artichoke.hs ``` ```sh # Explicitly name the output file (SVG, PNG, or WebP) freeze main.go -o main.png ``` ```sh # Write multiple formats at once using brace expansion freeze main.go -o out.{svg,png,webp} ``` ```sh # Pipe a file to freeze and receive SVG on stdout cat main.go | freeze --language go > main.svg ``` -------------------------------- ### Screenshot Colored CLI Command Output Source: https://context7.com/charmbracelet/freeze/llms.txt Captures and screenshots the output of a colored CLI command. The `-c full` flag ensures the entire output is captured. ```sh freeze --execute "git log --oneline --color=always -10" \ -c full \ -o git-log.png ``` -------------------------------- ### Extract Last 5 Lines of Code Source: https://context7.com/charmbracelet/freeze/llms.txt Use the `--lines` flag with negative indices to capture the last few lines of a file. The output is saved to `tail.png`. ```bash freeze main.go --lines -5,-1 -o tail.png ``` -------------------------------- ### Set Custom Background Color Source: https://context7.com/charmbracelet/freeze/llms.txt Set a custom background color for the terminal window using the `--background` flag with a CSS hex string. The default is near-black. ```bash freeze artichoke.hs --background "#08163f" -o dark-blue.png ``` -------------------------------- ### Set Border Width and Color Source: https://github.com/charmbracelet/freeze/blob/main/README.md Add a border outline to the terminal window, specifying its width and color. Can be combined with border radius. ```bash freeze artichoke.hs --border.width 1 --border.color "#515151" --border.radius 8 ``` -------------------------------- ### Customize Font Family, Size, and Line Height Source: https://context7.com/charmbracelet/freeze/llms.txt Modify the font family to 'SF Mono', set the font size to 16, and adjust the line height to 1.4 for the output image. This is useful for specific typographic requirements. ```bash freeze artichoke.hs \ --font.family "SF Mono" \ --font.size 16 \ --line-height 1.4 \ -o custom-font.png ``` -------------------------------- ### Add Shadow Effect Source: https://github.com/charmbracelet/freeze/blob/main/README.md Apply a shadow effect to the terminal window by specifying blur radius and offset (x, y). ```bash freeze artichoke.hs --shadow.blur 20 --shadow.x 0 --shadow.y 10 ``` -------------------------------- ### Set Background Color Source: https://github.com/charmbracelet/freeze/blob/main/README.md Customize the background color of the terminal window using a hex color code. ```bash freeze artichoke.hs --background "#08163f" ``` -------------------------------- ### Enable Line Wrapping Source: https://context7.com/charmbracelet/freeze/llms.txt Wrap long lines at a specified column width using the `--wrap` flag. This hard-wraps both raw and ANSI-stripped content, preventing extremely wide images. ```bash freeze main.go --wrap 80 -o wrapped.png ``` -------------------------------- ### Show Line Numbers Source: https://github.com/charmbracelet/freeze/blob/main/README.md Display line numbers in the terminal output. Use the --lines flag to capture a specific range of lines. ```bash freeze artichoke.hs --show-line-numbers ``` ```bash freeze artichoke.hs --show-line-numbers --lines 2,3 ``` -------------------------------- ### Apply Drop Shadow Source: https://context7.com/charmbracelet/freeze/llms.txt Add a Gaussian drop shadow using `--shadow.blur`, `--shadow.x`, and `--shadow.y` to control blur radius and offset. These options are implemented using SVG filters. ```sh freeze artichoke.hs --shadow.blur 20 --shadow.x 0 --shadow.y 10 -o shadow.png ``` ```sh freeze main.go \ --shadow.blur 8 \ --shadow.x 4 \ --shadow.y 6 \ -o diagonal-shadow.png ``` -------------------------------- ### Change Output File Location Source: https://github.com/charmbracelet/freeze/blob/main/README.md Specify the output file name and format. Supports .svg, .png, and .webp. Can specify multiple formats for batch output. ```bash freeze main.go --output out.svg freeze main.go --output out.png freeze main.go --output out.webp # or all of the above freeze main.go --output out.{svg,png,webp} ``` -------------------------------- ### Set Padding Source: https://github.com/charmbracelet/freeze/blob/main/README.md Add padding around the content within the terminal window. Accepts 1, 2, or 4 values for different padding configurations. ```bash freeze main.go --padding 20 # all sides freeze main.go --padding 20,40 # vertical, horizontal freeze main.go --padding 20,60,20,40 # top, right, bottom, left ``` -------------------------------- ### Embed Font File Source: https://github.com/charmbracelet/freeze/blob/main/README.md Embed a font file (TTF, WOFF, WOFF2) directly into the output image using the --font.file flag. ```bash freeze artichoke.hs --font.file /path/to/your/font.ttf ``` -------------------------------- ### Set Fixed Canvas Height Source: https://context7.com/charmbracelet/freeze/llms.txt Force a specific pixel height for the output image using `--height`. This is useful for screenshots of terminals with a fixed number of rows. The width will be calculated automatically. ```bash freeze main.go --height 400 -o fixed-height.png ``` -------------------------------- ### Check if Stdin is a Pipe Source: https://context7.com/charmbracelet/freeze/llms.txt Reports whether the given os.File is connected to a pipe, indicating if data is being piped into the program. ```go import "github.com/charmbracelet/freeze/input" // IsPipe reports whether the given *os.File is connected to a pipe. if input.IsPipe(os.Stdin) { // stdin has data piped to it } ``` -------------------------------- ### Set Border Radius Source: https://github.com/charmbracelet/freeze/blob/main/README.md Add rounded corners to the terminal window by specifying the border radius in pixels. ```bash freeze artichoke.hs --border.radius 8 ``` -------------------------------- ### Generate Image of Terminal Output Source: https://github.com/charmbracelet/freeze/blob/main/README.md Capture the ANSI output of a terminal command by using the --execute flag. This is useful for documenting command-line tool behavior. ```bash freeze --execute "eza -lah" ``` -------------------------------- ### Screenshot TUI Application Source: https://context7.com/charmbracelet/freeze/llms.txt Captures a screenshot of a running TUI application (like Helix editor in tmux) by piping the tmux pane content to freeze. ```sh # In one pane, launch helix: hx main.go # In another pane, capture: tmux capture-pane -pet 1 | freeze -c full -o helix.png ``` -------------------------------- ### Set Terminal Height Source: https://github.com/charmbracelet/freeze/blob/main/README.md Specify the height of the terminal window in pixels. ```bash freeze artichoke.hs --height 400 ``` -------------------------------- ### Set Margin Source: https://github.com/charmbracelet/freeze/blob/main/README.md Add margin around the terminal window. Accepts 1, 2, or 4 values for different margin configurations. ```bash freeze main.go --margin 20 # all sides freeze main.go --margin 20,40 # vertical, horizontal freeze main.go --margin 20,60,20,40 # top, right, bottom, left ``` -------------------------------- ### Add Outline to SVG Rect Source: https://context7.com/charmbracelet/freeze/llms.txt Sets the stroke and stroke-width attributes on a terminal rect element for an outline effect. ```go import "github.com/charmbracelet/freeze/svg" // AddOutline sets stroke + stroke-width on the terminal . svg.AddOutline(terminalRect, 1.0, "#515151") ``` -------------------------------- ### Set Corner Radius on SVG Rect Source: https://context7.com/charmbracelet/freeze/llms.txt Sets the rx/ry attributes on a terminal rect element to define its corner radius. ```go import "github.com/charmbracelet/freeze/svg" // AddCornerRadius sets rx/ry attributes on the terminal . svg.AddCornerRadius(terminalRect, 8.0) ``` -------------------------------- ### Move SVG Element Source: https://context7.com/charmbracelet/freeze/llms.txt Updates the x/y attributes of an SVG element to reposition it in pixels. ```go import "github.com/charmbracelet/freeze/svg" // Move sets the x/y attributes (in px) on any element. svg.Move(element, 60.0, 50.0) ``` -------------------------------- ### Add Clip Path to SVG Source: https://context7.com/charmbracelet/freeze/llms.txt Adds a clipPath definition to constrain visible text area within an SVG. Requires element ID, and dimensions. ```go import "github.com/charmbracelet/freeze/svg" // AddClipPath adds a to constrain visible text area. svg.AddClipPath(imageElement, "terminalMask", marginLeft, marginTop, terminalWidth, terminalHeight) ``` -------------------------------- ### Add Shadow to SVG Element Source: https://context7.com/charmbracelet/freeze/llms.txt Injects a drop-shadow filter definition into an SVG. Requires filter ID, pixel offset, and blur radius. ```go import "github.com/charmbracelet/freeze/svg" // AddShadow injects a drop-shadow definition. // id: filter id referenced by the terminal rect's filter attribute // x, y: pixel offset; blur: Gaussian stdDeviation svg.AddShadow(imageElement, "shadow", 0, 12, 24) ``` -------------------------------- ### Disable Font Ligatures Source: https://context7.com/charmbracelet/freeze/llms.txt Disable font ligatures using `--font.ligatures=false` to use the NL variant of JetBrains Mono. This can be useful for code where ligatures might alter character recognition. ```bash freeze main.go --font.ligatures=false -o no-lig.png ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.