App-Music-ChordPro

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

    - Fix paper anchored images being restricted to page size instead
      of paper size.
    - Fix problem that blocked pdf documents from being processed as songs.
    - Fixed problems with labels and embedded newlines.
    - Fixed newline issues in TextBlocks.
    - Fix issue #353, #367, #371, #372, #384, #388, #399, #410.
    - Fix spread image handling.
    - Fix diagrams.sorted.
    - Fix handling of "display"/"format" in config chords.
    - Fix problem that text in a TextBlock did not reset to flush left.
    - Fix problem TextBlock textstyle did not copy the background colour.
    - Fix colours of keyboard diagrams wrt. theme.
    - Fix rootless chords with transcode.
    - Fix problem with /~ in grid.
    - Upgrade to abc2svg fca05cd348 to fix problem with grid widths.
    - Fix problem with TextBlock not correctly using desired spacing.
    - Fixed --print-{default,final,delta}-config.

!Internal
    - New function to deal with property settings for the config.
    - Move pp files to separate MANIFEST so they do not clobber the CPAN.

Changes  view on Meta::CPAN

      Fallback to the ChordProSymbols font if the font doesn't have the
      appropriate symbols.
    - Add settings.truesf (default: false) to enable/disable this.
    - Allow settings.* to be used in %{} substitutions.
    - Add meta chords and numchords (list/number of chords used).
    - Add config pdf.spacing.diagramchords.
    - Allow meta values for directive selectors.
    - Re-enable agnostic chord lookup.
    - (Wx)(MacOS) Improve preferences dialog.
    - Several ABC fixes/improvements.
    - (PDF) Add support for background document.
    - Markdown export (EXPERIMENTAL). Thanks to Johannes Rumpf.
    - LaTeX export (EXPERIMENTAL). Thanks to Johannes Rumpf.
    - !BugFixes
    - Fix issue #208.
    - (Wx) Fix sharps/flats mixup in PreferencesDialog.

5.987 2022-02-08

    - !ChordPro functionality
    - Conditional directives can be negated with a trailing !

Changes  view on Meta::CPAN

    - Config pdf.csv.songsonly controls whether matter pages are
      included in the CSV. 
    - Add warning if no songs were found in the input.
    - Simplify README.md.
    - Add ChordPro history doc.
    - !BugFixes
    - Fix crash when no chords.
    - Fix case insensitive matching of directive selectors.
    - Fix issue #145.
    - Allow {define} and {chord} to take multi-digit fret/finger positions.
    - Fix background drawing for finger positions.
    - Fix "Modification of a read-only value attempted" crash when
      instrument or user get nulled.
    - Fix %{pageno} vs. %{page} confusion.
    - Do not tamper with ABC content. E.g., adding K: has side-effects.
    - Fix issue #148.
    - Fix issue #149.
    - Fix issue #158.

0.979 2021-07-09

Changes  view on Meta::CPAN

    - Allow meta substitutions in title and subtitle.
    - Fix {transpose}, --transpose and {key} interaction.
    - Experimental: Chords can be recalled from previous sections
      using [^] or plain ^.
      Requires config setting settings.memorize.
    - Upgrade WxChordPro to 0.960_059.
    - Add config settings for ChordPro backend.
    - Add slash as grid symbol.
    - Allow labels for grids.
    - Show durations as hh:mm.
    - Fix grey background of comment_italic.
    - Add font "label" for section labels. Defaults to text font.
    - Fix section labels when the first line is not a song line.
    - {chorus} Do not print Chorus tag when quoting.
    - {chorus} Allow label.
    - Allow empty comment directives.
    - Do not print background for empty strings.

0.96	2018-07-11

    - (pp/linux/GNUmakefile) Verify we're running the right perl.
    - Upgrade to App::Packager 1.43.
    - Fix transpose of Asus and Esus chords.
    - Fix issue #47 by Increasing base fret limit to 23.
    - Fix error handling with illegal chord definitions.
    - (wxChordPro) Fix file saving logic.
    - Experimental: Markup for song sections.
    - Experimental: All fonts can have background and frame.

0.95	2018-06-04

    - Add (derived) meta item _key to reflect the actual song key,
      taking capo setting into account.
    - Allow {comment} without background colour.
    - Make {comment_box} box the same colour as its text.
    - Warn if multiple {capo} settings.
    - Fix problem that chords in grids were not transposed.
    - Add value "auto" for pdf.labels.width to automatically reserve
      margin space when labels are used.
    - Fix problem that titles-directive-ignore was ignored.
    - (PDF) Fix problem that toc entries were not clickable.
    - Fix issue #41 - Error in transposition of a recalled chorus.
    - Fix issue #42 - Defining Chords Fails for Songbooks.
      Song chord definitions were lost in multi-song songbooks except

Changes  view on Meta::CPAN


    - Produce CSV with PDF and toc.
    - Implement {chord...} directive.

0.70    2016-11-10

    - (ChordPro) Fix require of Common.
    - (Config) Comment example chord definition.
    - (ChordPro) Add rechorus handling.
    - (ChordPro) Fix --toc/--notoc command line option.
    - (PDF) Fix background colour in indented chorus.
    - (PDF) Fix wrong headspace on continuation pages.

0.69    2016-09-29

    - Add parser tests.
    - Prevent nasty errors when transposing unknown chords.
    - (PDF) Fix comment decorations that were off due to
      substituting metadata.
    - (ChordPro) Add msp as output variant.

