Author Topic: Load a custom font?  (Read 14256 times)

mtx

  • Newbie
  • *
  • Posts: 4
    • View Profile
Load a custom font?
« 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)?

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1167
    • View Profile
Re: Load a custom font?
« Reply #1 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.

mtx

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Load a custom font?
« Reply #2 on: August 24, 2016, 07:57:26 PM »

ptiwee

  • Full Member
  • ***
  • Posts: 28
    • View Profile
Re: Load a custom font?
« Reply #3 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".

mtx

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Load a custom font?
« Reply #4 on: August 25, 2016, 06:48:01 AM »
Thanks for clearing that up, ptiwee!

l0ck0

  • Jr. Member
  • **
  • Posts: 21
    • View Profile
Re: Load a custom font?
« Reply #5 on: January 24, 2017, 09:27:04 AM »
because no work
Code: [Select]
listbox.font="[Emulator]";??

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1167
    • View Profile
Re: Load a custom font?
« Reply #6 on: January 24, 2017, 11:54:24 AM »
because no work
Code: [Select]
listbox.font="[Emulator]";??

Magic tokens might now work there.

l0ck0

  • Jr. Member
  • **
  • Posts: 21
    • View Profile
Re: Load a custom font?
« Reply #7 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

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1167
    • View Profile
Re: Load a custom font?
« Reply #8 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?

l0ck0

  • Jr. Member
  • **
  • Posts: 21
    • View Profile
Re: Load a custom font?
« Reply #9 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 :(