Page 1 of 2

MacOS System Fonts

Posted: Sat Oct 07, 2023 8:13 am
by richmond62
Are not always to everyone's taste . . .

We can change the scriptEditor font to what we want.

[Personally I use, whether on Mac or Linux the Charcoal font from MacOS 8.5].

So, would it be possible, in the Preferences stack, to set an OXT 'system wide' font?

Re: MacOS System Fonts

Posted: Sat Oct 07, 2023 1:19 pm
by tperry2x
richmond62 wrote: Sat Oct 07, 2023 8:13 am [MacOS System Fonts]Are not always to everyone's taste . . .
...would it be possible, in the Preferences stack, to set an OXT 'system wide' font?
It would be possible I guess, however I think this might create a problem.
Because you'd then be designing your UI in the card of a new stack using the font you'd picked, you might only size a text field large enough to work with your font choice. When another user views the stack on their computer, or the standalone, it would be using the system font - so text fields may not be long enough depending on the differences in kerning.

This is exactly the issue I spotted with the standalone builder dialog, and the "automatically build her" - text field not long enough, because of differences in font character spacing.

The only way around the font differences would probably be to bundle the font with the standalone and your project, but then you have to make sure the license of the font permits it.

Most operating systems (well, Windows and Linux at least) allow you to change the system fonts globally on the user's whim. This then applies to all programs. It's only Apple that don't allow this, but mac users normally want the same font throughout their entire system (unless it happens to be a game or some kind of multimedia 'presentation-style' thing). For small utilities and general programs, any differences in font are normally frowned at by Mac users.

You could always load the font file in script, then set the fields of your stack to it. That would be another possible approach.
Of course, that's only my take on it.

Re: MacOS System Fonts

Posted: Sat Oct 07, 2023 1:34 pm
by richmond62
All those dialogue fields and so on in the IDE then need to made generously 'too large' in case someone has set their system font to Ubuntu Bold 18

Re: MacOS System Fonts

Posted: Sat Oct 07, 2023 3:22 pm
by FourthWorld
richmond62 wrote: Sat Oct 07, 2023 8:13 am So, would it be possible, in the Preferences stack, to set an OXT 'system wide' font?
I don't believe it's appropriate for an app to alter the user's system settings. OSes that allow changing the system font already provide a UI for that.

More thoughts on what "consistency" means in multi-platform apps, from myself and Tog:
http://lists.runrev.com/pipermail/use-l ... 71254.html

Re: MacOS System Fonts

Posted: Sat Oct 07, 2023 3:28 pm
by tperry2x
richmond62 wrote: Sat Oct 07, 2023 1:34 pm All those dialogue fields and so on in the IDE then need to made generously 'too large' in case someone has set their system font to Ubuntu Bold 18
Surprisingly, they already seem to automatically scale quite well when increasing the system font size:
scaled.png
scaled.png (796.14 KiB) Viewed 2948 times
Or at least better than I thought they would.

Re: MacOS System Fonts

Posted: Sat Oct 07, 2023 5:16 pm
by richmond62
I don't believe it's appropriate for an app to alter the user's system settings.
Sorry, I phrased things badly:
So, would it be possible, in the Preferences stack, to set an OXT 'system wide' font?
What I meant was to set a font to be the 'system font' throughout the OXT IDE, and NOT the host operating system.

Re: MacOS System Fonts

Posted: Sat Oct 07, 2023 5:21 pm
by tperry2x
richmond62 wrote: Sat Oct 07, 2023 5:16 pm What I meant was to set a font to be the 'system font' throughout the OXT IDE, and NOT the host operating system.
Edit: I misread this too. If trying to set the 'system font' through the IDE
Probably not as Windows would block this under UAC, with Linux you'd probably have to use something like xdotool to accomplish it on all systems, and on mac.... forget about it.

But, if you want the IDE to ignore the system font, and choose one you pick, then you'd have to set a global property somewhere - however the engine identifies 'the system font'.

But in both cases, you'd have the fact that what you are seeing and developing for won't be what an end-user sees.

Re: MacOS System Fonts

Posted: Sat Oct 07, 2023 6:27 pm
by richmond62
But in both cases, you'd have the fact that what you are seeing and developing for won't be what an end-user sees.
I worked that out 21 years ago when designing an automated system for teachers (surely not? Primary schools again?) to run up their own programs with ZILCH knowledge of computers . . .

