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

4c79b5
#!/bin/bash
4c79b5
#
2c2082
# render_doIdentityImageKsplash.sh -- This function renders 
15b1d2
# KSplash Preview.png image. Use this function as last-rendition
15b1d2
# function to KSplash base-rendition.  
4c79b5
#
9f5f2e
# Copyright (C) 2009-2011 Alain Reguera Delgado
4c79b5
# 
7cd8e9
# This program is free software; you can redistribute it and/or
7cd8e9
# modify it under the terms of the GNU General Public License as
7cd8e9
# published by the Free Software Foundation; either version 2 of the
7cd8e9
# License, or (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
# ----------------------------------------------------------------------
418249
# $Id$
4c79b5
# ----------------------------------------------------------------------
4c79b5
4c79b5
function render_doIdentityImageKsplash {
4c79b5
2c2082
    # Define variables as local to avoid conflicts outside.
2c2082
    local RELDIR=''
2c2082
    local KSPLASH_TOP=''
2c2082
    local KSPLASH_PREVIEW=''
8219f0
    local RELDIRS=$(find $ACTIONVAL -regextype posix-egrep -maxdepth 1 \
558b58
        -type d -regex "^.*/${RELEASE_FORMAT}$" | egrep $FLAG_FILTER)
4c79b5
2c2082
    # Define font file used to render Preview.png bottom text.
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.
8219f0
    local KSPLASH_ACTIVE_BAR="$ACTIONVAL/splash_active_bar.png"
8219f0
    local KSPLASH_BOTTOM="$ACTIONVAL/splash_bottom.png"
4c79b5
2c2082
    # Check existence of non-release-specific required image files.
e4d34a
    cli_checkFiles $KSPLASH_ACTIVE_BAR
e4d34a
    cli_checkFiles $KSPLASH_BOTTOM
e4d34a
    cli_checkFiles $KSPLASH_PREVIEW_FONT
4c79b5
2c2082
    # Look for release specific directories.
2c2082
    for RELDIR in $RELDIRS;do
2c2082
2c2082
        # Define release-specific files.
2c2082
        KSPLASH_TOP="${RELDIR}/splash_top.png"
2c2082
        KSPLASH_PREVIEW="${RELDIR}/Preview.png"
2c2082
2c2082
        # Check existence of release-specific required image files.
2c2082
        cli_checkFiles $KSPLASH_TOP
2c2082
2c2082
        # Create Preview.png image.
2c2082
        convert -append \
2c2082
            $KSPLASH_TOP \
2c2082
            $KSPLASH_ACTIVE_BAR \
2c2082
            $KSPLASH_BOTTOM \
2c2082
            $KSPLASH_PREVIEW
2c2082
2c2082
        # Add bottom text to Preview.png image. The text position was
2c2082
        # set inside an image of 400x300 pixels. If you change the
2c2082
        # final preview image dimension, you need to change the text
2c2082
        # position too.
2c2082
        mogrify -draw 'text 6,295 "KDE is up and running."' \
2c2082
            -fill \#ffffff \
2c2082
            -font $KSPLASH_PREVIEW_FONT \
2c2082
            $KSPLASH_PREVIEW
4c79b5
2c2082
        cli_printMessage "$KSPLASH_PREVIEW" "AsSavedAsLine"
4c79b5
2c2082
    done
4c79b5
15b1d2
    # Output separator line.
15b1d2
    cli_printMessage '-' 'AsSeparatorLine'
ec641d
4c79b5
}