From b20cc79b514e2bbe682374d740fdb0458d128046 Mon Sep 17 00:00:00 2001 From: Louis Date: Fri, 6 May 2016 23:09:22 +0200 Subject: [PATCH] [WIP][Image size] Seems to work --- patacrep/data/templates/styles/patacrep.sty | 2 +- test/test_book/datadir.tex.control | 8 +-- test/test_book/syntax.tex.control | 66 ++++++++++++++++-- .../img/{dices.png => image.png} | Bin .../test_book/syntax_datadir/songs/images.csg | 41 ++++++----- 5 files changed, 89 insertions(+), 28 deletions(-) rename test/test_book/syntax_datadir/img/{dices.png => image.png} (100%) diff --git a/patacrep/data/templates/styles/patacrep.sty b/patacrep/data/templates/styles/patacrep.sty index 4fb4b075..4413b996 100644 --- a/patacrep/data/templates/styles/patacrep.sty +++ b/patacrep/data/templates/styles/patacrep.sty @@ -6,8 +6,8 @@ \NeedsTeXFormat{LaTeX2e}[1994/06/01] \ProvidesPackage{patacrep}[2014/06/17 Patacrep Package, version 1] -\RequirePackage{graphicx,xcolor} % \RequirePackage[space]{grffile} +\RequirePackage{graphicx,xcolor} % \RequirePackage{epstopdf} % \RequirePackage{fancybox} \RequirePackage{xstring} diff --git a/test/test_book/datadir.tex.control b/test/test_book/datadir.tex.control index 687a6096..bdc8a210 100644 --- a/test/test_book/datadir.tex.control +++ b/test/test_book/datadir.tex.control @@ -111,7 +111,7 @@ Chordpro}[ \lilypond{scores/datadir.ly} -\image{img/datadir.png} +\image[]{img/datadir.png} \endsong @@ -138,7 +138,7 @@ Chordpro}[ \lilypond{scores/datadir2.ly} -\image{img/datadir2.png} +\image[]{img/datadir2.png} \endsong @@ -165,7 +165,7 @@ Chordpro}[ \lilypond{@TEST_FOLDER@/datadir_datadir/songs/./relative.ly} -\image{@TEST_FOLDER@/datadir_datadir/songs/./relative.png} +\image[]{@TEST_FOLDER@/datadir_datadir/songs/./relative.png} \endsong @@ -192,7 +192,7 @@ Chordpro}[ \lilypond{@TEST_FOLDER@/datadir_datadir/songs/./subdir/subdir.ly} -\image{@TEST_FOLDER@/datadir_datadir/songs/./subdir/subdir.png} +\image[]{@TEST_FOLDER@/datadir_datadir/songs/./subdir/subdir.png} \endsong diff --git a/test/test_book/syntax.tex.control b/test/test_book/syntax.tex.control index f4a8a46f..543a30b5 100644 --- a/test/test_book/syntax.tex.control +++ b/test/test_book/syntax.tex.control @@ -2,8 +2,6 @@ - - %% Automatically generated document. %% You may edit this file but all changes will be overwritten. %% If you want to change this document, have a look at @@ -91,6 +89,66 @@ guitar, \addcontentsline{toc}{section}{\songlistname} \begin{songs}{titleidx,authidx} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% songs/./images.csg + +\selectlanguage{english} + +\beginsong{}[ + by={ + }, +] + + +\image[]{img/image.png} +\image[]{img/image with spaces.png} + + + +\image[scale=.2]{img/image.png} +\image[scale=.20]{img/image with spaces.png} +\image[scale=1.2]{img/image.png} + + + +\image[width=2cm]{img/image.png} +\image[height=2cm]{img/image with spaces.png} +\image[width=2cm, height=1cm]{img/image.png} + + + +\image[width=2em]{img/image.png} +\image[height=2em]{img/image with spaces.png} +\image[width=2em, height=1em]{img/image.png} + + + +\image[width=50pt]{img/image.png} +\image[height=50pt]{img/image with spaces.png} +\image[width=50pt, height=100pt]{img/image.png} + + + +\image[width=2.5cm]{img/image.png} +\image[height=2.5cm]{img/image with spaces.png} +\image[width=2.5cm, height=1.5cm]{img/image.png} + + + +\image[width=3cm, height=10pt]{img/image.png} +\image[width=10pt, height=3cm]{img/image with spaces.png} +\image[]{img/image.png} + + + +\image[]{img/image.png} +\image[]{img/image with spaces.png} +\image[]{img/image with spaces.png} +\image[]{img/image.png} + + +\endsong + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% songs/./musicnote.csg @@ -112,10 +170,6 @@ guitar, \endsong -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% songs/./musicnote.csg -TODO Test image sizes - \end{songs} diff --git a/test/test_book/syntax_datadir/img/dices.png b/test/test_book/syntax_datadir/img/image.png similarity index 100% rename from test/test_book/syntax_datadir/img/dices.png rename to test/test_book/syntax_datadir/img/image.png diff --git a/test/test_book/syntax_datadir/songs/images.csg b/test/test_book/syntax_datadir/songs/images.csg index c5e5d399..8cc3a351 100644 --- a/test/test_book/syntax_datadir/songs/images.csg +++ b/test/test_book/syntax_datadir/songs/images.csg @@ -1,25 +1,32 @@ -TODO Update with test file from test_song -{title : Test of image sizes} - -{image: dices.png} +{image: image.png} {image: "image with spaces.png"} -{image: dices.png size=20%x} -{image: "image with spaces.png" size=x20%} -{image: dices.png size=20%x10%} - -{image: dices.png size=20%x} -{image: "image with spaces.png" size=x20%} -{image: dices.png size=20%x10%} +{image: image.png scale=.2 } +{image: "image with spaces.png" scale=.20} +{image: image.png scale=1.2} -{image: dices.png size=2cmx} +{image: image.png size=2cmx} {image: "image with spaces.png" size=x2cm} -{image: dices.png size=2cmx1cm} +{image: image.png size=2cmx1cm} -{image: dices.png size=2emx} +{image: image.png size=2emx} {image: "image with spaces.png" size=x2em} -{image: dices.png size=2emx1em} +{image: image.png size=2emx1em} -{image: dices.png size=50ptx} +{image: image.png size=50ptx} {image: "image with spaces.png" size=x50pt} -{image: dices.png size=50ptx100pt} +{image: image.png size=50ptx100pt} + +{image: image.png size=2.5cmx} +{image: "image with spaces.png" size=x2.5cm} +{image: image.png size=2.5cmx1.5cm} + +{image: image.png size=3cmx10pt} +{image: "image with spaces.png" size=10ptx3cm} +{image: image.png size=x} + +{image: image.png error=foo} +{image: "image with spaces.png" not_a_size} +{image: "image with spaces.png" too many arguments} +{image: image.png size=2exx3km} +{image: }