Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6201803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:37:15+00:00 2026-05-24T04:37:15+00:00

Using monotouch, I’m try to display a core text element over multiple lines. The

  • 0

Using monotouch, I’m try to display a core text element over multiple lines. The example I’m trying to use is from CoreText_Programming p17. One problem I’ve come across is not being able to find an equivalent for CFMutableAttributedStringRef, so I’ve tried to subsitute this for NSAttributedString, however the following code displays nothing. Does anyone know of any examples of this type in monotouch or know the reason why the following is not working. Thanks.

    public override void Draw (RectangleF rect)
    {
        base.Draw (rect);   

        CGContext context = UIGraphics.GetCurrentContext ();
        context.TextMatrix = new CGAffineTransform();           
        CGPath path = new CGPath();
        path.AddRect ( this.Bounds );
        // created dictionary so this line does not crash 
        NSAttributedString stringToDraw = new NSAttributedString( "Hello", new NSDictionary() );
        CTFramesetter framesetter = new CTFramesetter(stringToDraw);
        CTFrame frame = framesetter.GetFrame( new NSRange(0,0), path, null );
        frame.Draw( context );
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T04:37:17+00:00Added an answer on May 24, 2026 at 4:37 am

    As it happens, I ported most of those samples to MonoTouch when I was writing/testing the MonoTouch.CoreText framework. Then apparently completely forgot to merge them upstream. :-/

    That said, take a look at CoreTextDemo.cs, which ports (nearly line-for-line) most of the samples in the PDF you linked to.

    Based on my CoreTextDemo.cs, you’re missing:

    • A proper CGAffineTransform.MakeScale() call: context.TextMatrix = CGAffineTransform.MakeScale(1f, -1f);
    • You’re not using NSMutableAttributedString. (CFMutableAttributedStringRef maps to NSMutableAttributedString.)
    • You’re not disposing of your framesetter, nor your frame.

    There may be others, but at the time the CoreTextDemo.cs code worked equivalent to the Objective-C code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using MonoTouch 5.0.2. I am trying to bind the core plot library
How to play the video on iPhone using MonoTouch? I get the Video's from
I am trying to learn using MonoTouch. I am basically trying to create something
I'm trying to create a project in .Net for IPhone using Monotouch. My problem
Hi im working on iphone application using monotouch im trying to get list of
I'm trying to use Instruments to look at resource usage in my Monotouch app.
I'm trying to animate two images moving across the screen using Monotouch. I've been
I'm trying to build a MonoTouch project using xbuild (on a Mac, clearly). Here's
Note: Using Monotouch. I have a directory called Images where I have all my
I am using Mike Bluestein's article, http://mikebluestein.wordpress.com/2009/09/27/using-monotouch-with-the-net-library-for-the-google-data-api/ , to build an application that communicates

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.