Integrate fonts in software
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 90
- Joined: Sun Feb 15, 2015 2:51 pm
Integrate fonts in software
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
Thanks
Re: Integrate fonts in software
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
4. The font will only be available to your application, unless you add:
Best
Klaus
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
...
Code: Select all
...
start using font file tFontFile globally
...
Klaus
-
- Livecode Opensource Backer
- Posts: 10099
- Joined: Fri Feb 19, 2010 10:17 am
Re: Integrate fonts in software
I recommend you check out revFontLoad
in the Dictionary.
in the Dictionary.
Re: Integrate fonts in software
"revFontLoad" has been deprecated in LC 7 or 8.
You will not find it anymore in the LC 9 dictionary.
You will not find it anymore in the LC 9 dictionary.
-
- Livecode Opensource Backer
- Posts: 10099
- Joined: Fri Feb 19, 2010 10:17 am
Re: Integrate fonts in software
But, on the other hand, one doesn't know which version of LiveCode AlessioForconi is using.You will not find it anymore in the LC 9 dictionary.
Re: Integrate fonts in software
"start using font file xxx" has been introduced in LC 6.5, which should cover most "ancient" installations. Your turn! 

-
- Livecode Opensource Backer
- Posts: 10099
- Joined: Fri Feb 19, 2010 10:17 am
Re: Integrate fonts in software
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
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 versionsrichmond62 wrote: ↑Sun Nov 18, 2018 7:55 pmThat 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
No, it wouldn't! 

-
- Posts: 90
- Joined: Sun Feb 15, 2015 2:51 pm
Re: Integrate fonts in software
Klaus,Klaus wrote: ↑Sun Nov 18, 2018 5:19 pmBuonasera 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" handler4. The font will only be available to your application, unless you add: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 ...
BestCode: Select all
... start using font file tFontFile globally ...
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. P. S. Uso LC 9.0.1

P. P. P. S. Su Mac
Re: Integrate fonts in software
Sorry, my italian is limited to only some common phrases, could you please explain in english agin? 

-
- Posts: 90
- Joined: Sun Feb 15, 2015 2:51 pm
Re: Integrate fonts in software
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.
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

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. P. S. Use LC 9.0.1

P. P. S. S. Mac
Re: Integrate fonts in software
Hi Alessio,
sorry could you be a bit more specific here?
The IDE does not have a "resources" folder, in the IDE specialfolderpath("resources") points to the folder containing the current stack.
Best
Klaus
sorry could you be a bit more specific here?
Did you add the font via the "Copy files" tab in the standalone builder settings?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,...
The IDE does not have a "resources" folder, in the IDE specialfolderpath("resources") points to the folder containing the current stack.
Best
Klaus
-
- Posts: 90
- Joined: Sun Feb 15, 2015 2:51 pm
Re: Integrate fonts in software
I did that