. . . and having experienced some grotty problems subsequently in the early throes of my Devawriter Pro . . .

. . . NEVER to use real buttons ever again on anything that's going in a standalone to be deployed on other people's machines.

I set up a button, exactly as I want it to be and IMPORT a snapshot of the thing, and then use the image as a faux button.

Devawriter Pro checks for the presence of my bespoke whacked-out Indic font, and will not run if that is not installed by the end-user.

You can also fool around with graphic objects:
-
Screen Shot 2023-10-07 at 21.32.39.png
Screen Shot 2023-10-07 at 21.32.39.png (54.95 KiB) Viewed 2909 times
-
Obviously the chance of something coming out looking on that on someone else's machine is minimal: so:

Code: Select all

import snapshot from grc "Oval"
and 'tis all 'fixed in stone'.

Re: MacOS System Fonts

Posted: Sat Oct 07, 2023 6:38 pm
by tperry2x
Well, precisely...
so that's why customising fonts won't work.... until OXT can embed them (legal issues, everywhere!) Yawn

Re: MacOS System Fonts

Posted: Sat Oct 07, 2023 7:06 pm
by richmond62
(legal issues, everywhere!)
Pinch 10 representative fonts from Ubuntu. 8-)

Re: MacOS System Fonts

Posted: Sat Oct 07, 2023 8:28 pm
by tperry2x
richmond62 wrote: Sat Oct 07, 2023 7:06 pm Pinch 10 representative fonts from Ubuntu.
Hmmm...
1. Would Ubuntu allow that?
2. Would users object to having more fonts installed (in what is an already crowded font menu)
3. Why would we force a set of fonts on a user, different to what they are used to in the rest of their system?
4. What would be the benefit of doing so if all the above points were not issues?

Re: MacOS System Fonts

Posted: Sun Oct 08, 2023 5:58 am
by richmond62
1. Would Ubuntu allow that?
Open Sausages.
2. Would users object to having more fonts installed (in what is an already crowded font menu)
As they are simply users, rather than paying customers . . . cough, cough, cough.
3. Why would we force a set of fonts on a user, different to what they are used to in the rest of their system?
So that we could ensure that ALL text boxes inwith the IDE were not chopping off text.

Re: MacOS System Fonts

Posted: Sun Oct 08, 2023 1:42 pm
by tperry2x
But not everyone likes charcoal. It might leave a bad taste in their mouth... sorry, bad joke.
But you get what I mean.
Personally, I like coolvetica, but that's a personal preference that I won't inflict on anyone.

Re: MacOS System Fonts

Posted: Sun Oct 08, 2023 1:50 pm
by richmond62
a personal preference
I was NOT pushing CharcoalCY as the universal panacea, just bunging it here in case anyone wanted it.

Ubuntu Bold is very similar (and probably not as tied up in legal knots as CharcoalCY).

Re: MacOS System Fonts

Posted: Sun Oct 08, 2023 10:45 pm
by tperry2x
Yes, I do get what you mean. Sorry to bang on about this, but I just think it's a bit of a bad approach.

I mean, as much as we all have our own preferred fonts / colour scheme / desktop picture what-have-you, I find it particularly obnoxious when a program dumps unmentioned stuff all over your computer - worse, stuff that you didn't give it specific permission to install.

I don't want OpenXTalk to fall into the category of a PUP (Potentially Unwanted Program).
Usually very annoying to go through the install logs and remove all the bloat that other programs might put in.
Installing extras like fonts without asking may go against the grain with many who notice. Yes, Adobe do this but it always felt like an assumption on their part. I know Arial isn't arial across all platforms

(Mac and Windows have different kerning and vertical spacing).

I think it would be far better, if the stack / application you build absolutely has to have a custom font, make sure it's free and the license allows you to distribute a copy (normally along with the original read-me file somewhere).
Activate that font in script for use, and load only when the program / stack is running.

Re: MacOS System Fonts

Posted: Mon Oct 09, 2023 7:09 am
by richmond62
I tend to agree with you.

My main Macintosh machine is chock full of fonts that Apple bunged there, I don't want, and Apple have done something so they cannot be removed . . . a few more would just make things even worse.

What is a thought is to have a thing in the revPreferenceGUI stack to set a font as an OXT global font [that is the word, 'global', I should have used instead of 'system wide'].

Re: MacOS System Fonts

