Attract-Mode Support Forum

Attract-Mode Support => Scripting => Topic started by: mtx on August 24, 2016, 01:19:13 PM

Title: Load a custom font?
Post by: mtx on August 24, 2016, 01:19:13 PM
Is there a way to load a ttf or otf for a layout that's not installed in the OS (Windows, OS X, 'nix)?
Title: Re: Load a custom font?
Post by: keilmillerjr on August 24, 2016, 05:22:37 PM
Yes. Refer to the docs. It will load the font from your layouts root directory, or any path you provide.
Title: Re: Load a custom font?
Post by: mtx on August 24, 2016, 07:57:26 PM
Hmmm. I really can't find anything about loading fonts here https://github.com/mickelson/attract/blob/v2.1.0/Layouts.md or here: https://github.com/mickelson/attract/wiki/Introduction-to-Squirrel-Programming
Title: Re: Load a custom font?
Post by: ptiwee on August 24, 2016, 11:23:00 PM
Hi mtx,

You don't need to "load" the font, just place it in your layout folder, then you can change the layout font according to your font name using fe.layout.font = "YourFont".
Title: Re: Load a custom font?
Post by: mtx on August 25, 2016, 06:48:01 AM
Thanks for clearing that up, ptiwee!
Title: Re: Load a custom font?
Post by: l0ck0 on January 24, 2017, 09:27:04 AM
because no work
Code: [Select]
listbox.font="[Emulator]";??
Title: Re: Load a custom font?
Post by: keilmillerjr on January 24, 2017, 11:54:24 AM
because no work
Code: [Select]
listbox.font="[Emulator]";??

Magic tokens might now work there.
Title: Re: Load a custom font?
Post by: l0ck0 on January 24, 2017, 02:02:24 PM
no is for magic token. if put
Code: [Select]
local text = AAE;
listbox.font=AAE;
no work eiter
Title: Re: Load a custom font?
Post by: keilmillerjr on January 24, 2017, 02:10:55 PM
no is for magic token. if put
Code: [Select]
local text = AAE;
listbox.font=AAE;
no work eiter

Have you declared the AAE variable? Or is text a string and you forgot your quotes?
Title: Re: Load a custom font?
Post by: l0ck0 on January 24, 2017, 04:32:51 PM
perdon, no se explicarme en ingles...

tengo una carpeta llamada fuentes donde tengo la fuente AAE.otf

si pongo los codigos

Code: [Select]
listado.font="fuentes/" + "[Emulator]" + ".otf";
listado.font="fuentes/" + "[Emulator]";
listado.font="fuentes/AAE.otf";
listado.font="fuentes/AAE";

local fuente= fe.add_text("fuentes/"+"[Emulator]",0,0,0,0);
listado.font=fuente;

y no se cuantas conbinaciones mas que he intentado esta tarde no he conseguido que me coja la fuente de ninguna forma

si hay espacios o codigo mal puesto puede ser cosa del traductor de google que hace lo que le da la gana. he intentado corregirlo pero igual se me ha colado alguno :(

---------------------------------


Sorry, I will not explain myself in English ...

I have a folder called fonts where I have the source AAE.otf

If I put the codes

Code: [Select]
listado.font = "fuentes/" + "[Emulator]" + ".otf";
listado.font = "fuentes/" + "[Emulator]";
listado.font = "fuentes/AAE.otf";
listado.font = "fuentes/AAE";

Local fuente= fe.add_text ("fuentes/" + "[Emulator]", 0,0,0,0);
listado.font = fuente;

And I do not know how many more combinations I've tried this afternoon I have not managed to get the source in any way

If there are spaces or poorly placed code may be thing of the google translator that does what he wants. I tried to correct it but the same one has sneaked to me :(