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

  • SEARCH
  • Home
  • 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 6055081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:13:28+00:00 2026-05-23T08:13:28+00:00

I am working on a new app. I render different documents from an NSAttributedString

  • 0

I am working on a new app. I render different documents from an NSAttributedString using Core Text. I am having trouble with strange glitches in the rendering of the text. It doesn’t happen with every document. There doesn’t seem to be a rhyme or reason to when it appears or not.

Here is a cropped screen shot here to demonstrate the problem.

Glitch in rendering

Here is a line from the same screenshot that is rendered correctly.

Correct rendering

The screenshots are from the same screenshot and the same document.

When the problem occurs, there are usually only 2-3 consecutive lines of text that are rendered incorrectly. The rest of the document is fine.

Here is the code that I use to render the text in drawRect:

CGContextRef context = UIGraphicsGetCurrentContext();

float viewHeight = self.bounds.size.height;
CGContextTranslateCTM(context, 0, viewHeight);
CGContextScaleCTM(context, 1.0, -1.0);
CGContextSetTextMatrix(context, CGAffineTransformMakeScale(1.0, 1.0));

CGMutablePathRef path = CGPathCreateMutable();
CGRect bounds = CGRectMake(PADDING_LEFT, -PADDING_TOP, self.bounds.size.width-20.0, self.bounds.size.height);
CGPathAddRect(path, NULL, bounds);

CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString((CFMutableAttributedStringRef)attrString);
CTFrameRef frame = CTFramesetterCreateFrame(framesetter, CFRangeMake(0, 0), path, NULL);
CFRelease(framesetter);
CFRelease(path);
CTFrameDraw(frame, context);

Any assistance is appreciated!

EDIT: This problem does not appear to exist on the iPhone 4, only on the 3GS that I have for testing.

The glitch is always in the middle of a document.

  • 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-23T08:13:29+00:00Added an answer on May 23, 2026 at 8:13 am

    Please try the various settings to affect the subpixel rendering of text. You can see various options on line 259 in https://github.com/Cocoanetics/NSAttributedString-Additions-for-HTML/blob/master/Classes/DTCoreTextLayoutFrame.m

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

Sidebar

Related Questions

Working on a new app and using restful-authentication. I was trying to make it
I'm working on migration of data from a legacy system into our new app(running
I'm kinda new to using Rails, and an app I am working on is
I am working on an new web app I need to store any changes
I have a new app I'll be working on where I have to generate
I have been working on test framework, which creates a new app domain to
I am working on the admin section of a new rails app and i'm
An app I'm working on can't meaningfully launch until it has a Location from
My Rails 3.1 app is using PDFkit to render specific pages, and I'm running
I'm deploying a Sinatra app using passenger. The deployed app is working, but not

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.