Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Cameron Adamez committed Mar 21, 2010
0 parents commit 5d86c14
Show file tree
Hide file tree
Showing 36 changed files with 8,069 additions and 0 deletions.
70 changes: 70 additions & 0 deletions Controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Controller.rb
# mister t
#
# Created by Cameron Adamez on 3/18/10.

class Controller

attr_writer :fontListView, :fontSampleView
attr_accessor :fonts

def awakeFromNib

@fonts = []
@fontListView.setDataSource self
@fontListView.reloadData

@dummytext = "This is some dummy text"

NSNotificationCenter.defaultCenter.addObserver self,
selector:'fontSetChanged:',
name:NSFontSetChangedNotification,
object: nil

createFontList
end

def createFontList

nameEnum = NSFontManager.new.availableFonts

nameEnum.each do |name|
theDict = {}
font = NSFont.fontWithName(name, size:12)

if font.displayName
theDict["name"] = font.displayName
else
theDict["name"] = font.fontName
end

#theDict["gly"] = font.numberOfGlyphs.to_s
#theDict["mono"] = font.isFixedPitch ? "YES" : "NO"

@fonts << theDict
end

@fontListView.reloadData
end

def fontSetChanged(notification)
@fontListView.reloadData
end

# TABLESSSS

def numberOfRowsInTableView(view)
@fonts ? @fonts.size : 0
end

def tableView(view, objectValueForTableColumn:column, row:index)
@fonts[index]["name"]
end

# Font sample part

def viewItem(sender)
ff = @fontListView.selectedRow["name"]
end

end
Binary file added English.lproj/InfoPlist.strings
Binary file not shown.
2,398 changes: 2,398 additions & 0 deletions English.lproj/MainMenu.nib/designable.nib

Large diffs are not rendered by default.

Binary file added English.lproj/MainMenu.nib/keyedobjects.nib
Binary file not shown.
Loading

0 comments on commit 5d86c14

Please sign in to comment.