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 7818587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T06:37:25+00:00 2026-06-02T06:37:25+00:00

I’m using CTTypesetter to layout messages read in from JSON from a server. However,

  • 0

I’m using CTTypesetter to layout messages read in from JSON from a server. However, on certain particular messages it crashes, namely those with unusual Unicode characters like the one below.

CFAttributedStringRef attrString = CFAttributedStringCreate(NULL, @"❝We  must  learn  to  live  together  as  brothers  or  perish  together  as  fools❞ ~Martin Luther King Jr. #HappyMLKDay", nil);
CTTypesetterRef typesetter = CTTypesetterCreateWithAttributedString(attrString);

That crashes with the below stack trace.

#0  0x33a4684e in TBaseFont::CopyCharacterSet() const ()
#1  0x33a2c0d4 in CompareCharSet(__CFCharacterSet const*, TBaseFont const*) ()
#2  0x33a2f03e in TDescriptorSource::CopyDescriptorsForRequestFromArray(__CFArray const*, __CFDictionary const*, long (*)(void const*, void const*, void*), void*, unsigned long, bool) const ()
#3  0x33a2ead0 in TDescriptorSource::CopyDescriptorsForRequest(__CFDictionary const*, __CFSet const*, long (*)(void const*, void const*, void*), void*, unsigned long) const ()
#4  0x33a2e624 in TDescriptorSource::CopyDescriptorForRequest(__CFDictionary const*, __CFSet const*, long (*)(void const*, void const*, void*), void*, unsigned long) const ()
#5  0x33a2e532 in TDescriptorSource::CopySystemWideFallbackDescriptor(CGFont*, unsigned short const*, long) const ()
#6  0x33a2e79c in TDescriptorSource::CopySystemWideFallbackDescriptor(CGFont*, __CFString const*, CFRange) const ()
#7  0x33a27c78 in TFontCascade::CreateSystemWideFallback(__CTFont const*, __CFString const*, CFRange) const ()
#8  0x33a27b28 in TFontCascade::CreateFallback(__CTFont const*, __CFString const*, CFRange) const ()
#9  0x33a185ec in TGlyphEncoder::AppendUnmappedCharRun(CTRun*, CFRange, CFRange, TGlyphList<TDeletedGlyphIndex>&, TGlyphList<TDeletedGlyphIndex>&, TFontCascade const&, bool) ()
#10 0x33a184b8 in TGlyphEncoder::RunUnicodeEncoderRecursively(CTRun*, adopted_t const&, CFRange, TGlyphList<TDeletedGlyphIndex>&, TGlyphList<TDeletedGlyphIndex>&, TFontCascade const*, bool) ()
#11 0x33a186e4 in TGlyphEncoder::AppendUnmappedCharRun(CTRun*, CFRange, CFRange, TGlyphList<TDeletedGlyphIndex>&, TGlyphList<TDeletedGlyphIndex>&, TFontCascade const&, bool) ()
#12 0x33a184b8 in TGlyphEncoder::RunUnicodeEncoderRecursively(CTRun*, adopted_t const&, CFRange, TGlyphList<TDeletedGlyphIndex>&, TGlyphList<TDeletedGlyphIndex>&, TFontCascade const*, bool) ()
#13 0x33a1824c in TGlyphEncoder::RunUnicodeEncoder(CTRun*, adopted_t const&, CFRange, TGlyphList<TDeletedGlyphIndex>&, TFontCascade const*) ()
#14 0x33a07a1a in TGlyphEncoder::EncodeChars(CFRange, TAttributes const&, TGlyphList<TDeletedGlyphIndex>&, TGlyphEncoder::Fallbacks) ()
#15 0x33a0665c in TTypesetterAttrString::Initialize(__CFAttributedString const*) ()
#16 0x33a064a4 in TTypesetterAttrString::TTypesetterAttrString(__CFAttributedString const*) ()
#17 0x33a06418 in TTypesetterAttrString::TTypesetterAttrString(__CFAttributedString const*) ()
#18 0x33a1e78c in CTTypesetterCreateWithAttributedString ()

I created an empty project to try and reproduce the crash, however in this environment it works fine.

The documentation has this to say:

Multicore Considerations: All individual functions in Core Text are
thread safe. Font objects (CTFont, CTFontDescriptor, and associated
objects) can be used by simultaneously by multiple operations, work
queues, or threads. However, the layout objects (CTTypesetter,
CTFramesetter, CTRun, CTLine, CTFrame, and associated objects) should
be used in a single operation, work queue, or thread.

To this end I’ve taken out all kind of threading, namely a few dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ...), in an attempt to resolve this. I don’t know what else I can try to solve it besides gutting what is a >20 KSLOC project.

It only crashes the actual iPad (all 3 models tested with both 5.0 and 5.1), not the simulator.

What can I try to solve this? I’m about to resort to embedding modified versions of Helvetica with as many fallback fonts merged into them as possible, but that’s a far from optimal solution.

Any input at all would be incredibly appreciated, as you can see this has been driving me insane since January!

  • 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-06-02T06:37:26+00:00Added an answer on June 2, 2026 at 6:37 am

    I just solved it.

    I was referencing 43 fonts in my info.plist. All were valid, all were otf’s or ttf’s in my resource bundle. I just removed a few and it started working.

    Damn Apple bug.

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

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I would like to run a str_replace or preg_replace which looks for certain words
We're building an app, our first using Rails 3, and we're having to build

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.