[TxMt] Re: tm_query --setting fontName

じょいすじょん dangerwillrobinsondanger at gmail.com
Wed Jul 12 15:22:06 UTC 2017


> On Jul 12, 2017, at 23:43, Allan Odgaard <mailinglist at textmate.org> wrote:
> 
> On 3 Jul 2017, at 23:07, じょいすじょん wrote:
> 
> Setting or variable 'fontName' not found
> […]
> Is there a modern alternative to fontName?
> Or, even better, a reference for that and other keys?
> 
> There is no good solution for this.
> 
> The tm_query tool is simply reading your various .tm_properties files (including the Default.tmProperties included with TextMate) and returning the requested value (or exiting with a non-zero return code if not found). So there is no fixed list of keys.
> 
> Originally the Default.tmProperties file had a setting for fontName but because Apple has changed the default fixed width font, it wasn’t good to put a hardcoded name in Default.tmProperties (since TextMate should default to the fixed width font that is default for the user’s OS version).
> 
> I am not sure for what the TextMate Jedi Completion bundle uses the font name, but it will need its own fallback, incase $TM_QUERY exits with a non-zero return code.
> 
> You can hardcode the fallback as Menlo-Regular but technically the user can override the system’s default fixed width font using the NSFixedPitchFont user defaults setting.
> 
> This can be obtained using: defaults read -g NSFixedPitchFont
> 
> The default size can be changed using the NSFixedPitchFontSize key.
> 
> 
OK, got it. So the response is correct, the key doesn't exist.
The defaults keys you provided also do not exist by default on my system.
But a font descriptor would return a user preference or a system default.
There's not a great solution you're right.
Core Text and AppKit are both kind of vague.
The solution there seems to be to start with a font and apply the fixed width trait to get a descriptor for a font that comes close to matching somehow (who knows how? personal taste?) or present a UI and let a user select something. Still does not give a default does it? How loopy these APIs can be :(
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20170713/f7e94872/attachment.html>


More information about the textmate mailing list