Poorly rendered text (NSFont) in MacRuby/Cocoa. Any advice?
Posted
by
gnzlz
on Stack Overflow
See other posts from Stack Overflow
or by gnzlz
Published on 2011-11-19T11:54:11Z
Indexed on
2011/11/19
17:51 UTC
Read the original article
Hit count: 238
I have a small MacRuby app that displays some text inside a NSTextView
. I have a method called make_label()
that builds an NSTextView with some text and returns it, which I use to add to another NSView via addSubview()
make_label()
looks like this:
def make_label( x, y, width, height, color, font_size, text )
label = NSTextView.alloc.initWithFrame( NSMakeRect( x, y, width, height) )
font = NSFont.systemFontOfSize(font_size)
label.setFont( font )
label.insertText( text )
label.setTextColor( color )
label.setDrawsBackground(false)
label.setRichText(true)
label.setEditable(false)
label.setSelectable(false)
label
end
My question is, how come my text looks so poorly rendered? It looks very pixelated and not antialiased at all (from what I can see).
Click here for screenshot
This screenshot shows 2 different sizes of the font, with the same phenomenon.
© Stack Overflow or respective owner