Page 1 of 3
Integrate fonts in software
Posted: Sun Nov 18, 2018 4:53 pm
by AlessioForconi
Is it possible to integrate in the stand alone compilation the fotn that I have chosen in the design phase, so that the destination computer will display them even if it has not installed them?
Thanks
Re: Integrate fonts in software
Posted: Sun Nov 18, 2018 5:19 pm
by Klaus
Buonasera Alessio,
do this:
1. Add your Fonts (respect copyrights!) via the "Copy files" tab in the "Standalone Builder Settings"
2. Then you can "start using" them and they will be available while your standalone is running.
3. Add something like this to your "preopenstack" handler
Code: Select all
...
put specialfolderpath("resources") & "/"name_of_font_here.ttf" into tFontFile
start using font file tFontFile
## Do so for every font you have included
if the result <> EMPTY then
answer "Error while loading font:" & CR & the result
end if
## if there is an error -> the result will not be EMPTY
...
4. The font will only be available to your application, unless you add:
Code: Select all
...
start using font file tFontFile globally
...
Best
Klaus
Re: Integrate fonts in software
Posted: Sun Nov 18, 2018 7:15 pm
by richmond62
I recommend you check out revFontLoad
in the Dictionary.
Re: Integrate fonts in software
Posted: Sun Nov 18, 2018 7:25 pm
by Klaus
"revFontLoad" has been deprecated in LC 7 or 8.
You will not find it anymore in the LC 9 dictionary.
Re: Integrate fonts in software
Posted: Sun Nov 18, 2018 7:41 pm
by richmond62
You will not find it anymore in the LC 9 dictionary.
But, on the other hand, one doesn't know which version of LiveCode
AlessioForconi is using.
Re: Integrate fonts in software
Posted: Sun Nov 18, 2018 7:48 pm
by Klaus
"start using font file xxx" has been introduced in LC 6.5, which should cover most "ancient" installations. Your turn!

Re: Integrate fonts in software
Posted: Sun Nov 18, 2018 7:55 pm
by richmond62
That should do, as I assume it is probably a version of the LiveCode series that is being used if not 9.x.
Re: Integrate fonts in software
Posted: Sun Nov 18, 2018 9:04 pm
by bogs
Klaus wrote: ↑Sun Nov 18, 2018 7:48 pm
"start using font file xxx" has been introduced in LC 6.5, which should cover most "ancient" installations. Your turn!
richmond62 wrote: ↑Sun Nov 18, 2018 7:55 pm
That should do, as I assume it is probably a version of the LiveCode series that is being used if not 9.x.
And it is the version of Lc I use most often when I am not using Mc or Rev2.1.x. Wouldn't it be funny if there were another person out there pulling for the vintage versions

Re: Integrate fonts in software
Posted: Sun Nov 18, 2018 9:15 pm
by Klaus
No, it wouldn't!

Re: Integrate fonts in software
Posted: Sun Nov 18, 2018 10:19 pm
by bogs
Tee hee

Re: Integrate fonts in software
Posted: Tue Nov 20, 2018 8:45 am
by AlessioForconi
Klaus wrote: ↑Sun Nov 18, 2018 5:19 pm
Buonasera Alessio,
do this:
1. Add your Fonts (respect copyrights!) via the "Copy files" tab in the "Standalone Builder Settings"
2. Then you can "start using" them and they will be available while your standalone is running.
3. Add something like this to your "preopenstack" handler
Code: Select all
...
put specialfolderpath("resources") & "/"name_of_font_here.ttf" into tFontFile
start using font file tFontFile
## Do so for every font you have included
if the result <> EMPTY then
answer "Error while loading font:" & CR & the result
end if
## if there is an error -> the result will not be EMPTY
...
4. The font will only be available to your application, unless you add:
Code: Select all
...
start using font file tFontFile globally
...
Best
Klaus
Klaus,
ho provato a eseguire il tuo suggerimento ma non funziona.
Ho posizionato il file del font nella cartella resources, che è posizionata nella cartella dello stack.
Dopo che ho compilato l'eseguibile la cartella viene regolarmente creata, con il file del font presente, ma ottengo sempre l'errore del font impossibile da caricare.
Code: Select all
on preOpenStack
put specialfolderpath("resources") & "/TerminalDosis-Medium.ttf" into tFontFile
start using font file tFontFile
## Do so for every font you have included
if the result <> EMPTY then
answer "non è stato possibile caricare il Font selezionato:" & CR & the result
end if
## if there is an error -> the result will not be EMPTY
end preOpenStack
P. S. L'eseguibile del Mac non ha nessuna cartella, nè del font nenache del database e degli altri file necessari (immagini ed altro) ma solo il file dell'applicazione.
P. P. S. Uso LC 9.0.1
P. P. P. S. Su Mac
Re: Integrate fonts in software
Posted: Tue Nov 20, 2018 10:46 am
by Klaus
Sorry, my italian is limited to only some common phrases, could you please explain in english agin?

Re: Integrate fonts in software
Posted: Tue Nov 20, 2018 10:56 am
by AlessioForconi
Forgive me klaus, I forgot to translate
I tried to make your suggestion but it does not work. I placed the font file in the resources folder, which is located in the stack folder. After I have compiled the executable, the folder is regularly created, with the font file present, but I always get the error of the font that can not be loaded.
Code: Select all
on preOpenStack
put specialfolderpath("resources") & "/TerminalDosis-Medium.ttf" into tFontFile
start using font file tFontFile
## Do so for every font you have included
if the result <> EMPTY then
answer "non è stato possibile caricare il Font selezionato:" & CR & the result
end if
## if there is an error -> the result will not be EMPTY
end preOpenStack
P. S. The executable of the Mac has no folder, nor the nenache font of the database and other necessary files (images and more) but only the application file.
P. P. S. Use LC 9.0.1
P. P. S. S. Mac
Re: Integrate fonts in software
Posted: Tue Nov 20, 2018 11:14 am
by Klaus
Hi Alessio,
sorry could you be a bit more specific here?
I placed the font file in the resources folder, which is located in the stack folder. After I have compiled the executable, the folder is regularly created, with the font file present,...
Did you add the font via the "Copy files" tab in the standalone builder settings?
The IDE does not have a "resources" folder, in the IDE specialfolderpath("resources") points to the folder containing the current stack.
Best
Klaus
Re: Integrate fonts in software
Posted: Tue Nov 20, 2018 11:26 am
by AlessioForconi