Blame Scripts/Functions/Render/render_doSvg.sh

8af4d8
#!/bin/bash
8af4d8
#
ab1d67
# render_doSvg.sh -- This function performs base-rendition
8af4d8
# action for SVG files.
8af4d8
#
8af4d8
# Copyright (C) 2009-2011 Alain Reguera Delgado
8af4d8
# 
8af4d8
# This program is free software; you can redistribute it and/or
8af4d8
# modify it under the terms of the GNU General Public License as
8af4d8
# published by the Free Software Foundation; either version 2 of the
8af4d8
# License, or (at your option) any later version.
8af4d8
# 
8af4d8
# This program is distributed in the hope that it will be useful, but
8af4d8
# WITHOUT ANY WARRANTY; without even the implied warranty of
8af4d8
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
8af4d8
# General Public License for more details.
8af4d8
#
8af4d8
# You should have received a copy of the GNU General Public License
8af4d8
# along with this program; if not, write to the Free Software
8af4d8
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
8af4d8
# USA.
8af4d8
# 
8af4d8
# ----------------------------------------------------------------------
8af4d8
# $Id$
8af4d8
# ----------------------------------------------------------------------
8af4d8
ab1d67
function render_doSvg {
8af4d8
8af4d8
    # Define export id used inside design templates. This value
8af4d8
    # defines the design area we want to export.
8af4d8
    local EXPORTID='CENTOSARTWORK'
8af4d8
8af4d8
    # Check export id inside design templates.
8af4d8
    grep "id=\"$EXPORTID\"" $INSTANCE > /dev/null
8af4d8
    if [[ $? -gt 0 ]];then
8af4d8
        cli_printMessage "`eval_gettext "There is no export id (\\\$EXPORTID) inside \\\$TEMPLATE."`" "AsErrorLine"
8af4d8
        cli_printMessage '-' 'AsSeparatorLine'
8af4d8
        continue
8af4d8
    fi
8af4d8
8af4d8
    # Check existence of external files. Inside design templates and
8af4d8
    # their instances, external files are used to refere the
8af4d8
    # background information required by the design template. If such
8af4d8
    # background information is not available the image is produced
8af4d8
    # without background information. This is something that need to
8af4d8
    # be avoided.
ab1d67
    render_checkSvgAbsref "$INSTANCE"
8af4d8
8af4d8
    # Render template instance using inkscape. Modify the inkscape
8af4d8
    # output to reduce the amount of characters used in description
8af4d8
    # column at final output.
8af4d8
    cli_printMessage "$(inkscape $INSTANCE \
8af4d8
        --export-id=$EXPORTID --export-png=${FILE}.png | sed -r \
8af4d8
        -e "s!Area !`gettext "Area"`: !" \
8af4d8
        -e "s!Background RRGGBBAA:!`gettext "Background"`: RRGGBBAA!" \
8af4d8
        -e "s!Bitmap saved as:!`gettext "Saved as"`:!")" 'AsRegularLine'
8af4d8
 
8af4d8
}