Re: CGContextShowTextAtPoint

2015-10-14 Thread Raglan T. Tiger
-rags > On Oct 14, 2015, at 2:37 PM, David Duncan wrote: > > Ensure that the text matrix is sane I have been doing this: CGAffineTransform t = CGAffineTransformMakeScale (1.0, -1.0); CGContextSetTextMatrix (ctx, t); changing the sx and sy just scrunches t

Re: CGContextShowTextAtPoint

2015-10-14 Thread David Duncan
Ensure that the text matrix is sane (its separate from the current ctm and not stored with the graphics state). > On Oct 14, 2015, at 1:36 PM, Raglan T. Tiger wrote: > > >> On Oct 13, 2015, at 4:42 PM, Wim Lewis wrote: >> >> >> On Oct 13, 2015, at 3:02 PM, Raglan T. Tiger wrote: >>> CGConte

Re: CGContextShowTextAtPoint

2015-10-14 Thread Raglan T. Tiger
> On Oct 13, 2015, at 4:42 PM, Wim Lewis wrote: > > > On Oct 13, 2015, at 3:02 PM, Raglan T. Tiger wrote: >> CGContextShowTextAtPoint (ctx, pt.x,pt.y,(const char*)txt, len ); >> >> This has printed my text UNTIL 10.11. >> >> I see that CGContextShowTextAtPoint is deprecated in 10.9 ... is it

Re: CGContextShowTextAtPoint

2015-10-14 Thread Conrad Shultz
> On Oct 14, 2015, at 11:41 AM, Raglan T. Tiger wrote: > > > >> On Oct 14, 2015, at 10:02 AM, Jens Alfke wrote: >> >> The view is probably using flipped coordinates. Look up flipped coordinates >> in the Cocoa view documentation to understand what they are and how to work >> around the pro

Re: CGContextShowTextAtPoint

2015-10-14 Thread Raglan T. Tiger
> On Oct 14, 2015, at 10:02 AM, Jens Alfke wrote: > > The view is probably using flipped coordinates. Look up flipped coordinates > in the Cocoa view documentation to understand what they are and how to work > around the problem. > > As for the size, have you set the size of the NSFont in ‘s

Re: CGContextShowTextAtPoint

2015-10-14 Thread Jens Alfke
> On Oct 14, 2015, at 8:54 AM, Raglan T. Tiger wrote: > > I did all the above ... now my text prints upside down andI cannot get it to > size up regardless of the font size. The view is probably using flipped coordinates. Look up flipped coordinates in the Cocoa view documentation to understa

Re: CGContextShowTextAtPoint

2015-10-14 Thread Raglan T. Tiger
> On Oct 13, 2015, at 4:56 PM, Graham Cox wrote: > > Converting this to use string drawing is easy enough: > > NSDictionary* attributes = @{NSFontAttributedName:sysFont}; > NSString* myText = [NSString stringWithUTF8String:txt]; // > check encoding if not UTF-8 > > [myText draw

Re: CGContextShowTextAtPoint

2015-10-13 Thread Graham Cox
> On 14 Oct 2015, at 9:02 am, Raglan T. Tiger wrote: > > NSFont *sysFont = [NSFont systemFontOfSize:10]; > NSString *sysFontName = [sysFont fontName]; > CGContextSelectFont(ctx, [sysFontName > cStringUsingEncoding:NSASCIIStringEncoding], 90, kCGEncoding

Re: CGContextShowTextAtPoint

2015-10-13 Thread Wim Lewis
On Oct 13, 2015, at 3:02 PM, Raglan T. Tiger wrote: > CGContextShowTextAtPoint (ctx, pt.x,pt.y,(const char*)txt, len ); > > This has printed my text UNTIL 10.11. > > I see that CGContextShowTextAtPoint is deprecated in 10.9 ... is it gone in > 10.11? As Quincey Morris says, Core Text is the r

Re: CGContextShowTextAtPoint

2015-10-13 Thread Quincey Morris
On Oct 13, 2015, at 15:02 , Raglan T. Tiger wrote: > > I see that CGContextShowTextAtPoint is deprecated in 10.9 ... is it gone in > 10.11? Apparently. There’s this: https://developer.apple.com/library/prerelease/mac/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_text

Re: CGContextShowTextAtPoint doesn't show text

2011-08-09 Thread Graham Cox
On 10/08/2011, at 2:06 AM, Gabriel Zachmann wrote: > Just checked the doc of CATextLayer but couldn't find a hint on how it helps > me determine whether or not a font is installed ... can you tell me? I doesn't. But it falls back gracefully, AFAIK. If you need a specific non-standard font, yo

Re: CGContextShowTextAtPoint doesn't show text

2011-08-09 Thread Gabriel Zachmann
>>CGContextSelectFont( ctxt, "AndaleMono", 14, kCGEncodingMacRoman ); >> // "Andale Mono" doesn't work either > > Perhaps he doesn't have "Andale Mono" on his machine? I'm not sure what CG > does with text if the font isn't there, does it fall back to something else > or just silently f

Re: CGContextShowTextAtPoint doesn't show text

2011-08-09 Thread glenn andreas
On Aug 9, 2011, at 9:48 AM, Gabriel Zachmann wrote: > Thanks a lot for your response ... > >> I've found the Core Graphics text handling methods to be gnarly and awkward >> the few times I've attempted to use them, and always ended up going some >> other route to render text. > > Could you pl

Re: CGContextShowTextAtPoint doesn't show text

2011-08-09 Thread Graham Cox
On 10/08/2011, at 12:48 AM, Gabriel Zachmann wrote: > Could you please point me to a few of them? NSString, NSAttributedString, Core Text > Can CATextLayer render text with a shadow? > Like this: > CGContextSetShadowWithColor( ctxt, CGSizeMake(0,0), 10, blue ); > > I really need the shadow t

Re: CGContextShowTextAtPoint doesn't show text

2011-08-09 Thread Gabriel Zachmann
Thanks a lot for your response ... > I've found the Core Graphics text handling methods to be gnarly and awkward > the few times I've attempted to use them, and always ended up going some > other route to render text. Could you please point me to a few of them? > > In your case, the choice se

Re: CGContextShowTextAtPoint doesn't show text

2011-08-09 Thread Graham Cox
On 09/08/2011, at 10:43 PM, Gabriel Zachmann wrote: > I have checked that 'str' does actually hold a valid string at the user's > instance. (I logged it and had him send me the log file.) >CGContextSelectFont( ctxt, "AndaleMono", 14, kCGEncodingMacRoman ); // > "Andale Mono" doesn't wo

Re: CGContextShowTextAtPoint doesn't show text

2011-08-09 Thread Graham Cox
On 09/08/2011, at 10:43 PM, Gabriel Zachmann wrote: > I have checked that 'str' does actually hold a valid string at the user's > instance. (I logged it and had him send me the log file.) > I have also tried different font sizes. > I have also googled around. > All to no avail. > > > Does anyb