Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Remove usage of main preference file for font values.

Instead use the TM_QUERY tool.
  • Loading branch information...
commit 38e72ef25c5b68776d63efed42bb2c55819c8abd 1 parent 11f8f1d
Michael Sheets authored September 25, 2012

Showing 1 changed file with 2 additions and 9 deletions. Show diff stats Hide diff stats

  1. 11  Support/getfontpref.rb
11  Support/getfontpref.rb
... ...
@@ -1,17 +1,10 @@
1  
-require "#{ENV['TM_SUPPORT_PATH']}/lib/osx/plist"
2  
-
3  
-# Load TM preferences to discover the current font settings
4  
-# Taken from doc2html by Brad Choate -- http://bradchoate.com/
5  
-textmate_pref_file = "~/Library/Preferences/#{ENV['TM_APP_IDENTIFIER'] || 'com.macromates.textmate'}.plist"
6  
-$prefs = OSX::PropertyList.load(File.open(File.expand_path(textmate_pref_file)))
7  
- 
8 1
 def getfontname
9  
-  font_name = $prefs['OakTextViewNormalFontName'] || 'Monaco'
  2
+	font_name = `"$TM_QUERY" --setting fontName`.chomp || 'Menlo-Regular'
10 3
   font_name = '"' + font_name + '"' if font_name.include?(' ') && !font_name.include?('"')
11 4
   return font_name
12 5
 end
13 6
 
14 7
 def getfontsize
15  
-  font_size = ($prefs['OakTextViewNormalFontSize'] || 11).to_s
  8
+	font_size = (`"$TM_QUERY" --setting fontSize`.chomp || 12).to_s
16 9
 	font_size.sub!(/\.\d+$/, '')
17 10
 end

0 notes on commit 38e72ef

Please sign in to comment.
Something went wrong with that request. Please try again.