Browse Source

Ajout du choix des polices dans le template data

accords
Luthaf 11 years ago
parent
commit
9b10984628
  1. 46
      templates/data.tex
  2. 75
      templates/fonts.tex

46
templates/data.tex

@ -21,6 +21,22 @@
{ {
"version":{ "description": {"english": "Version", "french": "Version"}, "version":{ "description": {"english": "Version", "french": "Version"},
"default": {"default": "3.7.2"} "default": {"default": "3.7.2"}
},
"chordfont":{ "description": {"english": "Chord font",
"french": "Police des accords"},
"default": {"default": "i"}
},
"chordcolor":{ "description": {"english": "Chord color, HTML notation",
"french": "Couleur des accords en notation HTML"},
"default": {"default": "000000"}
},
"versefont":{ "description": {"english": "Verse font",
"french": "Police des couplets"},
"default": {"default": ""}
},
"chorusfont":{ "description": {"english": "Chorus font",
"french": "Police des refrains"},
"default": {"default": "i"}
} }
} }
(* endvariables *) (* endvariables *)
@ -30,6 +46,36 @@
(* block preambule *) (* block preambule *)
\usepackage{licence} \usepackage{licence}
\makeatletter
\renewcommand{\chorusfont}{%
(* for letter in chorusfont *)
(* if letter=="i" *) \it %
(* elif letter=='b' *) \bf %
(* elif letter=='n' *) \normalfont %
(* endif *)
(* endfor *)
}
\def\@chordfont{%
(* for letter in chordfont *)
(* if letter=="i" *) \it %
(* elif letter=='b' *) \bf %
(* elif letter=='n' *) \normalfont %
(* endif *)
(* endfor *)
}
\definecolor{ChordColor}{HTML}{(( chordcolor ))}
\renewcommand{\printchord}[1]{\@chordfont\textcolor{ChordColor}{#1}}
\renewcommand{\lyricfont}{%
(* for letter in versefont *)
(* if letter=="i" *) \it %
(* elif letter=='b' *) \bf %
(* elif letter=='n' *) \normalfont %
(* endif *)
(* endfor *)
}
\makeatother
(* endblock *) (* endblock *)
(* block preface *) (* block preface *)

75
templates/fonts.tex

@ -1,75 +0,0 @@
% Copyright (C) 2014 The Songbook Team
%
% This program is free software; you can redistribute it and/or
% modify it under the terms of the GNU General Public License
% as published by the Free Software Foundation; either version 2
% of the License, or (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program; if not, write to the Free Software
% Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
% MA 02110-1301, USA.
(* variables *)
{
"chordfont":{ "description": {"english": "Chord font",
"french": "Police des accords"},
"default": {"default": "i"}
},
"chordcolor":{ "description": {"english": "Chord color, HTML notation",
"french": "Couleur des accords en notation HTML"},
"default": {"default": "000000"}
},
"versefont":{ "description": {"english": "Verse font",
"french": "Police des couplets"},
"default": {"default": ""}
},
"chorusfont":{ "description": {"english": "Chorus font",
"french": "Police des refrains"},
"default": {"default": "i"}
}
}
(* endvariables *)
% begin document
(* extends "data.tex" *)
(* block preambule *)
(( super() ))
\makeatletter
\renewcommand{\chorusfont}{%
(* for letter in chorusfont *)
(* if letter=="i" *) \it %
(* elif letter=='b' *) \bf %
(* elif letter=='n' *) \normalfont %
(* endif *)
(* endfor *)
}
\def\@chordfont{%
(* for letter in chordfont *)
(* if letter=="i" *) \it %
(* elif letter=='b' *) \bf %
(* elif letter=='n' *) \normalfont %
(* endif *)
(* endfor *)
}
\definecolor{ChordColor}{HTML}{(( chordcolor ))}
\renewcommand{\printchord}[1]{\@chordfont\textcolor{ChordColor}{#1}}
\renewcommand{\lyricfont}{%
(* for letter in versefont *)
(* if letter=="i" *) \it %
(* elif letter=='b' *) \bf %
(* elif letter=='n' *) \normalfont %
(* endif *)
(* endfor *)
}
\makeatother
(* endblock preambule *)
% end document
Loading…
Cancel
Save