Page 1 sur 1

[RESOLU] tis-add-fonts problème

Posté : 19 oct. 2023 - 08:45
par skoizer
Bonjour,
je suis sur wapt 2.4 entreprise

je voudrais utiliser pour installer tis-add-fonts des fonts sur mes pc windows
https://wapt.tranquil.it/store/fr/tis-add-fonts

Code : Tout sélectionner

def install():
    # Declaring local variables
    if iswin64():
        bin_name = "FontReg64.exe"
    else:
        bin_name = "FontReg32.exe"
    fonts_path = os.path.abspath("fonts")
    bin_path = makepath(fonts_path, bin_name)

    # Installing the fonts
    for zip in glob.glob("*.zip"):
        unzip(zip, "fonts", "*.ttf", extract_with_full_paths=False)
    for font in glob.glob(f"{fonts_path}/*.ttf"):
        print("Installing Font: %s" % font.split("\\")[-1])
    run(f'"{bin_path}" /copy')
    print("INFO: The PC must be rebooted for the fonts to appear")
cette ligne de code ne semble pas fonctionné
run(f'"{bin_path}" /copy')
l'exe FontReg64.exe qui est dans fonts/ a dans ce répertoire les *.ttf décompressé
si en ligne de commande je fais un "FontReg64.exe /copy" cela fonctionne mais pas dans le script
une idée

Re: tis-add-fonts probléme

Posté : 19 oct. 2023 - 12:15
par jpele
Bonjour,
Je viens de tester et je n'ai pas de soucis, pouvez-vous nous copier le message d'erreur ?

Cordialement,
Jimmy

Re: tis-add-fonts probléme

Posté : 19 oct. 2023 - 17:08
par skoizer
je n'ai aucune erreur

Code : Tout sélectionner

Ligne de Commande : install "c:\waptdev\tis-add-fonts_2.1.3.0-5_windows_PROD\WAPT\.."
Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
Installing WAPT files c:\waptdev\tis-add-fonts_2.1.3.0-5_windows_PROD
Installing Font: Lato-Regular.ttf
INFO: The PC must be rebooted for the fonts to appear

Results :

 === install packages ===
  c:\waptdev\tis-add-fonts_2.1.3.0-5_windows_PROD | cd12-add-fonts (2.1.3.0-5)
>>> 
reboot
rien dans c:\windows\fonts
dans \fonts\ j'ai bien le fichier ttf

si j'ajoute ceci

Code : Tout sélectionner

    run(f'"{bin_path}" /copy')
    print( "%s /copy" % bin_path)
j'ai bien un c:\waptdev\tisadd-fonts_2.1.3.0-6_windows_PROD\fonts\FontReg64.exe /copy

j'ai egalement essayé avec powershell

Code : Tout sélectionner

run_powershell("%s /copy" % bin_path)

Re: tis-add-fonts probléme

Posté : 25 oct. 2023 - 14:28
par jpele
En effet cela ne fonctionne pas.
Correctif poussé en 2.1.3.0-8
Merci encore pour votre retour, voici le code en attendant :

Code : Tout sélectionner

    # Installing the fonts
    os.chdir(fonts_path)
    run(f'"{bin_name}" /copy')
    print("INFO: The PC must be rebooted for the fonts to appear")