lib/ChordPro/Config.pm  view on Meta::CPAN

    for my $ff ( @allfonts ) {
	# Derived chords can have size or color only. Disable
	# this test for now.
        unless ( 1 || $cfg->{pdf}->{fonts}->{$ff}->{name}
                 || $cfg->{pdf}->{fonts}->{$ff}->{description}
                 || $cfg->{pdf}->{fonts}->{$ff}->{file} ) {
            delete( $cfg->{pdf}->{fonts}->{$ff} );
            next;
        }
        $cfg->{pdf}->{fonts}->{$ff}->{color}      //= "foreground";
        $cfg->{pdf}->{fonts}->{$ff}->{background} //= "background";
        for ( qw(name file description size) ) {
            delete( $cfg->{pdf}->{fonts}->{$ff}->{$_} )
              unless defined( $cfg->{pdf}->{fonts}->{$ff}->{$_} );
        }
    }

    if ( defined $options->{diagrams} ) {
        warn( "Invalid value for diagrams: ",
              $options->{diagrams}, "\n" )
          unless $options->{diagrams} =~ /^(all|none|user)$/i;

lib/ChordPro/Config.pm  view on Meta::CPAN

    for my $f ( keys %{$cfg->{pdf}->{fonts}} ) {
	next if ref($cfg->{pdf}->{fonts}->{$f}) eq 'HASH';
	for ( $cfg->{pdf}->{fonts}->{$f} ) {
	    my $v = $_;
	    $v =~ s/\s*;\s*$//;
	    my $i = {};

	    # Break out ;xx=yy properties.
	    while ( $v =~ s/\s*;\s*(\w+)\s*=\s*(.*?)\s*(;|$)/$3/ ) {
		my ( $k, $v ) = ( $1, $2 );
		if ( $k =~ /^(colou?r|background|frame|numbercolou?r|size)$/ ) {
		    $k =~ s/colour/color/;
		    $v =~ s/^(['"]?)(.*)\1$/$2/;
		    $i->{$k} = $v;
		}
		else {
		    warn("Unknown font property: $k (ignored)\n");
		}
	    }

	    # Break out size.

lib/ChordPro/Config.pm  view on Meta::CPAN

sub simplify_fonts( $cfg ) {

    return $cfg unless $cfg->{pdf}->{fonts};

    foreach my $font ( keys %{$cfg->{pdf}->{fonts}} ) {
	for ( $cfg->{pdf}->{fonts}->{$font} ) {
	    next unless is_hashref($_);

	    delete $_->{color}
	      if $_->{color} && $_->{color} eq "foreground";
	    delete $_->{background}
	      if $_->{background} && $_->{background} eq "background";

	    if ( exists( $_->{file} ) ) {
		delete $_->{description};
		delete $_->{name};
	    }
	    elsif ( exists( $_->{description} ) ) {
		delete $_->{name};
		if ( $_->{size} && $_->{description} !~ /\s+[\d.]+$/ ) {
		    $_->{description} .= " " . $_->{size};
		}

lib/ChordPro/Config.pm  view on Meta::CPAN

    $cfg //= configurator($options);

    # Remove unwanted data.
    $cfg->unlock;
    $cfg->{tuning} = delete $cfg->{_tuning};
    if ( $delta ) {
	for ( qw( tuning ) ) {
	    delete($cfg->{$_}) unless defined($cfg->{$_});
	}
	for my $f ( keys( %{$cfg->{pdf}{fonts}} ) ) {
	    for ( qw( background color ) ) {
		next if defined($defcfg->{pdf}{fonts}{$f}{$_});
		delete($cfg->{pdf}{fonts}{$f}{$_});
		delete($defcfg->{pdf}{fonts}{$f}{$_});
	    }
	}
    }
    delete $cfg->{_chords};
    delete $cfg->{chords};
    delete $cfg->{_src};

lib/ChordPro/Config/Data.pm  view on Meta::CPAN

use JSON::Relaxed::Parser qw();
use feature qw(state);
# Config version.
our $VERSION = 6.081;

sub config {
    state $pp = JSON::XS->new->utf8
	->boolean_values( $JSON::Boolean::false, $JSON::Boolean::true );

    $pp->decode( <<'EndOfJSON' );
{"$schema":"https://chordpro.org/beta/resources/config.schema","a2crd":{"classifier":"pct_chords","infer-titles":true,"tabstop":"8"},"assets":{},"chord-formats":{"common":"%{root|%{}%{qual|%{}}%{ext|%{}}%{bass|/%{}}|%{name}}","nashville":"%{root|%{}%...
EndOfJSON
}

1;

lib/ChordPro/Delegate/TextBlock.pm  view on Meta::CPAN

#              When height or padding is set, a tight fit is used.
#  padding:    Provide padding between the object and the inner text.
#              When height or padding is set, a tight fit is used.
#  flush:      Horizontal text flush (left, center, right).
#  vflush:     Vertical text flush (top, middle, bottom).
#  textstyle:  Style (font) to be used. Must be one of "text", "chords",
#              "comment" etc.
#  textsize:   Initial value for the text size.
#  textspacing: Text spacing. A factor (e.g. 1.2) or "flex".
#  textcolor:  Initial color for the text.
#  background: Background color of the object.
#
# Common attributes:
#
#  id:         Make asset instead of image.
#  align:      Image alignment (left, center, right)
#  border:     Draw border around the image.

use ChordPro::Utils;

sub DEBUG() { $::config->{debug}->{txtblk} }

lib/ChordPro/Delegate/TextBlock.pm  view on Meta::CPAN

    my $pr = $ps->{pr};
    my $opts = { %{$elt->{opts}} };

    # Text style must be one of the known styles (text, chord, comment, ...).
    my $style = delete($opts->{textstyle}) // "text";
    unless ( defined($ps->{fonts}->{$style} ) ) {
	warn("TextBlock: Unknown style \"$style\", using \"text\"\n");
	$style = "text";
    }
    my $font  = $ps->{fonts}->{$style};
    my $bgcol = $pr->_bgcolor($font->{background});
    $bgcol = "" if $bgcol eq "none";
    my $vsp = delete($opts->{textspacing}) // "flex";
    my $sp = $vsp eq "flex"
      ? ($font->{leading} || $ps->{spacing}->{$style} || 1) : $vsp;
    my $size   = fontsize( delete($opts->{textsize}), $font->{size} );
    my $color  = delete($opts->{textcolor}) // $font->{color};
    my $flush  = delete($opts->{flush})  // "left";
    my $vflush = delete($opts->{vflush}) // "top";
    $color = $ps->{pr}->_fgcolor($color) if $color;

    my $data = $elt->{data};
    if ( $color || $bgcol ) {
	my $span = "";
	$span .= " color='$color'" if $color;
	$span .= " background='$bgcol'" if $bgcol;
	$data = [ map { "<span$span>$_</span>" } @$data ];
    }
    my $padding  = delete($opts->{padding});

    # New xo.
    my $xo = $pr->{pdf}->xo_form;

    # Pre-pass to establish the actual width/height.
    my ( $awidth, $aheight ) = ( 0, undef );
    my ( $w, $h );

lib/ChordPro/Delegate/TextBlock.pm  view on Meta::CPAN

	$ycorr = 0;
    }
    else {
	$padding = 0;
    }
    if ( $::config->{debug}->{txtblk} ) {
	warn("tb: w = $width, h = $height, p = $padding, sp = $sp, c = $ycorr\n");
    }
    # Note that the padding will be dealt with in the bbox.

    # Draw background.
    $xo->bbox( -$padding, -$padding, $width+$padding, $height+$padding );
    if ( my $bg = delete($opts->{background}) ) {
	$xo->rectangle( $xo->bbox );
	$xo->fill_color($bg);
	$xo->fill;
    }

    # Put it in text mode.
    $xo->textstart;

    my $y = $height - $ycorr;

lib/ChordPro/Output/HTML.pm  view on Meta::CPAN

	if ( $f->{weight} eq "bold" ) {
	    push( @c, q{font-weight:bold} );
	}
	if ( $fragment->{color} && $fragment->{color} ne $self->{_currentcolor} ) {
	    push( @c, join(":","color",$fragment->{color}) );
	}
	if ( $fragment->{size} && $fragment->{size} ne $self->{_currentsize} ) {
	    push( @c, join(":","font-size",$fragment->{size}) );
	}
	if ( $fragment->{bgcolor} ) {
	    push( @c, join(":","background-color",$fragment->{bgcolor}) );
	}
	if ( $fragment->{underline} ) {
	    push( @d, q{underline} );
	}
	if ( $fragment->{strikethrough} ) {
	    push( @d, q{line-through} );
	}
	push( @c, "text-decoration-line:@d" ) if @d;
	my $href = $fragment->{href} // "";
	$res .= "<a href=\"".html($href)."\">" if length($href);

lib/ChordPro/Output/PDF/Configurator.pm  view on Meta::CPAN

	my %ps = "${pdfapi}::Resource::PaperSizes"->get_paper_sizes;
	die("Unhandled paper size: ", $pdf->{papersize}, "\n")
	  unless exists $ps{lc $pdf->{papersize}};
	$pdf->{papersize} = $ps{lc $pdf->{papersize}}
    }

    # Merge properties for derived fonts.
    my $fm = sub {
	my ( $font, $def ) = @_;
	for ( keys %{ $fonts->{$def} } ) {
	    next if /^(?:background|frame)$/;
	    next if $font eq "chordfingers" && $_ eq "size";
	    $fonts->{$font}->{$_} //= $fonts->{$def}->{$_};
	}
    };
    $fm->( qw( subtitle       text     ) );
    $fm->( qw( chorus         text     ) );
    $fm->( qw( comment_italic text     ) );
    $fm->( qw( comment_box    text     ) );
    $fm->( qw( comment        text     ) );
    $fm->( qw( annotation     chord    ) );

lib/ChordPro/Output/PDF/Grid.pm  view on Meta::CPAN

sub gridline( $elt, $x, $y, $cellwidth, $barwidth, $margin, $ps, %opts ) {

    # Grid context.

    my $pr = $ps->{pr};
    my $fonts = $ps->{fonts};

    # Use the chords font for the chords, and for the symbols size.
    my $fchord = { %{ $fonts->{grid} || $fonts->{chord} } };
    my $schord = $fonts->{gridstrum};
    delete($fchord->{background});
    $y -= $pr->font_bl($fchord);

    pr_label_maybe( $ps, $x, $y );

    $x += $barwidth;
    $cellwidth += $barwidth;

    $elt->{tokens} //= [ {} ];

    my $firstbar;

lib/ChordPro/Output/PDF/Song.pm  view on Meta::CPAN

	$ps->{_marginbottom}  = $ps->{marginbottom};
	$ps->{_margintop}     = $ps->{papersize}->[1] - $ps->{margintop};
	$ps->{_bottommargin}  = $ps->{marginbottom};

	# Physical coordinates; will be adjusted to columns if needed.
	$ps->{__leftmargin}   = $ps->{_marginleft};
	$ps->{__rightmargin}  = $ps->{_marginright};
	$ps->{__topmargin}    = $ps->{_margintop};
	$ps->{__bottommargin} = $ps->{_marginbottom};

	# Determine page class and background.
	my $class = 2;		# default
	my $bgpdf = $ps->{formats}->{default}->{background};
	if ( $page_num == 1 ) {
	    $class = 0;		# very first page
	    $bgpdf = $ps->{formats}->{first}->{background}
	      || $ps->{formats}->{title}->{background}
	      || $bgpdf;
	}
	elsif ( $page_num == $startpage ) {
	    $class = 1;		# first of a song
	    $bgpdf = $ps->{formats}->{title}->{background}
	      || $bgpdf;
	}
	if ( $bgpdf ) {
	    my ( $fn, $pg ) = ( $bgpdf, 1 );
	    if ( $bgpdf =~ /^(.+):(\d+)$/ ) {
		( $bgpdf, $pg ) = ( $1, $2 );
	    }
	    $fn = CP->findres($bgpdf);
	    if ( $fn && fs_test( rs => $fn ) ) {
		$pg++ if $pagectrl->{dual_pages} && !$rightpage;
		$pr->importpage( $fn, $pg );
	    }
	    else {
		warn( "PDF: Missing or empty background document: ",
		      $bgpdf, "\n" );
	    }
	}

	$x = $ps->{__leftmargin};
	$y = $ps->{_margintop};
	$y += $ps->{headspace} if $ps->{'head-first-only'} && $class == 2;
	$x += $ps->{_indent};
	$ps->{_top} = $y;
	$col = 0;

lib/ChordPro/Output/PDF/Song.pm  view on Meta::CPAN


	    # Comment decorations.

	    $pr->setfont( $ftext );

=begin xxx

	    my $text = $elt->{text};
	    my $w = $pr->strwidth( $text );

	    # Draw background.
	    my $bgcol = $ftext->{background};
	    if ( $elt->{type} eq "comment" ) {
		# Default to grey.
		$bgcol ||= "#E5E5E5";
		# Since we default to grey, we need a way to cancel it.
		undef $bgcol if $bgcol eq "none";
	    }
	    if ( $bgcol ) {
		$pr->rectxy( $x + $indent - 2, $y + 2,
			     $x + $indent + $w + 2, $y - $vsp, 3, $bgcol );
	    }

lib/ChordPro/Output/PDF/StringDiagram.pm  view on Meta::CPAN

field $nutwidth;		# width (in linewidth) of the top nut
field $nw;			# extra width for the top nut, pt
field $vc;			# cells, vertical
field $strings;			# number of strings
field $hc;			# cells, horizontal (= strings)
field $dot;			# dot size, fraction of cell width
field $bsz;			# barre size, fraction of dot
field $bstyle;			# barre style ("line", "arc")
field $fsh;			# show fingers (0, 1, "below")
field $fg;			# foreground color
field $bg;			# background color
field $fbp;			# fret base position ("left", "right")
field $fbt;			# fret base text ("%s" is default)

ADJUST {
    $config	  = $::config;
    $ps		  = $pr->{ps};
    $strings	  = $config->diagram_strings;
    my $ctl	  = $ps->{diagrams};
    $gw		  = $ctl->{width} || 6;
    $gh		  = $ctl->{height} || 6;

lib/ChordPro/Output/PDF/StringDiagram.pm  view on Meta::CPAN

# finger/fret positions, open and muted string indicators.
# The bounding box includes space form the open and muted string indicators
# and dots on the first and last strings, even when absent.
# The bbox includes basefret and fingers (below) if present.
# Origin is top left of the grid.
# Note that the chord name is not part of the diagram.

method diagram_xo( $info ) {
    return unless $info;
    $fg = $info->{diagram} // $config->{pdf}->{theme}->{foreground};
    $bg = $config->{pdf}->{theme}->{background};

    # Set default options for safety if they have not already been set
    $fg = "black" if $fg eq "none";
    $bg = "white" if $bg eq "none";

    my $x = 0;
    my $w = $gw * ($strings - 1);
    my $baselabeloffset = $info->{baselabeloffset} || 0;
    my $basefretno = $info->{base} + $baselabeloffset;
    my $basefrettext="";	# for base label

lib/ChordPro/Output/PDF/StringDiagram.pm  view on Meta::CPAN

    # Color of the dots and numbers.
    my $fbg = "";		# numbers
    my $ffg = $fg;		# dots
    # The numbercolor property of the chordfingers is used for the
    # color of the dot numbers.
    my $fcf = $ps->{fonts}->{chordfingers};
    $fbg = $pr->_bgcolor($fcf->{numbercolor});
    $ffg = $pr->_bgcolor($fcf->{color});

    if ( $fsh ne "below" ) {
        # However, if none we should really use "background" color.
        $fbg = $bg if $fbg eq "none";
    }
    else {
        # However, for "below" case if none or numbercolor equals background color we should really use "foreground".
        $fbg = $fg if ( $fbg eq "none") || ( $fbg eq $bg );
    }

    $x = -$gw;
    for my $sx ( 0 .. $strings-1 ) {
	$x += $gw;
	my $fret = $info->{frets}->[$sx];
	my $fing = -1;
	$fing = $fingers->[$sx] // -1 if $fingers;

lib/ChordPro/Output/PDF/Writer.pm  view on Meta::CPAN

    }

    return ( $text, $ex );
}

sub _fgcolor {
    my ( $self, $col ) = @_;
    if ( !defined($col) || $col =~ /^foreground(?:-medium|-light)?$/ ) {
	$col = $self->{ps}->{theme}->{$col//"foreground"};
    }
    elsif ( $col eq "background" ) {
	$col = $self->{ps}->{theme}->{background};
    }
    elsif ( !$col ) {
	Carp::confess("Undefined fgcolor: $col");
    }
    $col;
}

sub _bgcolor {
    my ( $self, $col ) = @_;
    if ( !defined($col) || $col eq "background" ) {
	$col = $self->{ps}->{theme}->{background};
    }
    elsif ( $col =~ /^foreground(?:-medium|-light)?$/ ) {
	$col = $self->{ps}->{theme}->{$col};
    }
    elsif ( !$col ) {
	Carp::confess("Undefined bgcolor: $col");
    }
    $col;
}

lib/ChordPro/Output/PDF/Writer.pm  view on Meta::CPAN

	    next unless $_->{type} eq "text";
	    $_->{text} =~ s/\'/\x{2019}/g;	# friendly quote
	}
    }
    $y -= $self->{layout}->get_baseline;
    $self->{layout}->show( $x, $y, $self->{pdftext} );

    my $e = $self->{layout}->get_pixel_extents;
    $e->{y} += $e->{height};

    # Handle decorations (background, box).
    my $bgcol = $self->_bgcolor($font->{background});
    undef $bgcol if $bgcol && $bgcol =~ /^no(?:ne)?$/i;
    my $debug = $ENV{CHORDPRO_DEBUG_TEXT} ? "magenta" : undef;
    my $frame = $font->{frame} || $debug;
    undef $frame if $frame && $frame =~ /^no(?:ne)?$/i;
    if ( $bgcol || $frame ) {
	printf("BB: %.2f %.2f %.2f %.2f\n", @{$e}{qw( x y width height ) } )
	  if $debug;
	# Draw background and.or frame.
	my $d = $debug ? 0 : 1;
	$frame = $debug || $font->{color} || $self->{ps}->{theme}->{foreground} if $frame;
	$self->rectxy( $x + $e->{x} - $d,
		       $y + $e->{y} + $d,
		       $x + $e->{x} + $e->{width} + $d,
		       $y + $e->{y} - $e->{height} - $d,
		       0.5, $bgcol, $frame);
    }

    $x += $e->{width};

lib/ChordPro/Output/PDF/Writer.pm  view on Meta::CPAN

    # PDF::API2 says $page must refer to an existing page.
    # Set to 0 to append.
    $page = 0 if $page == $self->{pdf}->pages + 1;

    $self->{pdfpage} = $self->{pdf}->page($page);
    $self->{pdfpage}->mediabox( $ps->{papersize}->[0],
				$ps->{papersize}->[1] );

    $self->{pdfgfx}  = $self->{pdfpage}->gfx;
    $self->{pdftext} = $self->{pdfpage}->text;
    unless ($ps->{theme}->{background} =~ /^white|none|#ffffff$/i ) {
	for ( $self->{pdfgfx} ) {
	    $_->save;
	    $_->fillcolor( $ps->{theme}->{background} );
	    $_->linewidth(0);
	    $_->rectxy( 0, 0, $ps->{papersize}->[0],
			$ps->{papersize}->[1] );
	    $_->fill;
	    $_->restore;
	}
    }
}

# Align.

lib/ChordPro/Output/PDF/Writer.pm  view on Meta::CPAN

    # Only align to odd pages.
    return 0 if $even xor is_odd($page);	# already odd/even
    return 0 unless $pagectrl->{dual_pages};	# no alignment
    return 0 unless $pagectrl->{align_songs};	# no alignment

    use List::Util 'shuffle';
    my $ps = $self->{ps};
    my $bg;
    my $ffile;
    my $filler;
    if ( ($bg = $ps->{formats}->{filler}->{background})
	 &&
	 ( $ffile = expand_tilde($bg) )
	 &&
	 ( $filler = $self->{pdfapi}->open($ffile) )
       ) {
	state $file = "";
	state @pages;
	if ( $file ne $ffile || !@pages ) {
	    $file = $ffile;
	    # Try to make it reproducible.

lib/ChordPro/Wx/Editor.pm  view on Meta::CPAN


    return $self;
}

sub refresh( $self, $prefs = undef ) {
    my $ctrl = $self;
    $prefs //= \%preferences;

    my $mod = $self->IsModified;

    # TextCtrl only supports background colour and font.
    my $theme = $prefs->{editortheme};
    my $c = $prefs->{editcolour}{$theme};
    my $bgcol = Wx::Colour->new( $c->{bg} );
    my $fgcol = Wx::Colour->new( $c->{fg} );
    $ctrl->SetBackgroundColour($bgcol);
    $ctrl->SetStyle( 0, $ctrl->GetLastPosition,
		     Wx::TextAttr->new( $fgcol, $bgcol ) );
    $ctrl->SetFont( Wx::Font->new($prefs->{editfont}) );

    $ctrl->SetModified($mod);

lib/ChordPro/Wx/Main.wxg  view on Meta::CPAN

                                                                <object class="wxPanel" name="p_create" base="EditPanel">
                                                                    <tooltip>Open or create songs and songbooks</tooltip>
                                                                    <style>wxTAB_TRAVERSAL</style>
                                                                    <object class="wxBoxSizer" name="sizer_3" base="EditBoxSizer">
                                                                        <orient>wxVERTICAL</orient>
                                                                        <object class="sizeritem">
                                                                            <option>0</option>
                                                                            <border>0</border>
                                                                            <flag>wxEXPAND</flag>
                                                                            <object class="wxPanel" name="pn_new" base="EditPanel">
                                                                                <background>wxSYS_COLOUR_BTNHIGHLIGHT</background>
                                                                                <tooltip>Create a new song</tooltip>
                                                                                <style>wxBORDER_THEME</style>
                                                                                <object class="wxBoxSizer" name="sizer_12" base="EditBoxSizer">
                                                                                    <orient>wxHORIZONTAL</orient>
                                                                                    <object class="sizeritem">
                                                                                        <option>0</option>
                                                                                        <border>10</border>
                                                                                        <flag>wxALL|wxALIGN_CENTER_VERTICAL</flag>
                                                                                        <object class="wxStaticBitmap" name="bitmap_7" base="EditStaticBitmap">
                                                                                            <bitmap>/usr/local/src/ChordPro/lib/ChordPro/res/icons/wx-main-new-doc.png</bitmap>

lib/ChordPro/Wx/Main.wxg  view on Meta::CPAN

                                                                            <object class="spacer" name="spacer" base="EditSpacer">
                                                                                <width>1</width>
                                                                                <height>5</height>
                                                                            </object>
                                                                        </object>
                                                                        <object class="sizeritem">
                                                                            <option>0</option>
                                                                            <border>0</border>
                                                                            <flag>wxEXPAND</flag>
                                                                            <object class="wxPanel" name="pn_open" base="EditPanel">
                                                                                <background>wxSYS_COLOUR_BTNHIGHLIGHT</background>
                                                                                <tooltip>Open an existing song</tooltip>
                                                                                <style>wxBORDER_THEME</style>
                                                                                <object class="wxBoxSizer" name="sizer_20" base="EditBoxSizer">
                                                                                    <orient>wxHORIZONTAL</orient>
                                                                                    <object class="sizeritem">
                                                                                        <option>0</option>
                                                                                        <border>10</border>
                                                                                        <flag>wxALL</flag>
                                                                                        <object class="wxStaticBitmap" name="bitmap_8" base="EditStaticBitmap">
                                                                                            <bitmap>/usr/local/src/ChordPro/lib/ChordPro/res/icons/wx-main-existing-doc.png</bitmap>

lib/ChordPro/Wx/Main.wxg  view on Meta::CPAN

                                                                            <object class="spacer" name="spacer" base="EditSpacer">
                                                                                <width>1</width>
                                                                                <height>5</height>
                                                                            </object>
                                                                        </object>
                                                                        <object class="sizeritem">
                                                                            <option>0</option>
                                                                            <border>10</border>
                                                                            <flag>wxEXPAND</flag>
                                                                            <object class="wxPanel" name="pn_sbexport" base="EditPanel">
                                                                                <background>wxSYS_COLOUR_BTNHIGHLIGHT</background>
                                                                                <tooltip>Create a song book</tooltip>
                                                                                <style>wxBORDER_THEME</style>
                                                                                <object class="wxBoxSizer" name="sizer_21" base="EditBoxSizer">
                                                                                    <orient>wxHORIZONTAL</orient>
                                                                                    <object class="sizeritem">
                                                                                        <option>0</option>
                                                                                        <border>10</border>
                                                                                        <flag>wxALL</flag>
                                                                                        <object class="wxStaticBitmap" name="bitmap_9" base="EditStaticBitmap">
                                                                                            <bitmap>/usr/local/src/ChordPro/lib/ChordPro/res/icons/wx-main-book.png</bitmap>

lib/ChordPro/Wx/Main.wxg  view on Meta::CPAN

                                                                            <object class="spacer" name="spacer" base="EditSpacer">
                                                                                <width>1</width>
                                                                                <height>5</height>
                                                                            </object>
                                                                        </object>
                                                                        <object class="sizeritem">
                                                                            <option>0</option>
                                                                            <border>0</border>
                                                                            <flag>wxEXPAND</flag>
                                                                            <object class="wxPanel" name="pn_example" base="EditPanel">
                                                                                <background>wxSYS_COLOUR_BTNHIGHLIGHT</background>
                                                                                <tooltip>Open an example song</tooltip>
                                                                                <style>wxBORDER_THEME</style>
                                                                                <object class="wxBoxSizer" name="sizer_22" base="EditBoxSizer">
                                                                                    <orient>wxHORIZONTAL</orient>
                                                                                    <object class="sizeritem">
                                                                                        <option>0</option>
                                                                                        <border>10</border>
                                                                                        <flag>wxALL</flag>
                                                                                        <object class="wxStaticBitmap" name="bitmap_10" base="EditStaticBitmap">
                                                                                            <bitmap>/usr/local/src/ChordPro/lib/ChordPro/res/icons/wx-main-sample-doc.png</bitmap>

lib/ChordPro/Wx/Main.wxg  view on Meta::CPAN

                                                            <object class="spacer" name="spacer" base="EditSpacer">
                                                                <width>1</width>
                                                                <height>10</height>
                                                            </object>
                                                        </object>
                                                        <object class="sizeritem">
                                                            <option>0</option>
                                                            <border>0</border>
                                                            <flag>wxEXPAND</flag>
                                                            <object class="wxPanel" name="pn_site" base="EditPanel">
                                                                <background>wxSYS_COLOUR_BTNHIGHLIGHT</background>
                                                                <tooltip>Visit the ChordPro site</tooltip>
                                                                <style>wxBORDER_THEME</style>
                                                                <object class="wxBoxSizer" name="sizer_18" base="EditBoxSizer">
                                                                    <orient>wxHORIZONTAL</orient>
                                                                    <object class="sizeritem">
                                                                        <option>0</option>
                                                                        <border>10</border>
                                                                        <flag>wxALL</flag>
                                                                        <object class="wxStaticBitmap" name="bitmap_5" base="EditStaticBitmap">
                                                                            <bitmap>/usr/local/src/ChordPro/lib/ChordPro/res/icons/wx-main-website.png</bitmap>

lib/ChordPro/Wx/Main.wxg  view on Meta::CPAN

                                                            <object class="spacer" name="spacer" base="EditSpacer">
                                                                <width>1</width>
                                                                <height>5</height>
                                                            </object>
                                                        </object>
                                                        <object class="sizeritem">
                                                            <option>0</option>
                                                            <border>0</border>
                                                            <flag>wxEXPAND</flag>
                                                            <object class="wxPanel" name="pn_help" base="EditPanel">
                                                                <background>wxSYS_COLOUR_BTNHIGHLIGHT</background>
                                                                <tooltip>Read the documentation</tooltip>
                                                                <style>wxBORDER_THEME</style>
                                                                <object class="wxBoxSizer" name="sizer_19" base="EditBoxSizer">
                                                                    <orient>wxHORIZONTAL</orient>
                                                                    <object class="sizeritem">
                                                                        <option>0</option>
                                                                        <border>10</border>
                                                                        <flag>wxALL</flag>
                                                                        <object class="wxStaticBitmap" name="bitmap_6" base="EditStaticBitmap">
                                                                            <bitmap>/usr/local/src/ChordPro/lib/ChordPro/res/icons/wx-main-documentation.png</bitmap>

lib/ChordPro/lib/Data/Printer/Theme/Zellner.pm  view on Meta::CPAN

or

    use DDP theme => 'Zellner';

or

    $ perl -MDDP=theme,Zellner -wE 'my $x = "string"; p $x'

=head1 DESCRIPTION

This theme for L<Data::Printer> is for people who use a I<light> background in
their terminal. It is based on L<vim(1)>s B<Zellner> colorscheme.

=head2 colors

        array       => '#ff0000',    # array index numbers
        number      => '#870000',    # numbers
        string      => '#ff00ff',    # strings
        class       => '#000087',    # class names
        method      => '#a52a2a',    # method names
        undef       => '#a9a9a9',    # the 'undef' value

lib/ChordPro/lib/SVGPDF.pm  view on Meta::CPAN

      ( (( $width/$height) / ($vwidth/$vheight) > 1.05)
	|| (( $width/$height) / ($vwidth/$vheight) < 0.95) );

    # Get llx lly urx ury bounding box rectangle.
    @bb = $self->vb2bb(@vb);
    $self->_dbg( "vb $vbox => bb %.2f %.2f %.2f %.2f", @bb );
    warn( sprintf("vb $vbox => bb %.2f %.2f %.2f %.2f\n", @bb ))
      if $verbose && !$debug;
    $xo->bbox(@bb);

    if ( my $c = $style->{"background-color"} ) {
	if ( $c ne "none" ) {
	    $xo->fill_color($c);
	    $xo->rectangle(@bb);
	    $xo->fill;
	}
    }

    # Set up result forms.
    $xoforms->[-1] =
      { xo      => $xo,

lib/ChordPro/lib/SVGPDF/CSS.pm  view on Meta::CPAN

field $ctx    :accessor;
field @stack;
field $ffam   :accessor;

BUILD {
    $css = {};
    $base =
	{ 'font-family'		    => 'serif',
	  'font-size'		    => '10',
	  'color'		    => 'black',
	  'background-color'	    => 'none',
	  'fill'		    => 'currentColor',
	  'stroke'		    => 'none',
	  'line-width'		    => 1,
	};
    $ctx = {};
    $ffam = [];
    $self->push( @_ ) if @_;
}

# Parse a string with one or more styles. Augments.

lib/ChordPro/res/abc/abc2svg/README.md  view on Meta::CPAN

	When using &lt;script&gt;, it is possible to set abc2svg parameters via CSS.
  For that, the &lt;style&gt; in the HTML &lt;head&gt; may contain custom
  properties (properties starting with '--') and these properties are converted
  to abc2svg parameters (starting with '%%') before the ABC sequence.  
  For instance, in the (&lt;head&gt;) &lt;style&gt; element, you can put:  
  `        .parm {--pagewidth:30cm;  --bgcolor : yellow}`

	and in some &lt;script ..vnd.abc..&gt;, you set the class:  
  `        <script class="parm" type="text/vnd.abc">`

	This defines the page width and the background color of the generated music.

	See the
  [%%beginml documentation](http://moinejf.free.fr/abcm2ps-doc/beginml.html)
  for an example, and here is [how to put inline music in HTML][15].   
  Playing and highlighting the played notes may be offered loading
  the script `snd-1.js` (see below).

[15]: http://moinejf.free.fr/abcm2ps-doc/inline.html "abc2svg - inline music"

    This script also accepts a parameter `with_source`.

lib/ChordPro/res/config/chordii.json  view on Meta::CPAN

  // `fonts` maps output elements to fonts as defined in `fontconfig`.
  fonts {

    // The font used for page titles.
    title : "Times-Roman 17"

    // The font used for chords above the lyrics.
    chord : "Helvetica-Oblique 9"

    // The font used for comments. If not set, falls back on the `text` font.
    comment: "Times-Roman 12; background=foreground-light"

    // The font used for the table of contents. If not set, falls back on the `text` font.
    toc: "Times-Roman 12"
  }
}

lib/ChordPro/res/config/chordpro.json  view on Meta::CPAN

{"$schema":"https://chordpro.org/beta/resources/config.schema","a2crd":{"classifier":"pct_chords","infer-titles":true,"tabstop":8},"assets":{},"chord-formats":{"common":"%{root|%{}%{qual|%{}}%{ext|%{}}%{bass|/%{}}|%{name}}","nashville":"%{root|%{}%{q...

lib/ChordPro/res/config/chordpro.rjson  view on Meta::CPAN

    }

    // Output paper size.
    // The size can be specified either as the name of a known page size, e.g. `"a4`", or as a 2-element list containing the width and height of the page in PDF units (DTP points, pt, 1/72 inch).
    papersize : a4

    // For future use.
    page_layout : false

    // Theme
    // These settings can be used to control the foreground and background colours of the PDF output.
    // Valid values include colour names, full hex strings (`"#555555"`), or `"none"`.
    // Background `"none"` or `"white"` means there will be no background colour added to the output.
    // It may be useful to put your theme settings in a separate config file, together with additional settings that make up the theme.
    // Other configuration settings that use colours can use `foreground`, `foreground-light`, `foreground-medium`, and `background` to refer to the colours defined in the theme.
    theme {

        // Foreground colour. Usually black.
        foreground : black

        // Light foreground colour
        foreground-medium : grey70

        // Very light foreground colour
        foreground-light : grey90

        // Background colour. Usually white.
        background : none
    }

    // Distance between columns in multi-column mode.
    // When output is produced in multiple columns, this is the space between the columns, in pt.
    columnspace : 20

    // Page top margin, excluding `headspace`.
    margintop : 80

    // Page bottom margin, excluding `footspace`.

lib/ChordPro/res/config/chordpro.rjson  view on Meta::CPAN

        cover : false

        // PDF file to add as front matter.
        front-matter : false

        // PDF file to add as back matter.
        back-matter : false
    }

    // Page formats.
    // Each of these page classes can have settings for a page title, subtitle, footer, and background. The settings inherit from `default` to `title` to `first`. So a `title` page has everything a `default` page has, and a `first` page has everythin...
    // All heading strings may contain references to metadata in the form %{name}, for example %{title}. The current page number can be obtained with %{page}, and the song index in the songbook with %{songindex}. For a complete description on how to ...
    // When even/odd page printing is selected, the left and right parts are swapped on even pages.
    // By default, the "title" element shows the value of metadata item "title", centered on the page. Likewise "subtitle".
    // NOTE: The "title" and "subtitle" page elements have the same names as the default metadata values which may be confusing. To show metadata item, e.g. "artist", add its value to one of the title/subtitle fields. Don't try to add an artist page ...
    formats {

        // Headers/footers/background for all pages that aren't first page of the output, of a song, or alignment pages.
        default {

            // Topmost title element.
            // It uses the `fonts.title` font.
            title : [ "" "" "" ]

            // Second title element.
            // It uses the `fonts.subtitle` font.
            subtitle : [ "" "" "" ]

            // It uses the `fonts.footer` font.
            footer : [ "%{title}" "" "%{page}" ]

            // Page background.
            // This can be used to designate an existing PDF document to be used as the background of the output page. It has the form `filename` or `filename:page`. Page numbers count from one.
            // If odd/even printing is in effect, the designated page number is used for left pages, and the next page (if it exists) for right pages.
            background : ""
        }

        // Headers/footers/background for the first page of a song.
        title {

            // Topmost title element.
            // It uses the `fonts.title` font.
            title : [ "" "%{title}" "" ]

            // Second title element.
            // It uses the `fonts.subtitle` font.
            subtitle : [ "" "%{subtitle}" "" ]

            // It uses the `fonts.footer` font.
            footer : [ "" "" "%{page}" ]

            // Page background.
            // This can be used to designate an existing PDF document to be used as the background of the output page. It has the form `filename` or `filename:page`. Page numbers count from one.
            // If odd/even printing is in effect, the designated page number is used for left pages, and the next page (if it exists) for right pages.
            background : ""
        }

        // Headers/footers/background for the vefy first page of the output.
        first {

            // It uses the `fonts.footer` font.
            footer : [ "" "" "" ]

            // Page background.
            // This can be used to designate an existing PDF document to be used as the background of the output page. It has the form `filename` or `filename:page`. Page numbers count from one.
            // If odd/even printing is in effect, the designated page number is used for left pages, and the next page (if it exists) for right pages.
            background : ""
        }

        // Headers/footers/background for all pages for alignment.
        filler.background : ""
    }

    // Split marker for syllables that are smaller than chord width.
    // `split-marker` is a 3-part array: `start`, `repeat`, and `final`, or can be a single string representing `start`.
    // `final` is always printed, last.
    // `start` is printed if there is enough room.
    // `repeat` is printed repeatedly to fill the rest.
    // If `split-marker` is a single string, this is `start`.
    // All elements may be left empty strings.
    split-marker : [ "" "" "" ]

lib/ChordPro/res/config/chordpro.rjson  view on Meta::CPAN

        // The font used for lyrics texts.
        text : "Times-Roman 12"

        // The font used for chords above the lyrics.
        chord : "Helvetica-Oblique 10"

        // Font for numbers in chord diagram dots.
        // `color` is for the numbers.
        // `numbercolor` is for the dots.
        // `size` doesn't matter unless `diagrams.fingers` = `"below"`.
        chordfingers : "sans; numbercolor=background"

        // The font used for comments. If not set, falls back on the `text` font.
        comment : "Helvetica 12; background=foreground-light"

        // The font used for `comment_italic` directives. If not set, falls back on the `chord` font.
        comment_italic : "Helvetica-Oblique 12"

        // The font used for `comment_box` directives. If not set, falls back on the `chord` font.
        comment_box : "Helvetica 12; frame=1"

        // The font used for the contents of tab environments.
        tab : "Courier 10"

lib/ChordPro/res/config/config.schema  view on Meta::CPAN

        }
      }
    },
    "themeColor": {
      "type": "string",
      "description": "Names of colours in theme.",
      "enum": [
        "foreground",
        "foreground-medium",
        "foreground-light",
        "background"
      ]
    },
    "colorspec": {
      "title": "Colour specification.",
      "type": "string",
      "oneOf": [
        {
          "description": "Hex colour",
          "pattern": "^#[0-9A-Fa-f]{6}$",
          "format": "color",

lib/ChordPro/res/config/config.schema  view on Meta::CPAN

          "description": "Topmost title element.\nIt uses the `fonts.title` font."
        },
        "subtitle": {
          "$ref": "#/definitions/tptspec",
          "description": "Second title element.\nIt uses the `fonts.subtitle` font."
        },
        "footer": {
          "$ref": "#/definitions/tptspec",
          "description": "It uses the `fonts.footer` font."
        },
        "background": {
          "type": "string",
          "description": "Page background.\nThis can be used to designate an existing PDF document to be used as the background of the output page. It has the form `filename` or `filename:page`. Page numbers count from one.\nIf odd/even printing is i...
          "examples": ["examples/bgdemo.pdf", "examples/bgdemo.pdf:5"]
        }
      }
    },
    "fontConfigFont": {
      "type": "object",
      "additionalProperties": false,
      "required": [""],
      "properties": {
        "": {

lib/ChordPro/res/config/config.schema  view on Meta::CPAN

              "$ref": "#/definitions/fontDescription"
            },
            "size": {
              "type": "number",
              "description": "Font size."
            },
            "color": {
              "$ref": "#/definitions/color",
              "description": "The colour of the font. See [ChordPro Colours](https://www.chordpro.org/chordpro/chordpro-colours/) for details on colours."
            },
            "background": {
              "$ref": "#/definitions/color",
              "description": "Background color for the element."
            },
            "frame": {
              "description": "A boolean value indicating that a frame (box) should be drawn around the text.\nPrimarily used to specify the thickness of a comment box (`comment_box` directive) via the `comment_box` font, but can be used for any font....
              "oneOf": [
                {
                  "type": "boolean"
                },
                {

lib/ChordPro/res/config/config.schema  view on Meta::CPAN

            },
            {
              "required": ["file"]
            }
          ]
        }
      ],
      "examples": [
        {
          "description": "sans 12",
          "background": "foreground-light"
        },
        {
          "description": "sans italic 12",
          "background": "foreground-light"
        }
      ]
    },
    "tptspecArray": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "minItems": 3,
      "maxItems": 3

lib/ChordPro/res/config/config.schema  view on Meta::CPAN

                      "description": "Font for numbers in chord diagram dots.\n`color` is for the numbers.\n`numbercolor` is for the dots.\n`size` doesn't matter unless `diagrams.fingers` = `\"below\"`.",
                      "anyOf": [
                        {
                          "$ref": "#/definitions/fontspec"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "numbercolor": {
                              "$ref": "#/definitions/color",
                              "description": "Finger number colour specification.\nBy default this is the theme background colour. Setting this colour to the foreground colour (`\"foreground\"`) effectively hides the finger numbers.",
                              "default": "foreground"
                            }
                          }
                        }
                      ],
                      "default": {
                        "name": "ZapfDingbats",
                        "size": 10,
                        "numbercolor": "background"
                      }
                    },
                    "comment": {
                      "$ref": "#/definitions/fontspec",
                      "description": "The font used for comments. If not set, falls back on the `text` font.",
                      "default": {
                        "name": "Helvetica",
                        "size": 12
                      },
                      "examples": ["sans 12"]

lib/ChordPro/res/config/config.schema  view on Meta::CPAN

                    }
                  }
                },
                "footspace": {
                  "description": "Space for page footers.",
                  "type": "number",
                  "default": 20,
                  "minimum": 0
                },
                "formats": {
                  "description": "Page formats.\nEach of these page classes can have settings for a page title, subtitle, footer, and background. The settings inherit from `default` to `title` to `first`. So a `title` page has everything a `default` ...
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "default": {
                      "$ref": "#/definitions/pageFormat",
                      "description": "Headers/footers/background for all pages that aren't first page of the output, of a song, or alignment pages.",
                      "default": {
                        "title": "",
                        "subtitle": "",
                        "footer": ["%{title}", "", "%{page}"]
                      }
                    },
                    "title": {
                      "$ref": "#/definitions/pageFormat",
                      "description": "Headers/footers/background for the first page of a song.",
                      "default": {
                        "title": ["", "%{title}", ""],
                        "subtitle": ["", "%{subtitle}", ""],
                        "footer": ["", "", "%{page}"]
                      }
                    },
                    "first": {
                      "$ref": "#/definitions/pageFormat",
                      "description": "Headers/footers/background for the vefy first page of the output.",
                      "default": {
                        "footer": ""
                      }
                    },
                    "filler": {
                      "$ref": "#/definitions/pageFormat",
                      "description": "Headers/footers/background for all pages for alignment.",
                      "default": {
                        "title": "",
                        "subtitle": "",
                        "footer": ""
                      }
                    }
                  },
                  "examples": [
                    {
                      "default": {
                        "title": ["", "", ""],
                        "subtitle": ["", "", ""],
                        "footer": ["%{title}", "", "%{page}"],
                        "background": ""
                      },
                      "title": {
                        "title": ["", "%{title}", ""],
                        "subtitle": ["", "%{subtitle}", ""],
                        "footer": ["", "", "%{page}"],
                        "background": ""
                      },
                      "first": {
                        "footer": ["", "", ""],
                        "background": ""
                      }
                    }
                  ]
                },
                "grids": {
                  "description": "Grid section lines.\nSuppress when `show` is `false`, e.g. for singers.\nEnable by setting the width to the desired width.",
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "cellbar": {

lib/ChordPro/res/config/config.schema  view on Meta::CPAN

                      },
                      "minItems": 3,
                      "maxItems": 3
                    }
                  ],
                  "default": ["", "", ""],
                  "examples": ["", "-"]
                },
                "theme": {
                  "title": "Theme",
                  "description": "These settings can be used to control the foreground and background colours of the PDF output.\nValid values include colour names, full hex strings (`\"#555555\"`), or `\"none\"`.\nBackground `\"none\"` or `\"white\"...
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "foreground": {
                      "$ref": "#/definitions/colorspec",
                      "description": "Foreground colour. Usually black.",
                      "default": "black"
                    },
                    "foreground-medium": {
                      "$ref": "#/definitions/colorspec",
                      "description": "Light foreground colour",
                      "default": "grey70"
                    },
                    "foreground-light": {
                      "$ref": "#/definitions/colorspec",
                      "description": "Very light foreground colour",
                      "default": "grey90"
                    },
                    "background": {
                      "$ref": "#/definitions/colorspec",
                      "description": "Background colour. Usually white.",
                      "default": "none"
                    }
                  }
                },
                "titles-directive-ignore": {
                  "description": "A `{titles: left}` directive may conflict with customized page heading/footer formats. Set this to `true` to have the directive ignores.",
                  "type": "boolean",
                  "default": false

lib/ChordPro/res/config/config.tmpl  view on Meta::CPAN

// Foreground colour. Usually black.
# pdf.theme.foreground : black

// Light foreground colour
# pdf.theme.foreground-medium : grey70

// Very light foreground colour
# pdf.theme.foreground-light : grey90

// Background colour. Usually white.
# pdf.theme.background : none

// Distance between columns in multi-column mode.
# pdf.columnspace : 20

// Page top margin, excluding headspace.
# pdf.margintop : 80

// Page bottom margin, excluding footspace.
# pdf.marginbottom : 40

lib/ChordPro/res/config/config.tmpl  view on Meta::CPAN

# pdf.songbook.cover : false

// PDF file to add as front matter.
# pdf.songbook.front-matter : false

// PDF file to add as back matter.
# pdf.songbook.back-matter : false

// Formats.
// Pages have two title elements and one footer element. They also
// can have a page of an existing PDF file as underlay (background).
// Topmost is "title". It uses the "title" font as defined further below.
// Second is "subtitle". It uses the "subtitle" font.
// The "footer" uses the "footer" font.
// All elements can have three fields, that are placed to the left side,
// centered, and right side of the page.
// The contents of all fields is defined below. You can use metadata
// items in the fields as shown. By default, the "title" element shows the
// value of metadata item "title", centered on the page. Likewise
// "subtitle".
// NOTE: The "title" and "subtitle" page elements have the same names
// as the default metadata values which may be confusing. To show
// metadata item, e.g. "artist", add its value to one of the
// title/subtitle fields. Do not try to add an artist page element.
// 
// The left, center and right parts are for odd pages.
// On even pages, the left and right parts are swapped.
// It is possible to define distinct even page formats with "default-even",
// "title-even" and "first-even".
//    
// When a background document is specified, with odd/even printing,
// the 1st background page is used for left pages and
// the next page (if it exists) for right pages.
// For even/odd printing, the order is reversed.

// By default, a page has:

// Three-part title format specification, left, center, right.
# pdf.formats.default.title : [ "" "" "" ]

// Three-part title format specification, left, center, right.
# pdf.formats.default.subtitle : [ "" "" "" ]

// Three-part title format specification, left, center, right.
# pdf.formats.default.footer : [ "%{title}" "" "%{page}" ]

// Background page.
# pdf.formats.default.background : ""

// The first page of a song has:

// Three-part title format specification, left, center, right.
# pdf.formats.title.title : [ "" "%{title}" "" ]

// Three-part title format specification, left, center, right.
# pdf.formats.title.subtitle : [ "" "%{subtitle}" "" ]

// Three-part title format specification, left, center, right.
# pdf.formats.title.footer : [ "" "" "%{page}" ]

// Background page.
# pdf.formats.title.background : ""

// The very first output page is slightly different:

// Three-part title format specification, left, center, right.
# pdf.formats.first.footer : [ "" "" "" ]

// Background page.
# pdf.formats.first.background : ""

// Filler pages (for alignment) are empty by default.

// Background page.
# pdf.formats.filler.background : ""

// Split marker for syllables that are smaller than chord width.
// split-marker is a 3-part array: "start", "repeat", and "final".
// "final" is always printed, last.
// "start" is printed if there is enough room.
// "repeat" is printed repeatedly to fill the rest.
// If split-marker is a single string, this is "start".
// All elements may be left empty strings.
# pdf.split-marker : [ "" "" "" ]

lib/ChordPro/res/config/config.tmpl  view on Meta::CPAN

# pdf.fontconfig.muse.bold       : MuseJazzText.otf
# pdf.fontconfig.muse.italic     : MuseJazzText.otf
# pdf.fontconfig.muse.bolditalic : MuseJazzText.otf

# pdf.fontconfig.musejazztext.           : MuseJazzText.otf
# pdf.fontconfig.musejazztext.bold       : MuseJazzText.otf
# pdf.fontconfig.musejazztext.italic     : MuseJazzText.otf
# pdf.fontconfig.musejazztext.bolditalic : MuseJazzText.otf

// "fonts" maps output elements to fonts as defined in "fontconfig".
// The elements can have a background colour associated.
// Colours are "#RRGGBB" or predefined names like "black", "white",
// and lots of others.
// NOTE: In the built-in config we use only "name" since that can
// be overruled with user settings.
// 
// Some element mappings can be specified, but need not since
// they default to other elements.
// subtitle       --> text
// chorus         --> text
// comment        --> text

lib/ChordPro/res/config/config.tmpl  view on Meta::CPAN

// Font for typesetting titles.
# pdf.fonts.title : "serif bold 14"

// Font for typesetting lyrics.
# pdf.fonts.text : "serif 12"

// Font for typesetting chord names.
# pdf.fonts.chord : "sans italic 10"

// Colour specification.
# pdf.fonts.chordfingers.numbercolor : background

// Font for typesetting comment text.
# pdf.fonts.comment : "sans 12; background=foreground-light"

// Font for typesetting italised comment text.
# pdf.fonts.comment_italic : "Helvetica-Oblique 12"

// Font for typesetting boxed comment text.
# pdf.fonts.comment_box : "sans 12; frame=1"

// Font for typesetting tabs.
# pdf.fonts.tab : "mono 10"

lib/ChordPro/res/config/dark.json  view on Meta::CPAN

config {
  title       : "Dark Mode"
  type        : stylemod
  description : "Emulation of a dark mode."
}

pdf {
  theme {
    foreground       : white
    foreground-light : #555555
    background       : black
  }
  fonts.chord.color : red
}

lib/ChordPro/res/pod/Config.pod  view on Meta::CPAN

        }
    
        // Output paper size.
        // The size can be specified either as the name of a known page size, e.g. `"a4`", or as a 2-element list containing the width and height of the page in PDF units (DTP points, pt, 1/72 inch).
        papersize : a4
    
        // For future use.
        page_layout : false
    
        // Theme
        // These settings can be used to control the foreground and background colours of the PDF output.
        // Valid values include colour names, full hex strings (`"#555555"`), or `"none"`.
        // Background `"none"` or `"white"` means there will be no background colour added to the output.
        // It may be useful to put your theme settings in a separate config file, together with additional settings that make up the theme.
        // Other configuration settings that use colours can use `foreground`, `foreground-light`, `foreground-medium`, and `background` to refer to the colours defined in the theme.
        theme {
    
            // Foreground colour. Usually black.
            foreground : black
    
            // Light foreground colour
            foreground-medium : grey70
    
            // Very light foreground colour
            foreground-light : grey90
    
            // Background colour. Usually white.
            background : none
        }
    
        // Distance between columns in multi-column mode.
        // When output is produced in multiple columns, this is the space between the columns, in pt.
        columnspace : 20
    
        // Page top margin, excluding `headspace`.
        margintop : 80
    
        // Page bottom margin, excluding `footspace`.

lib/ChordPro/res/pod/Config.pod  view on Meta::CPAN

            cover : false
    
            // PDF file to add as front matter.
            front-matter : false
    
            // PDF file to add as back matter.
            back-matter : false
        }
    
        // Page formats.
        // Each of these page classes can have settings for a page title, subtitle, footer, and background. The settings inherit from `default` to `title` to `first`. So a `title` page has everything a `default` page has, and a `first` page has every...
        // All heading strings may contain references to metadata in the form %{name}, for example %{title}. The current page number can be obtained with %{page}, and the song index in the songbook with %{songindex}. For a complete description on how...
        // When even/odd page printing is selected, the left and right parts are swapped on even pages.
        // By default, the "title" element shows the value of metadata item "title", centered on the page. Likewise "subtitle".
        // NOTE: The "title" and "subtitle" page elements have the same names as the default metadata values which may be confusing. To show metadata item, e.g. "artist", add its value to one of the title/subtitle fields. Don't try to add an artist p...
        formats {
    
            // Headers/footers/background for all pages that aren't first page of the output, of a song, or alignment pages.
            default {
    
                // Topmost title element.
                // It uses the `fonts.title` font.
                title : [ "" "" "" ]
    
                // Second title element.
                // It uses the `fonts.subtitle` font.
                subtitle : [ "" "" "" ]
    
                // It uses the `fonts.footer` font.
                footer : [ "%{title}" "" "%{page}" ]
    
                // Page background.
                // This can be used to designate an existing PDF document to be used as the background of the output page. It has the form `filename` or `filename:page`. Page numbers count from one.
                // If odd/even printing is in effect, the designated page number is used for left pages, and the next page (if it exists) for right pages.
                background : ""
            }
    
            // Headers/footers/background for the first page of a song.
            title {
    
                // Topmost title element.
                // It uses the `fonts.title` font.
                title : [ "" "%{title}" "" ]
    
                // Second title element.
                // It uses the `fonts.subtitle` font.
                subtitle : [ "" "%{subtitle}" "" ]
    
                // It uses the `fonts.footer` font.
                footer : [ "" "" "%{page}" ]
    
                // Page background.
                // This can be used to designate an existing PDF document to be used as the background of the output page. It has the form `filename` or `filename:page`. Page numbers count from one.
                // If odd/even printing is in effect, the designated page number is used for left pages, and the next page (if it exists) for right pages.
                background : ""
            }
    
            // Headers/footers/background for the vefy first page of the output.
            first {
    
                // It uses the `fonts.footer` font.
                footer : [ "" "" "" ]
    
                // Page background.
                // This can be used to designate an existing PDF document to be used as the background of the output page. It has the form `filename` or `filename:page`. Page numbers count from one.
                // If odd/even printing is in effect, the designated page number is used for left pages, and the next page (if it exists) for right pages.
                background : ""
            }
    
            // Headers/footers/background for all pages for alignment.
            filler.background : ""
        }
    
        // Split marker for syllables that are smaller than chord width.
        // `split-marker` is a 3-part array: `start`, `repeat`, and `final`, or can be a single string representing `start`.
        // `final` is always printed, last.
        // `start` is printed if there is enough room.
        // `repeat` is printed repeatedly to fill the rest.
        // If `split-marker` is a single string, this is `start`.
        // All elements may be left empty strings.
        split-marker : [ "" "" "" ]

