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
#
2d3646
# Copyright (C) 2009, 2010, 2011 The CentOS Project
fa95b1
#
fa95b1
# This program is free software; you can redistribute it and/or modify
fa95b1
# it under the terms of the GNU General Public License as published by
dcd347
# the Free Software Foundation; either version 2 of the License, or (at
dcd347
# your option) any later version.
fa95b1
#
74a058
# This program is distributed in the hope that it will be useful, but
74a058
# 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
dcd347
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
7ac5a5
#
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"
f8ff30
        cli_printMessage "${FUNCDIRNAM}" 'AsToKnowMoreLine'
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
}