From 9b10984628eb72431c3521e90b01deeb80ff7447 Mon Sep 17 00:00:00 2001 From: Luthaf Date: Mon, 26 May 2014 10:58:19 +0100 Subject: [PATCH] Ajout du choix des polices dans le template data --- templates/data.tex | 46 +++++++++++++++++++++++++++ templates/fonts.tex | 75 --------------------------------------------- 2 files changed, 46 insertions(+), 75 deletions(-) delete mode 100644 templates/fonts.tex diff --git a/templates/data.tex b/templates/data.tex index 0d1e166e..2bf1cfb0 100644 --- a/templates/data.tex +++ b/templates/data.tex @@ -21,6 +21,22 @@ { "version":{ "description": {"english": "Version", "french": "Version"}, "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 *) @@ -30,6 +46,36 @@ (* block preambule *) \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 *) (* block preface *) diff --git a/templates/fonts.tex b/templates/fonts.tex deleted file mode 100644 index f25d2924..00000000 --- a/templates/fonts.tex +++ /dev/null @@ -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