Skip to content

Commit

Permalink
porting commit 851 to tag 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
eroux committed Oct 21, 2009
1 parent f43d037 commit d276235
Show file tree
Hide file tree
Showing 5 changed files with 131 additions and 1 deletion.
58 changes: 58 additions & 0 deletions contrib/900_gregorio.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0"?>
<!--
XML file for using gregorio inside scribus.
Copyright (C) 2009 Pierre Couderc <[email protected]>.
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 3 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, see <http://www.gnu.org/licenses/>.
-->
<editorsettings description="gregorio" icon="gregorio.png">
<executable command="gregorio-scribus.pl %dir %file" />
<imagefile extension=".pdf"/>
<highlighter>
<rule name="Command" regex="\\[a-zA-Z@+]+" color="#800000"/>
<rule name="Command argument" regex="\\[a-zA-Z@*]+\{([^\}]+)\}" color="blue"/>
<rule name="Section commands" regex="\\(?:section|subsection|subsubsection|paragraph|subparagraph)(?:[*]?)\{([^\}]+)\}" color="black" bold="true"/>
<rule name="Scribus specials" regex="\$scribus_(.+)\$" color="#FF00FF" minimal="true"/>
<rule name="Comments" regex="(?:(?:^|[^\\])(?:\\\\)*)(%.+)" color="#808080" italic="true"/>
</highlighter>
<empty-frame-text>
\begin{document}
\setspaceafterinitial{1mm plus 0em minus 0em}
\setspacebeforeinitial{1mm plus 0em minus 0em}
\def\greinitialformat#1{{\fontsize{33}{33}\selectfont #1}}
\def\grebiginitialformat#1{{\fontsize{73}{73}\selectfont #1}}
\redlines
%%
(c3) Pó(eh/hi)pu(h)lus(h) Si(hi)on,(hgh.)
</empty-frame-text>
<preamble>
\documentclass[a4paper,$scribus_fontsize$]{extarticle}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[left=0cm,top=0cm,right=0cm,bottom=0cm,nohead,nofoot]{geometry}
\usepackage{gregoriotex}
\usepackage{gregoriosyms}
\usepackage{color}
\title{Scribus-Latex-gregorio-File}
$scribus_font$
$scribus_additionalheaders$
\author{Scribus}
\pagestyle{empty}
\setlength{\textwidth}{$scribus_realwidth$ pt}
</preamble>
<postamble>
</postamble>
</editorsettings>
2 changes: 1 addition & 1 deletion contrib/Makefile.am
Original file line number Diff line number Diff line change
@@ -1 +1 @@
EXTRA_DIST = gprocess gabc.lang gabc.xml gabc.vim README
EXTRA_DIST = gprocess gabc.lang gabc.xml gabc.vim 900_gregorio.xml gregorio-scribus.pl gregorio.png gregorio.scpt pdfLuaLaTeX.engine lamed-dvipdfm.engine README
9 changes: 9 additions & 0 deletions contrib/README
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,12 @@ output format. To set it up, open the Macro Editor in TeXShop. Select New Item,
and call it gregorio (or whatvever you wish). Copy and paste all the text of
gregorio.scpt into the Content window, and click save. To use it, type and save
a gabc file and then just choose the gregorio macro from the menu.

gregorio-scribus.pl, gregorio.png and 900_gregorio.xml are files to use Gregorio
in scribus. In order to use it, copy the .pl file somewhere it can be executed
(like /usr/bin under Unix or or C:\Program Files\Scribus under windows) and the
two other files in the editorconfig folder of scribus
(/usr/share/scribus-ng/editorconfig under debian for example,
or C:\Program Files\Scribus\share\editorconfig under Windows).
After that you can use them by inserting a render frame and using the program
gregorio.
63 changes: 63 additions & 0 deletions contrib/gregorio-scribus.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/usr/bin/perl -w
#
# gregorio-scribus, a script to use gregorio inside scribus.
# Copyright (C) 2009 Pierre Couderc <[email protected]>.
#
# 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 3 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, see <http://www.gnu.org/licenses/>.

use strict;

my $dir = $ARGV[0];
my $file = $ARGV[1];
open(INPUTFILE,"<","$file") || die("Cannot open file $file");
my @raw_data=<INPUTFILE>;
open(TEX,">gregorio-scribus-tmp.tex") || die("Cannot open file gregorio-scribus-tmp.tex");
open(GABC,">gregorio-scribus-tmp-score.gabc") || die("Cannot open file gregorio-scribus-tmp-score.gabc");
foreach my $lineo (@raw_data)
{
if(defined($lineo))
{
my $line = $lineo;
if(substr($lineo,0,1) eq "\\")
{
print TEX $line;
}
else
{
print GABC $line;
}
}
}
print TEX <<EOF;
\\includescore{gregorio-scribus-tmp-score.tex}
\\end{document}
EOF
close TEX;
close GABC;
print 'calling \'gregorio gregorio-scribus-tmp-score.gabc\'\n';
unlink('gregorio-scribus-tmp-score.tex');
system('gregorio gregorio-scribus-tmp-score.gabc');
if( -e 'gregorio-scribus-tmp-score.tex')
{
system('lamed gregorio-scribus-tmp.tex');
print 'calling \'lamed gregorio-scribus-tmp.tex\'\n';
system("dvipdfm $dir/gregorio-scribus-tmp.dvi");
print 'calling \'dvipdfm $dir/gregorio-scribus-tmp.dvi\'\n';
system("mv gregorio-scribus-tmp.pdf $file.pdf");
unlink('gregorio-scribus-tmp-score.gabc');
unlink('gregorio-scribus-tmp-score.tex');
unlink('gregorio-scribus-tmp.tex');
unlink('gregorio-scribus-tmp.dvi');
}
exit;
Binary file added contrib/gregorio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d276235

Please sign in to comment.