All pastes #430435 Raw Edit

MacNorth

public shellscript v1 · immutable
·published 2007-04-08 23:50 UTC
rendered paste body
# Finish DVD menu entries (all we have so far is text, no buttons!)if test $RES = "dvd"; then    echo "Making the DVD buttons...   "    # Get the dimensions of the button    TILE_WIDTH=$(convert -size 720x200 xc:none -fill white -stroke $BTN_STROKE -strokewidth 1 -pointsize $TITLE_SIZE -font $BUTTON_FONT +antialias -weight bold -annotate +20+80 "$BUTTON_CHAR" -trim +repage info: | awk '{print $3}' | awk -F 'x' '{print $1}')    BUTTON_HEIGHT=$(convert -size 720x200 xc:none -fill white -stroke $BTN_STROKE -strokewidth 1 -pointsize $TITLE_SIZE -font $BUTTON_FONT +antialias -weight bold -annotate +20+80 "$BUTTON_CHAR" -trim +repage info: | awk '{print $3}' | awk -F 'x' '{print $2}')    # Find how much to pad the top of the button and make the pad    let "BUTTON_PADDING=(TILE_HEIGHT-BUTTON_HEIGHT-TITLE_BOTTOM_SPACE)/2"    convert -size ${TILE_WIDTH}x${BUTTON_PADDING} xc:none "$BUTTON_PAD"    # Draw the buttons    convert -size 720x100 xc:none -font $BUTTON_FONT -stroke $BTN_STROKE -strokewidth 1 +antialias -weight bold -fill $HIGHLIGHT_COLOR -pointsize $TITLE_SIZE -annotate +20+80 "$BUTTON_CHAR" -trim +repage "$HIGHLIGHT_BUTTON"    convert -size 720x100 xc:none -font $BUTTON_FONT -stroke $BTN_STROKE -strokewidth 1 +antialias -weight bold -fill $SELECT_COLOR -pointsize $TITLE_SIZE -annotate +20+80 "$BUTTON_CHAR" -trim +repage "$SELECT_BUTTON"    # Pad the buttons so that they line up with the font's baseline    convert -background none "$BUTTON_PAD" "$HIGHLIGHT_BUTTON" -append \        "$HIGHLIGHT_BUTTON"    convert -background none "$BUTTON_PAD" "$SELECT_BUTTON" -append \        "$SELECT_BUTTON"    # Make a blank button tile according to measured dimensions    convert -size ${TILE_WIDTH}x${TILE_HEIGHT} xc:none "$TILE_CANVAS"    # Put padded buttons on the blank tile    composite -compose Over -gravity north "$HIGHLIGHT_BUTTON" \        "$TILE_CANVAS" "$HIGHLIGHT_BUTTON"    composite -compose Over -gravity north "$SELECT_BUTTON" \        "$TILE_CANVAS" "$SELECT_BUTTON"    # A placeholder to space the title text correctly    convert -size $(identify "$HIGHLIGHT_BUTTON" | awk '{print $3}') xc:none \        "$BUTTON_PLACEHOLDER"        # Next, join the button tiles with the title tiles:    i=0    while test $i -lt $NUM_TITLES; do        SEQNUM=$(printf "%02d" $i)        # Text entries        convert -background none "$BUTTON_PLACEHOLDER" \            "$TMP_DIR/00_title-$SEQNUM.png" +append \            "$TMP_DIR/01_entry-$SEQNUM.png"        # Highlight entries        convert -background none "$HIGHLIGHT_BUTTON" \            "$TMP_DIR/00_title-${SEQNUM}_placeholder.png" \            +append "$TMP_DIR/01_highlight_entry-$SEQNUM.png"        # Select entries        convert -background none "$SELECT_BUTTON" \            "$TMP_DIR/00_title-${SEQNUM}_placeholder.png" \            +append "$TMP_DIR/01_select_entry-$SEQNUM.png"        let "i=i+1"    donefi# Stack all 01_entry-N.png linesecho "Creating the text menu...   "convert -background none "$TMP_DIR/01_entry-*.png" -append "$MENU_TEXT"# Stack all DVD button linesif test $RES = "dvd"; thenecho "Creating the DVD button overlays...   "    convert -background none "$TMP_DIR/01_highlight_entry-*.png" -append \        "$HIGHLIGHT_TEXT"    convert -background none "$TMP_DIR/01_select_entry-*.png" -append \        "$SELECT_TEXT"fi