Integrate fonts in software

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

AlessioForconi
Posts: 90
Joined: Sun Feb 15, 2015 2:51 pm

Re: Integrate fonts in software

Post by AlessioForconi » Sun Nov 25, 2018 10:24 pm

SparkOut wrote:
Sun Nov 25, 2018 10:19 am
Try adding "globally" to the command

Code: Select all

start using font file tFontFile globally 
If that works (or even if not?) then I wonder whether it might be a regression of bug 19981 https://quality.livecode.com/show_bug.cgi?id=19981
I confirm that it does not work, could it be the bug you are talking about?

capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: Integrate fonts in software

Post by capellan » Sun Nov 25, 2018 11:45 pm

Hi All,

Using Windows, this script works fine and load a font
from a Windows special folder:

Code: Select all

on preopencard
put specialfolderpath("0x000d") & "/" & "CarterOne.ttf" into w
start using font file w
put w & cr & the result
end preopencard
The folder named "Music" is specialfolderpath("0x000d")
The Font named CarterOne.ttf is available among Google Fonts:
https://fonts.google.com/specimen/Carter+One

Using LC 9, loading the font globally does not work.

LC 8.1.10 is a recent LC version that allows to load a font globally
in Windows... but after loading a font globally, I could not unload
it until restarting Windows.

LiveCode error message is: can't unload font file

By the way, fonts loaded globally could be used by other applications
like Design, Paint and Text editors.

Al

cmhjon
Posts: 175
Joined: Tue Aug 04, 2015 11:55 am

Re: Integrate fonts in software

Post by cmhjon » Tue Jul 14, 2020 2:01 pm

Thank you for sharing this info. I too wanted a way to embed fonts within my app so that the computers running this app didn't need the fonts installed prior.

One thing I wanted to mention though is that my app didn't display the fonts quite right even after adding the necessary preOpenStack handler and adding the copied fonts to the app as shown earlier in this thread.

The trick (at least for me) was to add a "wait for 1 seconds" command to end of the preOpenStack handler. See below which shows the difference:
Comparison.jpg
I should add that I am using LiveCode 8.1.10. I haven't jumped to 9 yet so maybe this issue is fixed in 9.

Best regards,
Jon :-)

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”