The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

App::Music::ChordPro::Config - Built-in configuration

DESCRIPTION

The configurations files are 'relaxed' JSON files. This means that they may contain comments and trailing comma's.

Currently, most settings in the configuration files are for the PDF backend.

This is the current built-in configuration file, showing all settings.

  // Configuration for ChordPro.
  //
  // This is a relaxed JSON document, so comments are possible.
  
  {
  
      // Strings and tuning.
      // Note that using this will discard all built-in chords!
      // "tuning" : [ "E2", "A2", "D3", "G3", "B3", "E4" ],
  
      // User defined chords.
      // "base" defaults to 1.
      // "easy" defaults to 0.
      // Use 0 for an empty string, and -1 for a muted string.
      "chords" : [
          {
            "name"  : "Bb",
            "base"  : 1,
            "frets" : [ 1, 1, 3, 3, 3, 1 ],
            "easy"  : 1,
          },
      ],
  
      // Printing chord grids.
      // "show": prints the chords used in the song.
      // "hard": only prints the hard chords. This includes user
      // defined chords.
      // "sorted": order the chords by key.
      "chordgrid" : {
          "show"     :  1,
          "hard"     :  1,
          "sorted"   :  0,
      },
  
      // Diagnostig messages.
      "diagnostics" : {
          "format" : "\"%f\", line %n, %m\n\t%l",
      },
  
      // Layout definitions for PDF output.
  
      "pdf" : {
  
        // Papersize, 'a4' or [ 595, 842 ] etc.
        "papersize" : "a4",
  
        // Number of columns.
        // Can be overridden with {columns} directive.
        // "columns"   : 2,
        // Space between columns, in pt.
        "columnspace"  :  20,
  
        // Page margins.
        // Note that top/bottom exclude the head/footspace.
        "margintop"    :  80,
        "marginbottom" :  40,
        "marginleft"   :  40,
        "marginright"  :  40,
        "headspace"    :  60,
        "footspace"    :  20,
  
        // Special: head on first page only, add the headspace to
        // the other pages so they become larger.
        "head-first-only" : 0,
  
        // Spacings.
        // Baseline distances as a factor of the font size.
        "spacing" : {
            "title"  : 1.2,
            "lyrics" : 1.2,
            "chords" : 1.2,
            "grid"   : 1.2,
            "tab"    : 1.0,
            "toc"    : 1.4,
            "empty"  : 1.0,
        },
        // Note: By setting the font size and spacing for empty lines to
        // smaller values, you get a fine(r)-grained control over the
        // spacing between the various parts of the song.
  
        // Style of chorus.
        "chorus" : {
            "indent"     :  0,
            // Chorus side bar.
            // Suppress by setting offset and/or width to zero.
            "bar" : {
                "offset" :  8,
                "width"  :  1,
                "color"  : "black",
            },
        },
  
        // Alternative songlines with chords in a side column.
        // Value is the column position.
        // "chordscolumn" : 400,
        "chordscolumn" :  0,
  
        // Suppress empty chord lines.
        // Overrides the -a (--single-space) command line options.
        "suppress-empty-chords" : 1,
  
        // A {titles: left} may conflict with customized formats.
        // Set to non-zero to ignore the directive.
        "titles-directive-ignore" : 0,
  
        // Chord grids.
        // A chord grid consists of a number of cells.
        // Cell dimensions are specified by "width" and "height".
        // The horizontal number of cells depends on the number of strings.
        // The vertical number of cells is "vcells", which should
        // be 4 or larger to accomodate most chords.
        // The horizontal distance between grids is "hspace" cells.
        // The vertical distance is "vspace" cells.
        "chordgrid" : {
            "width"    :  6,
            "height"   :  6,
            "hspace"   :  3.95,
            "vspace"   :  3,
            "vcells"   :  4,
        },
  
        // Even/odd pages. A value of -1 denotes odd/even pages.
        "even-odd-pages" : 1,
  
        // Formats.
        "formats" : {
            // Titles/Footers.

            // Titles/footers have 3 parts, which are printed left,
            // centered and right.
            // For even/odd printing, the order is reversed.

            // By default, a page has:
            "default" : {
                // No title/subtitle.
                "title"     : null,
                "subtitle"  : null,
                // Footer is title -- page number.
                "footer"    : [ "%t", "", "%p" ],
                // Title for ToC.
                "toc-title" : "Table of Contents",
            },
            // The first page of a song has:
            "title" : {
                // Title and subtitle.
                "title"     : [ "", "%t", "" ],
                "subtitle"  : [ "", "%s", "" ],
                // Footer with page number.
                "footer"    : [ "", "", "%p" ],
            },
            // The very first output page is slightly different:
            "first" : {
                // It has title and subtitle, like normal 'first' pages.
                // But no footer.
                "footer"    : null,
            },
        },
  
        // Fonts.
        // Fonts can be specified by name (for the corefonts)
        // or a filename (for TrueType/OpenType fonts).
        // Relative filenames are looked up in the fontdir.
        // "fontdir" : "/home/jv/.fonts",
  
        // Fonts for chords and comments can have a background
        // colour associated.
        // Colours are "#RRGGBB" or predefined names like "black", "white",
        // and lots of others.
  
        "fonts" : {
            "title" : {
                "name" : "Times-Bold",
                "size" : 14
            },
            "text" : {
                "name" : "Times-Roman",
                "size" : 14
            },
            "chord" : {
                "name" : "Helvetica-Oblique",
                "size" : 10
            },
            "comment" : {
                "name" : "Helvetica",
                "size" : 12
            },
            "tab" : {
                "name" : "Courier",
                "size" : 10
            },
            "toc" : {
                "name" : "Times-Roman",
                "size" : 11
            },
        },
  
        // Fonts that can be specified, but need not.
        // subtitle       --> text
        // comment        --> text
        // comment_italic --> chord
        // comment_box    --> chord
        // toc            --> text
        // grid           --> comment
        // footer         --> subtitle @ 60%
        // empty          --> text
        // chordgrid      --> comment
        // chordgrid_capo --> text (but at a small size)

        // This will show the page layout.
        // "showlayout" : 1,
      },
  }
  // End of config.