Blame Scripts/Bash/Functions/Render/render_doIdentityImageKsplash.sh

4c79b5
#!/bin/bash
4c79b5
#
4c79b5
# render_doIdentityImageKsplash.sh -- This function provides
4c79b5
# post-rendering actions to render KSplash images.
4c79b5
#
4c79b5
# Copyright (C) 2009-2010 Alain Reguera Delgado
4c79b5
# 
4c79b5
# This program is free software; you can redistribute it and/or modify
4c79b5
# it under the terms of the GNU General Public License as published by
4c79b5
# the Free Software Foundation; either version 2 of the License, or
4c79b5
# (at your option) any later version.
4c79b5
# 
4c79b5
# This program is distributed in the hope that it will be useful, but
4c79b5
# WITHOUT ANY WARRANTY; without even the implied warranty of
4c79b5
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4c79b5
# General Public License for more details.
4c79b5
#
4c79b5
# You should have received a copy of the GNU General Public License
4c79b5
# along with this program; if not, write to the Free Software
4c79b5
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
4c79b5
# USA.
4c79b5
# 
4c79b5
# ----------------------------------------------------------------------
4c79b5
# $Id: render_doIdentityImageKsplash.sh 71 2010-09-18 05:41:11Z al $
4c79b5
# ----------------------------------------------------------------------
4c79b5
4c79b5
function render_doIdentityImageKsplash {
4c79b5
4c79b5
    local FILE=$1
4c79b5
4c79b5
    # Define names of files with dynamic store location.
4c79b5
    local KSPLASH_TOP="$(dirname $FILE)/splash_top.png"
4c79b5
    local KSPLASH_PREVIEW="$(dirname $FILE)/Preview.png"
4c79b5
    local KSPLASH_PREVIEW_FONT=/home/centos/artwork/trunk/Identity/Fonts/Ttf/DejaVuLGCSans-Bold.ttf
4c79b5
4c79b5
    # Define relative location to splash_active_bar and splash_bottom
4c79b5
    # images. Since we are building Preview with active and bottom
4c79b5
    # splash only, there is no need to include inactive bar on
4c79b5
    # checking.
4c79b5
    local KSPLASH_ACTIVE_BAR="$OPTIONVAL/splash_active_bar.png"
4c79b5
    local KSPLASH_BOTTOM="$OPTIONVAL/splash_bottom.png"
4c79b5
4c79b5
    # The Preview.png image is produced if the current file being
4c79b5
    # rendered is the splash_top image. The splash_top image is the
4c79b5
    # only file that is rendered for different versions.  The
4c79b5
    # splash_top image is taken as reference to create the whole
4c79b5
    # ksplash image preview.
4c79b5
    if [ ! "$(basename $FILE).png" == "splash_top.png" ];then 
4c79b5
        continue
4c79b5
    fi
4c79b5
4c79b5
    # Check required image files existence.
4c79b5
    cli_checkFiles "$KSPLASH_PREVIEW
4c79b5
                $KSPLASH_ACTIVE_BAR
4c79b5
                $KSPLASH_BOTTOM
4c79b5
                $KSPLASH_PREVIEW_FONT
4c79b5
                " 'f'
4c79b5
4c79b5
    # Create Preview.png image.
4c79b5
    convert -append \
4c79b5
        $KSPLASH_TOP \
4c79b5
        $KSPLASH_ACTIVE_BAR \
4c79b5
        $KSPLASH_BOTTOM \
4c79b5
        $KSPLASH_PREVIEW
4c79b5
4c79b5
    # Add bottom text to Preview.png image. The text position was set
4c79b5
    # inside an image of 400x300 pixels. If you change the final
4c79b5
    # preview image dimension, you need to change the text position
4c79b5
    # too.
4c79b5
    mogrify -draw 'text 6,295 "KDE is up and running."' \
4c79b5
        -fill \#ffffff \
4c79b5
        -font $KSPLASH_PREVIEW_FONT \
4c79b5
        $KSPLASH_PREVIEW
4c79b5
4c79b5
    cli_printMessage "$KSPLASH_PREVIEW" "AsSavedAsLine"
4c79b5
4c79b5
}