Posted: Tue Oct 10, 2023 11:05 am
by OpenXTalkPaul
Richmond I removed that font, only because it is Apple owned font and I don't want us to step on any copyrights.

Personally I prefer Charcoal for BBQ over gas.
Apple have done something so they cannot be removed
In recent versions most of the OS is now being treated s if it were ROM, as more and more macOS has become like iOS and everything gets sandboxed for your protection (and for the protection of App Store revenue).
What is a thought is to have a thing in the revPreferenceGUI stack to set a font as an OXT global font [that is the word, 'global', I should have used instead of 'system wide'].
The IDE fonts are "hardcoded" in the IDE scripts, and selected based on 'the platform', with incorrect/stale choices. The chosen for macOS for example is still using Lucida Grande which hasn't been the macOS system font in many years now (its San Francisco since 10.13 or 10.14). I would like to make these user settable, in revPrefs or possibly in that theming library I keep imagining.

Re: MacOS System Fonts

Posted: Tue Oct 10, 2023 11:23 am
by richmond62
The IDE fonts are "hardcoded" in the IDE scripts
Anything that is 'hardcoded' may be circumvented by judicious code in a component that loads later than the hard-coding.

AND, surely anything hard-coded in the IDE can be mucked around with?

Re: MacOS System Fonts

Posted: Tue Oct 10, 2023 11:53 am
by OpenXTalkPaul
revcommonlibrary.livecodescript contains this section (modified with notes in OXT DPE IDE):

Code: Select all

function revFontGetSystemFont
   switch _revFontGetPlatform()
      case "Windows"
         if word 1 of the systemVersion is "NT" and word 2 of the systemVersion >= 5 and "Segoe UI" is among the lines of the fontNames then
            return "Segoe UI"
         else if word 1 of the systemVersion is "NT" and word 2 of the systemVersion >= 5 and "Tahoma" is among the lines of the fontNames then
            return "Tahoma"
         else
            return "MS Sans Serif"
         end if
         break

      case "MacOS X"
         return "Lucida Grande"
         break

      case "Linux"
         return "Helvetica"
         break

      case "iphone"
         return "San Francisco"
         break

      case "android"
         return "Roboto"
         break

   end switch
   -- Default sans-serif font in MacOS
   -- MacOS (El Capitan and newer) San Francisco
   -- MacOS (Yosemite) Helvetica Neue
   -- MacOS (older versions) Lucida Grande
   -- Please note that — although for interface San Francisco is the default
   -- sans-serif font — for web -apple-system will need to be used, as the
   -- sans-serif fallback will display Helvetica instead of San Francisco.
   --(this is one of the quirks I mentioned earlier)

   -- Default sans-serif font in Windows
   -- The difference between Microsoft Sans Serif and MS Sans Serif is that MS Sans Serif was a
   -- bitmap/raster font available in 8, 10, 12, 14, 18, and 24 sizes and Microsoft Sans Serif is a TrueType scalable font.

   -- MS Sans Serif was based on Helvetica and in all versions up to Windows 3.1 it was called Helv.
   --Windows (Vista and newer, including Windows 10) Segoe UI
   -- Windows (XP) Tahoma
   -- Windows (2000) Microsoft Sans Serif
   -- Windows (95, NT, Millennium) MS Sans Serif
   -- Windows (older versions including Windows 3) Helv
   -- Default sans-serif font in Linux: Many Linux users re-configure defaults to other fonts like Inter UI or others.
   -- So it’s almost impossible to accurately mention defaults, except for the Ubuntu distro
   --  which has its own font as default.
   -- Red Hat also has commissioned its own fonts Red Hat Display and Red Hat Text.

   -- Ubuntu - Ubuntu
   -- Red Hat = Red Hat
   -- Other distros (Arch Linux, Debian, Fedora etc.) varies, can be DejaVu Sans, Noto Sans, Liberation Sans etc.

   -- iOS (9 and newer)and iPadOS San Francisco
   -- iOS (8 and older) Helvetica/Helvetica Neue

   -- watchOS = San Francisco Compact
   -- Android (4.0+) Roboto
   -- Android (older versions) Droid Sans
end revFontGetSystemFont

Re: MacOS System Fonts

Posted: Tue Oct 10, 2023 12:25 pm
by richmond62
Aha, you have found the deprecated racist word in the woodpile.

Well done.

So 'hard-coded' is only as 'hard' as far as that file goes.