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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:12:42+00:00 2026-05-17T15:12:42+00:00

I can draw rich-text with Core Text, the problem is placing images flowing with

  • 0

I can draw rich-text with Core Text, the problem is placing images flowing with the text.
(iOS SDK 4.1)

I’m try to drawing some kind of rich-text. Problem is designer placed many icons among text. So the text what I have to draw is something like this:

Here is a word <an icon image>, and another words.
The image(<another icon>) should be placed like a glyph.
It's part of text, not an example.

<icon> are images. (This is not a code. Just an illustration.)

I can draw this by laying out all of them manually, but it’s too hard keeping complex text layout behaviors. So I’m finding a way to draw this with Core Text.

  • 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-17T15:12:42+00:00Added an answer on May 17, 2026 at 3:12 pm

    I got solution.

    The key of laying out non-text content is CTRunDelegate.
    Core Text does not support non-text content, so you have to make blank spaces for them, and draw or place them yourself later.

    A part of NSAttributedString attributed with kCTRunDelegateAttributeName will call registered callback to determine width of each glyph. This will let you make blank space for each non-text object.

    However, after drawing the text with Core Text, the layout information stored with frame/line/run will invalidated. So you have to draw/place non-text contents after layout with framesetter/typesetter, but before drawing.

    This link describes basic usage of CTRunDelegate:
    How to use CTRunDelegate in iPad?


    There is a problem with Core Text. Originally, CTRunDelegate designed to support variable width and vertical alignment via CTRunDelegateCallbacks.getAscent and CTRunDelegateCallbacks.getDescent. But vertical alignment feature doesn’t work currently. This might be a bug.

    I described this problem here:
    Aligning multiple sized text vertical center instead of baseline with Core Text in iOS

    If you have informations about this problem, please see my question at the link.

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

Sidebar

Related Questions

How can I draw text Over Video in Managed DirectX with C#?
ImageMagick can draw text into a picture in a given font, how can I
I can draw text using the below code, myCanvas.fillStyle = Red; myCanvas.font = 30pt
You can draw arcs and you can draw images on a canvas using javascript,
I have this application where the user can draw some custom QGraphicsItems in a
I have a drawing app where the user can draw lines with their finger,
I have an application in which the user can draw some points with the
I'm trying to set up something in SDL [in C++] where I can draw
How can I draw something in JPanel that will stay the same and not
How can i draw a dotted line in .NET/WinForms/GDI+? Pen p = new Pen

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.