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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:41:19+00:00 2026-06-17T22:41:19+00:00

I need to draw a label that has some words in bold, consists of

  • 0

I need to draw a label that has some words in bold, consists of several paragraphs with different paddings and may contain small inline images (e.g. icons and bullets) from resources.

I know I could use NSAttributedString for bold and italic but it doesn’t support paragraph margins or line limiting, and I’d rather use HTML/CSS-like solution because I’m getting the styles from server. It also won’t allow me to insert my custom images in text without resorting to wrapping them in custom fonts.

Finally, I don’t want to use UIWebView for performance reasons.
What MonoTouch libraries or bindings can I use to achieve this?

  • 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-17T22:41:21+00:00Added an answer on June 17, 2026 at 10:41 pm

    I was happy to find out Hulu engineers wrote an iOS library that does exactly that. It’s called GSFancyText.

    In their own words:

    Of course we considered other options such as directly using HTML in a UIWebView or using NSAttributedString. But we decided to make our own style/markup parsing and rich-text drawing system, because of the following advantages:

    • It’s faster and consumes less memory than UIWebViews.
    • We can reuse the styles and parsing results in many places.
    • We can easily modify the style or text of a small part of a paragraph.
    • We can potentially extend the system with more fancy features, like Quartz 2D features, animations, gestures, etc.
    • It makes localization simple. For example, a phrase marked as bold might be at a different position in the sentence in Japanese. In this case we can use a single NSLocalizableString to represent a sentence with various styles.
    • It’s easy to extract the plain text, on which we can enable the VoiceOver support.

    The library is awesome so we went with creating MonoTouch bindings for it.

    Example

    First define the styles using a CSS-like string:

    var stylesheet = @"
        .green { color: #00ff00; font-weight:bold }
        .gray { color: gray; font-weight:bold }
    ";
    
    GSFancyText.ParseStyleAndSetGlobal (stylesheet);
    

    Then create a GSFancyText object with a markup string:

    var fancyText = new GSFancyText ("<span class=green>Hulu</span> <span class=gray>Plus</span>");
    

    Then you can directly draw this in a customized view:

    fancyText.drawInRect (rect);
    

    Or create a GSFancyTextView object to display it

    var fancyView = new GSFancyTextView (frame, fancyText);
    

    You can find more examples in GSFancyTextView documentation.

    My favorite feature are lambda blocks which allow you to specify a delegate to be called to render a <lambda id=yourhandler width=50 height=50> pseudoelement.

    This allows you to insert custom images or do advanced inline drawing yourself.

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

Sidebar

Related Questions

I have a JLabel that I need to draw off screen with some Transforms
I need to plot a function on a coordinate system that has its origin
i need draw some stuff on canvas and then lick on each. I made
I need to draw charts in my application. For that i use RGraph (
I need an application to produce a PDF file using several different custom templates.
I need to draw a rectange,circle and line and then animate them(press left ->
I need to draw vertical and horizontal rectangle / bands (like in Gantt charts)
I need to draw simple alpha maps in xna which depends on current game
I need to draw a chart to show the evolution of data in real
I need to draw a lot of lines. I'm using UIBezierPath for drawing lines

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.