Looking for Help on a Project

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

bidgeeman
Posts: 495
Joined: Wed Feb 21, 2007 7:58 am
Location: Australia

Re: Looking for Help on a Project

Post by bidgeeman » Fri Jun 30, 2017 11:49 am

Hello once more.
I am having terrible trouble loading some custom fonts Windows ttf from a standalone.
I have 4 x fonts for 4 x buttons with the fonts that load into a text field.

When I make the standalone and put the exe on my daughters computer there are no fonts available.
I have added the fonts to the copy files in the standalone settings and even a Fonts folder but nothing :(

I tried this on open stack :

Code: Select all

   put specialfolderpath("Fonts") into tFont
   put specialfolderpath("Fonts") & "/Font1.ttf" into tFont
   put specialfolderpath("Fonts") & "/Font2.ttf" into tFont
   put specialfolderpath("Fonts") & "/Font3.ttf" into tFont
   put specialfolderpath("Fonts") & "/Font4.ttf" into tFont

   start using font file tFont
I have been stuck on this for hours :( so Any help would be soooo appreciated.
Many thanks
Bidge

Randy Hengst
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 153
Joined: Thu Jun 29, 2006 4:16 pm

Re: Looking for Help on a Project

Post by Randy Hengst » Fri Jun 30, 2017 12:31 pm

Hello Bidge,

I regularly build for iOS. But, I assume the process is the same.
Add your font files using the Copy Files pane. Then in script set the textFont of the field, button, etc to the one you want.

If you're asking how to have the fonts appear in a font menu, then I don't know if the process above will work. I've never done that.

randy

bidgeeman
Posts: 495
Joined: Wed Feb 21, 2007 7:58 am
Location: Australia

Re: Looking for Help on a Project

Post by bidgeeman » Fri Jun 30, 2017 12:34 pm

Hi randy.
Thanks for the reply but where do I put the script to set the fields/buttons?
on open stack?

Thanks
Bidge

Klaus
Posts: 13793
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Looking for Help on a Project

Post by Klaus » Fri Jun 30, 2017 12:47 pm

Hi Bidge,

all files etc. that you add via the "Copy files..." tab in the standalone builder settings, will be found in -> specialfolderpath("resources")
There is no specialfolderpath("Fonts"), as a look into the doctionary would have told you! 8)

Usually you load fonts "on pre-/openstack":

Code: Select all

on openstack
  put "Font1.ttf,Font2.ttf,Font3.ttf,Font4.ttf" into tFonts
  repeat for each item tFont in tFonts
     start using font file (specialfolderpath("resourrces") & "/" & tFont)
  end repeat
  ## Your openstack stuff here...
  ## ...
end openstack
Best

Klaus

bidgeeman
Posts: 495
Joined: Wed Feb 21, 2007 7:58 am
Location: Australia

Re: Looking for Help on a Project

Post by bidgeeman » Fri Jun 30, 2017 1:06 pm

Hi Klaus.
Thanks for your reply and code fix but it did not work for some reason???
The fonts are in the copy files area. I just don't know what to do???

EDIT: Oh...I just noticed the typo :)
I'll try again

Bidge

Klaus
Posts: 13793
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Looking for Help on a Project

Post by Klaus » Fri Jun 30, 2017 1:09 pm

Hi Bidge,

I have a typo in the sepcialfolderpath (resourrces), remove one R (resources) and try again.
If that doesn't work add this line and tell us what the dialog tells you:

Code: Select all

...
start using font file ...
if the result <> empty then
  anser the result
end if
...
Best

Klaus

bidgeeman
Posts: 495
Joined: Wed Feb 21, 2007 7:58 am
Location: Australia

Re: Looking for Help on a Project

Post by bidgeeman » Fri Jun 30, 2017 1:39 pm

Hi Klaus.
I compiled the script hopefully correctly and still no fonts. Not even an error message
on the standalone.

I'm hoping it is due to my code writing:

Code: Select all