lib/ChordPro/res/pod/Config.pod  view on Meta::CPAN

            // The font used for lyrics texts.
            text : "Times-Roman 12"
    
            // The font used for chords above the lyrics.
            chord : "Helvetica-Oblique 10"
    
            // Font for numbers in chord diagram dots.
            // `color` is for the numbers.
            // `numbercolor` is for the dots.
            // `size` doesn't matter unless `diagrams.fingers` = `"below"`.
            chordfingers : "sans; numbercolor=background"
    
            // The font used for comments. If not set, falls back on the `text` font.
            comment : "Helvetica 12; background=foreground-light"
    
            // The font used for `comment_italic` directives. If not set, falls back on the `chord` font.
            comment_italic : "Helvetica-Oblique 12"
    
            // The font used for `comment_box` directives. If not set, falls back on the `chord` font.
            comment_box : "Helvetica 12; frame=1"
    
            // The font used for the contents of tab environments.
            tab : "Courier 10"
    

lib/ChordPro/res/styles/chordpro.css  view on Meta::CPAN

table.songline tr.lyrics {
    font-size: 12pt;
}
table.songline td.annotation {
    color: red;
}
table.songline td.indent {
    padding-left: 2em;
}
div.comment span {
    background: #e0e0e0;
}
div.comment_italic span {
    font-style: italic;
}
div.image {
    object-fit: cover;
}
div + div, table + div, div + table {
    margin-top: 15pt;
}

