Are you sure about that 'new button or label textFont is initialized to (Message)? I mean that (Message) is inheriting the appropriate button label font from the OS to match the OS version?1. Default text settings
When you create a new button or label in the IDE, its textFont is initialised to (Message). This placeholder is replaced by the LC engine with the font appropriate to the platform GUI. On Windows this is Segoe UI 12point. On the Mac, it is currently SF UI Text 13pt. For an input field the default is (Text), which resolves to Segoe UI 12pt or SF UI Text 12 pt respectively. Older Mac systems used to use Lucida Grande, and before that Helvetica. Linux systems will use whatever font is set for the particular distribution; for Ubuntu the font is Ubuntu 14pt.
Or...vis this is actually set up in the startUp chain, defaults chosen by an IDE script based on 'the platform' value? This is (currently) 'hard-coded' / static in script, but I'd want to have them be user preferences. The Mac setting was not updated to San Fran. font, it was still set for Lucida Grande (macOS 10.9 Mavericks and lower System Font).
The handlers with those set in the script are in revCommonLibrary,livecodescript in the IDE around line 1290.
Here's how my modified version of that looks currently (with some notes in the comments:
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"
if "SF Pro Regular" is among the lines of the fontNames then
return "San Francisco Pro Text"
else
return "Lucida Grande"
end if
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
function revFontGetSystemFontSize
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 12
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 11
else
return 10
end if
break
case "MacOS X"
return 11
break
case "Linux"
return 12
break
case "iphone"
return 17
break
case "android"
return 14
break
end switch
end revFontGetSystemFontSize
function revFontGetSystemFontStyles
return empty
end revFontGetSystemFontStyles
This all ties in with another recent discussion of the subject of 'classic controls' not really being native UI toolkit objects, they're more like emulations of 'native' with some (but not all) color properties inherited from the OS and appropriate font guessed at in that script above?
This makes me think (again) about how maybe we should just have a replacement set of 'classic controls'-as-widgets. The canvas drawing should render the same on any of the platforms (provided all using the exact same font). Maybe just have a generic set of controls, such as buttons with middle of the road defaults, but which are also customizable enough that one could match any OS reasonably well if they want to, and skipping that whole 'Native Button' thing.