Gfret enerates an svg image template of a stringed instrument fretboard.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Nathan Fisher 8dc9043c67 Reorganized modules to fix xtask build 1 week ago
.cargo Save preferences in background thread 2 months ago
.github Create FUNDING.yml 5 months ago
data Added release notes 5 months ago
src Reorganized modules to fix xtask build 1 week ago
xtask Reorganized modules to fix xtask build 1 week ago
.gitignore Ran clippy and fmt 1 week ago
Cargo.lock Update to rgba-simple-next with generics 1 month ago
Cargo.toml Save preferences in background thread 2 months ago
LICENSE Initial commit of working code 1 year ago Moved top level doc comments to README 2 months ago Prepare for 2.1 release 4 months ago




Gfret renders an svg image template of a fretboard for a stringed instrument. It has a Gtk interface as well as a command line interface and can produce templates for instruments ranging from a piccolo mandolin to an upright bass. Multiscale designs are also supported. Currently, all measurements are expressed in metric units only.

Getting Gfret

Gfret is distributed primarily in source form. The main repo is at with mirrors at gitlab and Releases are recommended.


Gfret can be used from the command line or using the Gtk+ interface.

Running the command line interface


Output an svg without running the interface

   gfret cli [OPTIONS] [OUTPUT]

   <OUTPUT>    Name of the output file [default: output.svg]

   -b, --bridge <BRIDGE>
           Bridge spacing [default: 56]

   -c, --count <COUNT>
           Total fret count [default: 24]

   -e, --external <EXTERN>
           Open output file in external program [default: inkscape]

   -h, --help
           Print help information

   -l, --left
           Multiscale fretboard reversed (left handed)

   -m, --multi <MULTI>
           Creates a multiscale fretboard with <MULTI> as the treble scale. [default: 610]

   -n, --nut <NUT>
           Nut width [default: 43]

   -o, --output <OUTPUT>
           Name of the output file [default: output.svg]

   -p, --perpendicular <PERPENDICULAR>
           Set which fret is perpendicular to the centerline [default: 8]
   -s, --scale <SCALE>
           Scale length in mm [default: 648]

Running the gui

Calling the program by invoking gfret without any arguments will run the Gtk interface. Additionally, a .desktop file and icon are included and will be installed if the program is installed using the included Makefile, and can be used for launching the program from desktop menus or creating shortcuts.


Key Action
Ctrl/S save file
Ctrl/Shift/S save file as
Ctrl/E open with an external program
Ctrl/O load a template from file
Ctrl/Shift/P open the preferences dialog
Ctrl/A open the about dialog
Ctrl/Q quit the program


Along with the svg output, Gfret will save the specifications used to generate the rendering in a Toml file with it's name corresponding to the name of the svg file. These templates can be loaded later, either as an argument when invoking the program, in which case the output will be immediately generated, or else loaded from the Gui interface for further editing. This is useful for sharing a common scale among multiple designs to use as a starting point.


On Unix systems the default configuration directory is ~/.config/gfret. Gfret will maintain a configuration file here in Toml format, with the following fields:

## must match either "Metric" or "Imperial"
units = "Metric"
## the command line to run
external_program = "inkscape"
## the size of the border around the image
border = 10.0
## how thick the lines are
line_weight = 1.0

## Colors must be "Hex", "Reduced" or "RGBA"
## "Reduced" will take a whole number between 0 and 255 for each channel,
## while "RGBA" takes a decimal between 0.0 and 1.0.

## "Hex" will have a <color> field and an <alpha> field
## ColorType = "Hex"
## color = "#00ff00"
## alpha = 1.0
ColorType = "Reduced"
red = <u8>
green = <u8>
blue = <u8>
alpha = <u8>

ColorType = "Reduced"
red = 36
green = 31
blue = 49
alpha = 255

ColorType = "Reduced"
red = 0
green = 0
blue = 255
alpha = 255

## Fonts take a family and weight (style), but size is ignored
family = "Sans"
weight = "Normal"

Note: The graphical interface has a preferences dialog and will take care of maintaining the preferences file for you. There will be no need to edit this file by hand in normal use.


You will need a Rust toolchain installed, including cargo. Gtk+4x is also required.

cargo build --release

If desired, a release distribution can then be generated which will include the binary, svg and png icons, Unix man pages, XDG .desktop file and shell completions.

cargo xtask dist


  • For the gui, it would be nice to save state and allow loading specs from and saving to templates. partial implementation 4/7/21 | completed 5/5/21
  • Port to Gtk4 completed 12/21
  • Support changing from metric to imperial measurements completed 12/21
  • Support left handed multiscale fretboards completed 12/21
  • Orient left handed output with bass strings on top completed 1/22