Bake La Salle branding into welcome wallpaper

This commit is contained in:
2026-09-18 15:41:24 -06:00
parent 106be26e7c
commit 80ab99cc8a
6 changed files with 178 additions and 31 deletions
+55 -13
View File
@@ -129,8 +129,8 @@ fi
article_for() {
local value=${1,,}
case "$value" in
sala*|aula*|facultad*|unidad*|biblioteca*|oficina*|coordinación*) printf la ;;
laboratorio*|centro*|edificio*|campus*|taller*|auditorio*) printf el ;;
sala*|facultad*|unidad*|biblioteca*|oficina*|coordinación*) printf la ;;
aula*|laboratorio*|centro*|edificio*|campus*|taller*|auditorio*) printf el ;;
*) printf '' ;;
esac
}
@@ -159,29 +159,60 @@ case "$gender" in
;;
*)
welcome_text='Te damos la bienvenida,'
located_text='Ubicación:'
located_text=''
engineering_lab_text='Acceso al Laboratorio de Cómputo de Ingeniería.'
;;
esac
location_primary=''
location_secondary=''
if [[ -n $location && -n $organizational_unit ]]; then
room_phrase=$(with_article "$location")
room_article=$(article_for "$location")
if [[ -n $gender ]]; then
room_phrase=$(with_article "$location")
location_primary="${located_text} ${room_phrase}"
elif [[ $room_article == el ]]; then
location_primary="Acceso al ${location}"
elif [[ -n $room_article ]]; then
location_primary="Acceso a ${room_article} ${location}"
else
location_primary="Acceso a ${location}"
fi
ou_article=$(article_for "$organizational_unit")
if [[ $ou_article == el ]]; then
ou_phrase="del ${organizational_unit}"
location_secondary="del ${organizational_unit}."
elif [[ -n $ou_article ]]; then
ou_phrase="de ${ou_article} ${organizational_unit}"
location_secondary="de ${ou_article} ${organizational_unit}."
else
ou_phrase="de ${organizational_unit}"
location_secondary="de ${organizational_unit}."
fi
location_text="${located_text} ${room_phrase} ${ou_phrase}."
elif [[ -n $location ]]; then
location_text="${located_text} $(with_article "$location")."
room_article=$(article_for "$location")
if [[ -n $gender ]]; then
location_primary="${located_text} $(with_article "$location")."
elif [[ $room_article == el ]]; then
location_primary="Acceso al ${location}."
elif [[ -n $room_article ]]; then
location_primary="Acceso a ${room_article} ${location}."
else
location_primary="Acceso a ${location}."
fi
elif [[ -n $organizational_unit ]]; then
location_text="${located_text} $(with_article "$organizational_unit")."
ou_article=$(article_for "$organizational_unit")
if [[ -n $gender ]]; then
location_primary="${located_text} $(with_article "$organizational_unit")."
elif [[ $ou_article == el ]]; then
location_primary="Acceso al ${organizational_unit}."
elif [[ -n $ou_article ]]; then
location_primary="Acceso a ${ou_article} ${organizational_unit}."
else
location_primary="Acceso a ${organizational_unit}."
fi
else
location_text=$engineering_lab_text
location_primary=$engineering_lab_text
fi
location_text=$location_primary
[[ -n $location_secondary ]] && location_text+=$'\n'"$location_secondary"
width=1600
height=1000
@@ -202,6 +233,7 @@ scale=$(( height * 100 / 1000 ))
welcome_size=$(( 34 * scale / 100 ))
name_size=$(( 70 * scale / 100 ))
location_size=$(( 27 * scale / 100 ))
location_secondary_size=$(( 20 * scale / 100 ))
panel_width=$(( width * 76 / 100 ))
panel_height=$(( 310 * scale / 100 ))
panel_x1=$(( (width - panel_width) / 2 ))
@@ -232,6 +264,17 @@ if [[ $serif_font == DejaVu-Serif ]] && command -v fc-list >/dev/null 2>&1; then
fi
fi
location_annotations=(
-font "$sans_font" -weight 400 -style Normal -pointsize "$location_size"
-fill '#D3E2FF' -stroke none -annotate "+0+$(( 76 * scale / 100 ))" "$location_primary"
)
if [[ -n $location_secondary ]]; then
location_annotations+=(
-font "$sans_font" -weight 400 -style Normal -pointsize "$location_secondary_size"
-fill '#D3E2FF' -stroke none -annotate "+0+$(( 116 * scale / 100 ))" "$location_secondary"
)
fi
if ! "${image_command[@]}" "$BASE_IMAGE" \
-resize "${width}x${height}^" -gravity center -extent "${width}x${height}" \
-fill 'rgba(0,13,58,0.30)' -draw "rectangle ${panel_x1},${panel_y1} ${panel_x2},${panel_y2}" \
@@ -241,8 +284,7 @@ if ! "${image_command[@]}" "$BASE_IMAGE" \
-annotate "+0-$(( 92 * scale / 100 ))" "$welcome_text" \
-font "$serif_font" -weight 700 -style Italic -pointsize "$name_size" \
-fill white -annotate "+0-$(( 22 * scale / 100 ))" "$display_name" \
-font "$sans_font" -weight 400 -style Normal -pointsize "$location_size" \
-fill '#D3E2FF' -annotate "+0+$(( 88 * scale / 100 ))" "$location_text" \
"${location_annotations[@]}" \
-quality 94 "$output_path" 2>>"$log_path"; then
fail_softly 'ImageMagick could not render the welcome wallpaper.'
fi