[futurebasic] Re: [FB] CGContext & CGFonts

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : July 2011 : Group Archive : Group : All Groups

From: Brian S <fblistserve@...>
Date: Mon, 18 Jul 2011 18:39:16 -0700
On Jul 18, 2011, at 4:51 PM, Robert Purves wrote:

> 
> Have you thought of specifying font styles like this?
> 
> dim as Str255 fontName
> fontName = "Helvetica Bold Oblique"
> fn FBPStr2CStr( @fontName )
> CGContextSelectFont( ctx, @fontName, 13.0, _kCGEncodingMacRoman )
> CGContextSetTextDrawingMode( ctx, _kCGTextFillStroke )
> 
> CGContextShowText( ctx.... )
> 
> It will be simpler than mixing QuickDraw with CoreGraphics. Rotated text, which you seem to want, is very difficult in QD.
> 
> Use the Font Panel to see what styles are available for each font.


Some fonts ( like Courier New ) have an italic built-in ( others don’t ). Also, underlining may be accomplished in CG by drawing the line and not relying on the attribute.


Brian S