Avoiding NSUserDefaults on macOS

Neil Hodgson <[email protected]>
Newsgroups gmane.comp.lib.scintilla.devel
Message-ID <[email protected]>
Apple is trying to limit the ability of applications to surreptitiously 
identify users through collecting system information as a 'fingerprint'.
https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api?language=objc

The NSUserDefaults class can be used to discover a wide range of system 
information and may require justification for use when publishing on the 
App Store.

Scintilla currently uses NSUserDefaults for 3 pieces of information: a 
default font "NSFixedPitchFont", a default font size 
"NSFixedPitchFontSize", and the double click time 
"com.apple.mouse.doubleClickThreshold" which is the maximum time one click 
can follow another and be considered a double click.

An alternative API for the double click time is NSEvent.doubleClickInterval 
so that will be used.

For NSFixedPitchFont and NSFixedPitchFontSize, which are currently 
"Menlo-Regular" and 11pt on my machine, I couldn't find an alternate API. 
The attractive sounding [NSFont monospacedSystemFontOfSize:weight:] returns 
"SF Mono" instead of "Menlo". It may be reasonable to hard-code 
"Menlo-Regular" and 11pt here as "Menlo" is available on all supported 
macOS releases and this is how default font is implemented on Win32 and 
GTK. Almost all applications will be overriding the font with their own 
preference system and Scintilla's default is there for simple 
demonstrations and ensuring something is visible when other code fails.

Neil

-- 
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/scintilla-interest/2ad61dff-a121-4086-9549-06b84c64f79fn%40googlegroups.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.