Fonts on standalone app fuzzy, but when in the IDE they are crisp

Deploying to Windows? Utilizing VB Script execution? This is the place to ask Windows-specific questions.

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, kevinmiller

Post Reply
jalz
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 339
Joined: Fri Sep 12, 2008 11:04 pm

Fonts on standalone app fuzzy, but when in the IDE they are crisp

Post by jalz » Sat Sep 15, 2018 6:47 am

Hey all,

I’m working with the latest stable release of LC 9 and the fonts on the development environment which inclides the IDE and my app look really crisp.

When I create a standalone of my app, and then execute my app on Windows 10, the font is the same, but nowhere near as crisp as when in the development environment. Is there something I can do in the build process that will allow my compiled programs to use the same fonts as the ide uses?

Thanks

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 2733
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria
Contact:

Re: Fonts on standalone app fuzzy, but when in the IDE they are crisp

Post by richmond62 » Sat Sep 15, 2018 6:16 pm

At the risk of sounding stupid:

Is your standalone deployed on the same machine you developed the stack on?

jalz
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 339
Joined: Fri Sep 12, 2008 11:04 pm

Re: Fonts on standalone app fuzzy, but when in the IDE they are crisp

Post by jalz » Sat Sep 15, 2018 10:41 pm

Hi,

Not a stupid question at all and yes it is. I’m running the executable from the standalone build folder in my Surface Pro.

Thanks

jalz
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 339
Joined: Fri Sep 12, 2008 11:04 pm

Re: Fonts on standalone app fuzzy, but when in the IDE they are crisp

Post by jalz » Tue Sep 18, 2018 9:37 pm

Hi, a quick update. I thought I would try and bundle the same fonts the IDE uses to my app, using the copy files/folders option in the standalone settings. So to find the fonts in the IDE I opened up the messagebox and typed in answer fontFilesInUse. That command gave me a whole list of fonts in use, so in my app on the openstack handler I have put the following code in hoping that it would load the fonts in memory and therefore they would become crisp.

Code: Select all


   
   put specialFolderPath("resources") & slash & "fonts" & slash into tFontSrc 
   answer tFontSrc
   //start using font file "C:/myFontFolder/myCustomFont.ttf"
   start using font file tFontSrc & "SourceCodePro-SemiboldIt.ttf"
   start using font file tFontSrc & "SourceCodePro-Semibold.ttf"
   start using font file tFontSrc & "SourceCodePro-Regular.ttf"
   start using font file tFontSrc & "SourceCodePro-MediumIt.ttf"
   start using font file tFontSrc & "SourceCodePro-Medium.ttf"
   start using font file tFontSrc & "SourceCodePro-LightIt.ttf"
   start using font file tFontSrc & "SourceCodePro-Light.ttf"
   start using font file tFontSrc & "SourceCodePro-It.ttf"
   start using font file tFontSrc & "SourceCodePro-ExtraLightIt.ttf"
   start using font file tFontSrc & "SourceCodePro-ExtraLight.ttf"
   start using font file tFontSrc & "SourceCodePro-BoldIt.ttf"
   start using font file tFontSrc & "SourceCodePro-Bold.ttf"
   start using font file tFontSrc & "SourceCodePro-BlackIt.ttf"
   start using font file tFontSrc & "SourceCodePro-Black.ttf"
   start using font file tFontSrc & "lcideicons.ttf"
   start using font file tFontSrc & "fontawesome.ttf"
   
Unfortunately, this hasn't worked, it looks like the fonts are loaded in memory but the fonts for display are are still fuzzy and not crisp like the IDE.

Does anyone else have anything else I can try?

AxWald
Posts: 324
Joined: Thu Mar 06, 2014 2:57 pm

Re: Fonts on standalone app fuzzy, but when in the IDE they are crisp

Post by AxWald » Wed Sep 19, 2018 1:11 pm

Hi,

after messing around with "start using font" for a while I now do as follows:

1. I put my .ttf's into [StandAloneFolder]/fonts. This way I have them available. For Android it's all that's needed, already.

2. For Windows, I check on "openstack" if the fontnames are "in the fontNames". If they are not, I throw an "answer" informing the user that we need the font, are about to install it and that it, please, may acknowledge the following UAC dialog.

3. Then I install the font via VBScript:

Code: Select all

put "SpecialFont.ttf" into myFont
put specialfolderpath("resources") & "\fonts" into myPath
replace slash with backslash in myPath

put "Set objShell = CreateObject(" & quote & "Shell.Application" & quote & ")" & CR & \
      "Set objFolder = objShell.Namespace(" & quote & myPath & quote & ")" & CR & \
      "Set objFolderItem = objFolder.ParseName(" & quote & myFont & quote & ")" & CR & \
      "objFolderItem.InvokeVerb(" & quote & "Install" & quote & ")" into myVBS
      
do myVBS as "VBScript"
if the result is not empty then [...]
4. That's it. Now the user has the font, and I don't need to care anymore for it ;-)

Have fun!
Livecode programming until the cat hits the fan ...

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

Re: Fonts on standalone app fuzzy, but when in the IDE they are crisp

Post by Klaus » Wed Sep 19, 2018 1:32 pm

I never had any problem with "start using font..." on Windows. However the concatenation does not seem correct, use BRACKETS, the engine likes that, to say the least! :D

Code: Select all

...
put specialFolderPath("resources") & slash & "fonts" & slash into tFontSrc 
answer tFontSrc
start using font file (tFontSrc & "SourceCodePro-SemiboldIt.ttf")
start using font file (tFontSrc & "SourceCodePro-Semibold.ttf")
start using font file (tFontSrc & "SourceCodePro-SemiboldIt.ttf")
...

jalz
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 339
Joined: Fri Sep 12, 2008 11:04 pm

Re: Fonts on standalone app fuzzy, but when in the IDE they are crisp

Post by jalz » Wed Sep 19, 2018 3:09 pm

Thank you both for replying.

My fonts now appear to be a lot sharper, I've tried a different monitor and checked the font on various builds. I think its the way the Surface Pro renders them, but I can see the fonts are loaded in memory now and look a lot smoother than when they were not there in my older builds.

Post Reply

Return to “Windows”