Files
local_machine/scripts/games/gog/wine-fonts.sh
ahauimix 1938b7c743 Expand local_machine docs and automation for connectivity, games, and ops.
Add proxy/VPN/telegram launchd and emergency runbooks; reorganize apps docs;
document JA3 CrossOver runbook and Wine troubleshooting; add GOG/HoMM game
scripts, disk cleanup guides, and gitea push-via-proxy helper. Ignore temp/.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-01 08:12:19 +03:00

86 lines
3.6 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# shellcheck shell=bash
# Шрифты для GOG web-installer (.NET). Только macOS + corefonts — без Steam.
gog_wine_install_fonts_mac() {
local fonts="${BOTTLE_DIR}/drive_c/windows/Fonts"
mkdir -p "${fonts}"
for f in /System/Library/Fonts/Supplemental/{Arial,Tahoma,Verdana,"Times New Roman","Courier New","Segoe UI"}.ttf \
/System/Library/Fonts/Supplemental/Arial*.ttf \
/Library/Fonts/Arial*.ttf; do
[[ -f "${f}" ]] && cp -n "${f}" "${fonts}/" 2>/dev/null || true
done
# .NET GenericSansSerif → Microsoft Sans Serif / Arial
cp -n "${fonts}/Arial.ttf" "${fonts}/sans-serif.ttf" 2>/dev/null || true
cp -n "${fonts}/Arial.ttf" "${fonts}/arial.ttf" 2>/dev/null || true
cp -n "${fonts}/Arial.ttf" "${fonts}/micross.ttf" 2>/dev/null || true
cp -n "${fonts}/Arial.ttf" "${fonts}/Microsoft Sans Serif.ttf" 2>/dev/null || true
cp -n "${fonts}/Tahoma.ttf" "${fonts}/tahoma.ttf" 2>/dev/null || true
}
gog_wine_register_font_file() {
local reg_name="$1"
local ttf_file="$2"
export WINEPREFIX="${BOTTLE_DIR}"
"${WINE64}" reg add 'HKLM\Software\Microsoft\Windows NT\CurrentVersion\Fonts' \
/v "${reg_name} (TrueType)" /t REG_SZ /d "${ttf_file}" /f >/dev/null 2>&1 || true
}
gog_wine_register_all_fonts_dir() {
local fonts="${BOTTLE_DIR}/drive_c/windows/Fonts"
local f base reg
for f in "${fonts}"/*; do
[[ -f "${f}" ]] || continue
[[ "${f}" == *.ttf || "${f}" == *.TTF ]] || continue
base="$(basename "${f}")"
reg="${base%.*}"
gog_wine_register_font_file "${reg}" "${base}"
done
}
gog_wine_wineboot_fonts() {
export WINEPREFIX="${BOTTLE_DIR}"
export DYLD_LIBRARY_PATH="${WINE_LIB}:${DYLD_LIBRARY_PATH:-}"
"${WINE64}" wineboot -u 2>/dev/null || true
}
gog_wine_register_fonts_registry() {
export WINEPREFIX="${BOTTLE_DIR}"
local fonts="${BOTTLE_DIR}/drive_c/windows/Fonts"
gog_wine_register_font_file 'Arial' 'arial.ttf'
gog_wine_register_font_file 'Tahoma' 'tahoma.ttf'
gog_wine_register_font_file 'Verdana' 'verdana.ttf'
gog_wine_register_font_file 'Times New Roman' 'Times New Roman.ttf'
gog_wine_register_font_file 'Courier New' 'Courier New.ttf'
gog_wine_register_font_file 'Microsoft Sans Serif' 'micross.ttf'
local sub='HKLM\Software\Microsoft\Windows NT\CurrentVersion\FontSubstitutes'
"${WINE64}" reg add "${sub}" /v 'MS Shell Dlg' /t REG_SZ /d 'Tahoma' /f >/dev/null 2>&1 || true
"${WINE64}" reg add "${sub}" /v 'MS Shell Dlg 2' /t REG_SZ /d 'Tahoma' /f >/dev/null 2>&1 || true
"${WINE64}" reg add "${sub}" /v 'MS Sans Serif' /t REG_SZ /d 'Arial' /f >/dev/null 2>&1 || true
"${WINE64}" reg add "${sub}" /v 'Segoe UI' /t REG_SZ /d 'Tahoma' /f >/dev/null 2>&1 || true
local rep='HKCU\Software\Wine\Fonts\Replacements'
"${WINE64}" reg add "${rep}" /v '@@MS_SHELLDLG' /t REG_SZ /d 'Tahoma' /f >/dev/null 2>&1 || true
"${WINE64}" reg add "${rep}" /v 'MS Shell Dlg' /t REG_SZ /d 'Tahoma' /f >/dev/null 2>&1 || true
"${WINE64}" reg add "${rep}" /v 'Microsoft Sans Serif' /t REG_SZ /d 'Arial' /f >/dev/null 2>&1 || true
"${WINE64}" reg add "${rep}" /v 'SansSerif' /t REG_SZ /d 'Arial' /f >/dev/null 2>&1 || true
"${WINE64}" reg add "${sub}" /v 'SansSerif' /t REG_SZ /d 'Arial' /f >/dev/null 2>&1 || true
gog_wine_register_all_fonts_dir
}
gog_wine_ensure_fonts() {
local rebuild="${1:-0}"
export_wine_env_gog
gog_wine_install_fonts_mac
gog_wine_register_fonts_registry
if [[ "${rebuild}" == "1" ]]; then
echo "wineboot -u (~3060 с)…"
gog_wine_wineboot_fonts
fi
local n
n="$(ls "${BOTTLE_DIR}/drive_c/windows/Fonts" 2>/dev/null | wc -l | tr -d ' ')"
echo "Шрифты (${BOTTLE_NAME}): ${n} файлов"
}