Página 1 de 1

[RESUELTO] Problema de agregar fuentes

Publicado: 19 de octubre de 2023 - 8:45 a. m.
por skoizer
Buen día,
Estoy en Wapt 2.4 Enterprise

Me gustaría usar tis-add-fonts para instalar fuentes en mis PC con Windows
https://wapt.tranquil.it/store/fr/tis-add-fonts

Código: Seleccionar todo

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")
Esta línea de código no parece funcionar
ejecutar(f'"{bin_path}" /copiar')
El archivo FontReg64.exe, ubicado en fonts/, contiene los archivos *.ttf extraídos en ese directorio
Si uso la línea de comando para ejecutar "FontReg64.exe /copy", funciona, pero no en el script
una idea

Re: problema con agregar fuentes

Publicado: 19 de octubre de 2023 - 12:15 p. m.
por jpele
Hola,
acabo de probarlo y no tengo ningún problema. ¿Podrías copiarnos el mensaje de error?

Saludos,
Jimmy

Re: problema con agregar fuentes

Publicado: 19 de octubre de 2023 - 17:08
por skoizer
No tengo errores

Código: Seleccionar todo

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)
>>> 
reiniciar
nada en c:\windows\fonts
Tengo el archivo ttf en \fonts\

Si agrego esto

Código: Seleccionar todo

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

También lo intenté con PowerShell

Código: Seleccionar todo

run_powershell("%s /copy" % bin_path)

Re: problema con agregar fuentes

Publicado: 25 de octubre de 2023 - 14:28
por jpele
En realidad, no funciona.
Corrección extensa en 2.1.3.0-8
Gracias nuevamente por tus comentarios, mientras tanto aquí está el código:

Código: Seleccionar todo

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