Using
@f = font.family
will overwrite @f each time through the loop. That's why you see only the last value.
If you wanted to build up an array, you could write:
@f = for font in Magick.fonts @f << font.family end
But you can do this all in one line:
@f = Magick.fonts.collect &:family
(I'm assuming you're doing this in a Rails app. If you're doing it in a standalone script, you would need to add "require 'active_support'" for the &:family thingy to work)
This is equivalent to what ebeard showed, but uses some new sugar Rails gives you. See http://pragdave.pragprog.com/pragdave/2005/11/symbolto_proc.html. I think this is going to be standard in Ruby 1.9.