• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: CGContextShowTextAtPoint
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CGContextShowTextAtPoint


  • Subject: Re: CGContextShowTextAtPoint
  • From: David Duncan <email@hidden>
  • Date: Wed, 14 Oct 2015 13:37:52 -0700

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 <email@hidden> wrote:
>
>
>> On Oct 13, 2015, at 4:42 PM, Wim Lewis <email@hidden> wrote:
>>
>>
>> On Oct 13, 2015, at 3:02 PM, Raglan T. Tiger <email@hidden> 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
>
> I have text printing in the correct orientation now using
>
> CFAttributedStringRef attrString = CFAttributedStringCreate(kCFAllocatorDefault, cfstr, attributes);
>
> CTLineRef line = CTLineCreateWithAttributedString(attrString);
>
>            // Set text position and draw the line into the graphics context
>            CGContextSetTextPosition(ctx, pt.x, pt.y);
>            CTLineDraw(line, ctx);
>
> Now, I cannot increase the font size.  I set up attributes as:
>
>        CFStringRef keys[] = { kCTFontAttributeName };
>        CFTypeRef values[] = { [ NSFont systemFontOfSize:48 ] };
>
>        CFDictionaryRef attributes =
>        CFDictionaryCreate(kCFAllocatorDefault, (const void**)&keys,
>                           (const void**)&values, sizeof(keys) / sizeof(keys[0]),
>                           &kCFTypeDictionaryKeyCallBacks,
>                           &kCFTypeDictionaryValueCallBacks);
>
>
> and see my attributed string as:
>
> 667 x, 2.3 y{
>    NSFont = "\".HelveticaNeueDeskInterface-Regular 48.00 pt. P [] (0x1128ca30) fobj=0x11d04390, spc=12.93\"";
> }
>
> but the result is like 8 pt not 48.
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden

--
David Duncan


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: CGContextShowTextAtPoint
      • From: "Raglan T. Tiger" <email@hidden>
References: 
 >CGContextShowTextAtPoint (From: "Raglan T. Tiger" <email@hidden>)
 >Re: CGContextShowTextAtPoint (From: Wim Lewis <email@hidden>)
 >Re: CGContextShowTextAtPoint (From: "Raglan T. Tiger" <email@hidden>)

  • Prev by Date: Re: CGContextShowTextAtPoint
  • Next by Date: Re: CGContextShowTextAtPoint
  • Previous by thread: Re: CGContextShowTextAtPoint
  • Next by thread: Re: CGContextShowTextAtPoint
  • Index(es):
    • Date
    • Thread