on openstack
   put "Pacifico.ttf,Anton.ttf,Schoolbell.ttf,Luckiest Guy.ttf" into tFonts
   repeat for each item tFont in tFonts
      start using font file (specialfolderpath("resources") & "/" & tFont)
      if the result <> empty then
         answer the result
      end if
   end repeat
end openstack

Bidge

Klaus
Posts: 13793
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Looking for Help on a Project

Post by Klaus » Fri Jun 30, 2017 1:41 pm

Hm, code is correct, sorry, no brilliant idea in the moment. :(

Maybe try with just ONE font? Poking in the dark here...

bidgeeman
Posts: 495
Joined: Wed Feb 21, 2007 7:58 am
Location: Australia

Re: Looking for Help on a Project

Post by bidgeeman » Fri Jun 30, 2017 1:54 pm

Oh dear....this is very dissapointing :(

Thanks for your help anyways Klaus and randy.
Bidge

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7210
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Looking for Help on a Project

Post by jacque » Fri Jun 30, 2017 4:27 pm

Do the fields have their font set correctly? There is a difference between the font assigned to characters and the font assigned to a field as a whole. If you set the textfont of the text in a field, when that text is removed the textfont will revert to the default font for the field. To make sure the field always displays the correct font, set the textfont of the field itself.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

bidgeeman
Posts: 495
Joined: Wed Feb 21, 2007 7:58 am
Location: Australia

Re: Looking for Help on a Project

Post by bidgeeman » Fri Jun 30, 2017 11:22 pm

Hi jacque.
I have set the field and buttons with this on open stack script:

Code: Select all

   set the textFont of field "Field" to "Font1"
   set the textFont of button "Script" to "Font1"
   set the textFont of button "Hand" to "Font2"
   set the textFont of button "Bold" to "Font3"
   set the textFont of button "Funny" to "Font 4"

Cheers
Bidge

bidgeeman
Posts: 495
Joined: Wed Feb 21, 2007 7:58 am
Location: Australia

Re: Looking for Help on a Project

Post by bidgeeman » Sat Jul 01, 2017 12:36 am

Hi Klaus.
Managed to get an answer "Something" from your code query.

(I am using 2 x stacks and forgot to set the path of the second stack that
contains the text field).

I gather this means that the font is not loading?
Can this somehow help with a possible solution?

Thanks
Bidge

bidgeeman
Posts: 495
Joined: Wed Feb 21, 2007 7:58 am
Location: Australia

Re: Looking for Help on a Project

Post by bidgeeman » Sat Jul 01, 2017 3:31 am

Thinking it was a bug I downloaded and installed Livecode V 8.1.4 and followed the instructions here:
http://lessons.livecode.com/m/4069/l/29 ... nts-on-ios

Still nothing. The custom font I selected did not show up in the load fonts field. I am completely at a loss
with this one :(
Bidge

SparkOut
Posts: 2834
Joined: Sun Sep 23, 2007 4:58 pm

Re: Looking for Help on a Project

Post by SparkOut » Sat Jul 01, 2017 9:01 am

The fontNames returns a list of the font names available on the device. The font name is not necessarily the same as the file name. One .ttf file may include a number of font names giving variations on weight and style, that may show up elsewhere in the fontNames list.
If it is a custom font, it might be that it doesn't match the file markers that the os uses to recognise a font automatically.
Are you trying this on a desktop or mobile device?
It's hard to diagnose, if you're following the tutorial then you should get results but as you aren't, it's going to take some more investigation. Do you want to send me your custom font and I will test it here?

bidgeeman
Posts: 495
Joined: Wed Feb 21, 2007 7:58 am
Location: Australia

Re: Looking for Help on a Project

Post by bidgeeman » Sat Jul 01, 2017 9:07 am

Hi Sparkout.
There are 4 x freeware fonts and none of them seem to work.
I have tried to attach them to this post.

Many thanks for any help.
Bidge
Attachments
Fonts.zip
Freeware Fonts
(140.52 KiB) Downloaded 358 times

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”