Missing Fonts
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 39
- Joined: Mon Apr 19, 2021 8:39 pm
Missing Fonts
Hi all,
I've been playing around with this for a few days now and been searching Livecode forums but remain totally stumped.
I would like to use "Open Sans" in my application. I understand for the standalone I need to use "Copy Files" in the "Standalone Application Settings".
However, during development I am unable to access the Open Sans family. It is definitely installed as I can use it in other applications, and it's present in my fonts directory.
I've put "fontnames()" into a field, and Open Sans isn't listed, neither is it listed in any Livecode font menus.
I've tried using "Start using font file...". This brings the name into the Livecode Font menus, but has no effect on changing the font.
Any help would be gratefully received.
Gary
Windows 11 - Livecode 9.6.9
I've been playing around with this for a few days now and been searching Livecode forums but remain totally stumped.
I would like to use "Open Sans" in my application. I understand for the standalone I need to use "Copy Files" in the "Standalone Application Settings".
However, during development I am unable to access the Open Sans family. It is definitely installed as I can use it in other applications, and it's present in my fonts directory.
I've put "fontnames()" into a field, and Open Sans isn't listed, neither is it listed in any Livecode font menus.
I've tried using "Start using font file...". This brings the name into the Livecode Font menus, but has no effect on changing the font.
Any help would be gratefully received.
Gary
Windows 11 - Livecode 9.6.9
Re: Missing Fonts
I think LC has issues with .otf fonts. If your Open Sans is .otf, consider converting it to .ttf
There are any number of sites that can do this free, for example https://convertio.co/otf-ttf/
If that's not the issue maybe post some code?
Stam
There are any number of sites that can do this free, for example https://convertio.co/otf-ttf/
If that's not the issue maybe post some code?
Stam
-
- Livecode Opensource Backer
- Posts: 9445
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Missing Fonts
As far as I know LC ONLY works properly with .ttf fonts.
-
- Posts: 39
- Joined: Mon Apr 19, 2021 8:39 pm
Re: Missing Fonts
Thanks for your help, but the Open Sans family is all .ttf
Stam, there isn't any code to post as the font just don't appear in any font list.
Stam, there isn't any code to post as the font just don't appear in any font list.
Re: Missing Fonts
Not sure if there are any peculiarities affecting the Windows Version of LC.
But happy to test on Mac if u share your .ttf font…
But happy to test on Mac if u share your .ttf font…
Re: Missing Fonts
So, you are successfully getting "Start using font file ..." to make the font available to LiveCode. That's a good (and needed) start.Gary Rathbone wrote: ↑Fri Mar 08, 2024 1:05 pmI've tried using "Start using font file...". This brings the name into the Livecode Font menus, but has no effect on changing the font.
When you say that has no effect on changing the font, what do you mean? By selecting a field and setting the font in the Property Inspector? Setting the textfont of a field by script? Where are you assigning the font to the firld, or fields, or group, or card or stack?
Fields inherit the "effective" font from their parents which also inherit from their parents etc. Any change of font to an object at more specific level will block inheritance from above. Any children will inherit the new font from their parent but may also have inheritance blocked by their own specific setting.
If you are setting the font at the stack level then check for inheritance being blocked at all levels below.
Set a specific field with the font so that it no longer inherits and see if that works. If not, it's hard to tell without seeing what's going on in your environment.
Re: Missing Fonts
I had a very limited play with setup of a few fields and fonts to check inheritance.
There's definitely something screwy going on, inheritance of the effective textfont and fontsize are not working properly on Windows, at least as far as I understand.
I am not in a position to raise a bug report/recipe, but please can you do that and advise the reference number. I will add updates when I get a chance.
There's definitely something screwy going on, inheritance of the effective textfont and fontsize are not working properly on Windows, at least as far as I understand.
I am not in a position to raise a bug report/recipe, but please can you do that and advise the reference number. I will add updates when I get a chance.
-
- Posts: 39
- Joined: Mon Apr 19, 2021 8:39 pm
Re: Missing Fonts
The more I look at this, the more confused I get. I decided to use "Quicksand" as it appears in the Livecode font menu. However, there is only a single style available. In MSWord there are three styles, Regular, Light and Medium.
The same with "Open Sans", a single style in Livecode and multiple styles in MSWord.
If anyone can explain how to access the styles in Livecode, I'd be very grateful.
The same with "Open Sans", a single style in Livecode and multiple styles in MSWord.
If anyone can explain how to access the styles in Livecode, I'd be very grateful.
-
- VIP Livecode Opensource Backer
- Posts: 7257
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Missing Fonts
If I remember right, LC only shows the family name in the Font menu, which isn't necessarily the name of the individual variations. Look at the font in a font utility to see the actual names of the different styles and assign your controls with those. LC says if you set text to bold, for example, and there is a matching variation in the font file then styling will work, but if LC can't find a comparable style, nothing will change. In that case you may need to know the actual style name to use it.
Last edited by jacque on Sun Mar 10, 2024 7:03 pm, edited 1 time in total.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Livecode Opensource Backer
- Posts: 9445
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
-
- Posts: 39
- Joined: Mon Apr 19, 2021 8:39 pm
Re: Missing Fonts
After using "Start using font file..." on the following fonts.. (I wish I could post inline images, can't copy and paste either)..
OpenSans-Bold.ttf (Open Sans)
OpenSans-Light.ttf (Open Sans Light)
OpenSans-Medium.ttf (Open Sans Medium)
OpenSans-Regular.ttf (Open Sans)
OpenSans-SemiBold.ttf (Open Sans SemiBold)
The Fonts and Styles listed in LC for Open Sans are;
OpenSans
OpenSans Condensed
OpenSans SemiCondensed
Using the following code;
set the textfont of fld "f1" to "Open Sans" -- This changes the font to Open Sans (great)
set the textstyle of fld "f1" to "Medium" - This does nothing.
Surely, it can't be this difficult for LC to access and apply all installed font and styles. What am I missing?
Jacque & SparkOut: Thanks for your answers but LC only provides limited font styles.
OpenSans-Bold.ttf (Open Sans)
OpenSans-Light.ttf (Open Sans Light)
OpenSans-Medium.ttf (Open Sans Medium)
OpenSans-Regular.ttf (Open Sans)
OpenSans-SemiBold.ttf (Open Sans SemiBold)
The Fonts and Styles listed in LC for Open Sans are;
OpenSans
OpenSans Condensed
OpenSans SemiCondensed
Using the following code;
set the textfont of fld "f1" to "Open Sans" -- This changes the font to Open Sans (great)
set the textstyle of fld "f1" to "Medium" - This does nothing.
Surely, it can't be this difficult for LC to access and apply all installed font and styles. What am I missing?
Jacque & SparkOut: Thanks for your answers but LC only provides limited font styles.
-
- Posts: 39
- Joined: Mon Apr 19, 2021 8:39 pm
Re: Missing Fonts
I'd love to be able to attach the Open Sans Font Family here, but I just get an "invalid file extension" error.
Anyway, the full family can be downloaded from...
https://fonts.google.com/specimen/Open+Sans
Anyone who can get a field to display...
Open Sans Light
Open Sans Medium
Open Sans SemiBold
...gets a free drink.
(Easy in the UK as you can send me your table number at any Wetherspoons pub, and your choice will be delivered to you in a matter of minutes.)
Anyway, the full family can be downloaded from...
https://fonts.google.com/specimen/Open+Sans
Anyone who can get a field to display...
Open Sans Light
Open Sans Medium
Open Sans SemiBold
...gets a free drink.
(Easy in the UK as you can send me your table number at any Wetherspoons pub, and your choice will be delivered to you in a matter of minutes.)
-
- VIP Livecode Opensource Backer
- Posts: 4016
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: Missing Fonts
Gary,
I downloaded the open sans family from Google. It gave me 2 variable fonts and a folder of static fonts.
That folder of static fonts contained the ones you are asking for.
I installed the fonts using a button
I made up a field and put some text into it.(see screenshots)
Then selecting the field and using the properties inspector for that field chose the ones you wanted.
Is that enough to get me a beer?
Please note that I am using a Mac, I hope this works similar on Windows
Kind regards
Bernd
I downloaded the open sans family from Google. It gave me 2 variable fonts and a folder of static fonts.
That folder of static fonts contained the ones you are asking for.
I installed the fonts using a button
Code: Select all
on mouseUp
answer file "choose font"
if it is not empty then
put it into tFile
start using font file tFile
end if
end mouseUp
Then selecting the field and using the properties inspector for that field chose the ones you wanted.
Is that enough to get me a beer?
Please note that I am using a Mac, I hope this works similar on Windows
Kind regards
Bernd
Re: Missing Fonts
Windows inheritance is still grimbulled.
Set the stack textfont to "whatevervalidfontyoulike"
Add a new field and put text into it. See that it inherits the font and style/size from the stack property. In the PI for the field the font details are shown in italics, indicating the effective font is inherited.
Edit the stack textfont or size. Note no changes in the display of the field inheriting this style. Try to force a screen redraw. Edit the text. Note the field retains the same size/font/style that it was originally created with. The PI still shows inheritance of font with the effective name in italics. Size remains as per the original size at which it was created in the PI regardless of the stack text size setting.
Do some more fiddling. Note nothing seems to have any effect except using the message box or script toat which point inheritance is restored.
Set the stack textfont to "whatevervalidfontyoulike"
Add a new field and put text into it. See that it inherits the font and style/size from the stack property. In the PI for the field the font details are shown in italics, indicating the effective font is inherited.
Edit the stack textfont or size. Note no changes in the display of the field inheriting this style. Try to force a screen redraw. Edit the text. Note the field retains the same size/font/style that it was originally created with. The PI still shows inheritance of font with the effective name in italics. Size remains as per the original size at which it was created in the PI regardless of the stack text size setting.
Do some more fiddling. Note nothing seems to have any effect except using the message box or script to
Code: Select all
set the textfont of field "fldTestfield" to empty
-
- Posts: 39
- Joined: Mon Apr 19, 2021 8:39 pm
Re: Missing Fonts
Thank Bernd. I'm using Windows 11 (I have three different PC's) and have copied and pasted your code, however Open Sans Light still isn't listed. So sorry, no pint yet
Interesting, SparkOut. I wonder if the two issues are separate or related?
Interesting, SparkOut. I wonder if the two issues are separate or related?