lib/ChordPro/res/templates/comment.tt  view on Meta::CPAN

\begin{tcolorbox}[colback=gray!30,%gray background
                  colframe=black,% black frame colour
                  width=\textwidth-2cm,% Use 5cm total width,
                  arc=3mm, auto outer arc,
                  size=small]
                \chordsoff [% comment %] 
\end{tcolorbox}

t/380_roundtrip.t  view on Meta::CPAN

	  bold        = "Courier-Bold"
	  italic      = "Courier-Italic"
	  bolditalic  = "Courier-BoldItalic"
      }
      dingbats {
	  ""	      = "ZapfDingbats"
      }
  }

  # "fonts" maps output elements to fonts as defined in "fontconfig".
  # The elements can have a background colour associated.
  # Colours are "#RRGGBB" or predefined names like "black", "white"
  # and lots of others.
  # NOTE: In the built-in config we use only "name" since that can
  # be overruled with user settings.

  fonts {
      title {
	  name = "Times-Bold"
	  size = 14
      }

t/380_roundtrip.t  view on Meta::CPAN

	  name = "Helvetica-Oblique"
	  size = 10
      }
      chordfingers {
	  name = "ZapfDingbats"
	  size = 10
      }
      comment {
	  name = "Helvetica"
	  size = 12
	  background = "#E5E5E5"
      }
      comment_italic {
	  name = "Helvetica-Oblique"
	  size = 12
      }
      comment_box {
	  name = "Helvetica"
	  size = 12
	  frame = 1
      }



( run in 1.787 second using v1.01-cache-2.11-cpan-d8267643d1d )