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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:57:08+00:00 2026-05-31T15:57:08+00:00

In my iPhone app I set a custom font for all UILabels (to be

  • 0

In my iPhone app I set a custom font for all UILabels (to be more precise, I subclassed UILabel, overriding a method, setting the custom font in that method and then set all labels in IB to that custom class). The problem now is, that all texts are rendered too far below the expected baseline, so letters like ‘y’ and ‘g’ are cut off below. I’ve read about similar problems here:

UIButton custom font vertical alignment

Custom installed font not displayed correctly in UILabel

I then tried fiddling around with the ascender as described in those solutions (it was set to 990 initially). Setting it to around 500 led to good results, but not long after that, I noticed that lines in multiline texts were blended into each other, which of course isn’t acceptable. On UITextViews, the font seems to render fine with the initial baseline though..

Is there a practical way to solve this problem? Of course I could keep several fonts with different ascenders for either multi- or single-line texts, but that is a rather messy solution..

PS: The font is provided in otf format, though I tried converting it to ttf, leading to the same results.

  • 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-31T15:57:09+00:00Added an answer on May 31, 2026 at 3:57 pm

    Okay, just in case somebody is interested, I figured out a workaround that should work for me. It simply consists of overriding the method drawTextInRect of UILabel, modifying the given rectangle and pass it on to the superclass method.

    - (void)drawTextInRect:(CGRect)rect {
        CGFloat pointSize = self.font.pointSize;
    
        CGRect newRect = CGRectMake(rect.origin.x, rect.origin.y - (0.25 * pointSize), rect.size.width, rect.size.height);
    
        [super drawTextInRect:newRect];
    }
    

    I might have to try out different values other than 0.25 though…

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

Sidebar

Related Questions

So, I understand that it's possible to set up in-app purchases for iPhone apps
I want to add a custom table to my iPhone app, that should look
In the iphone app that I'm working on I use a custom class to
I'm writing an iPhone app that can be started via a custom URL. So,
I have a fairly simple iPhone app that downloads a set of UITableView results
I've set up an Objective-C category for an iPhone app's UIImageView class. The category's
I am using NSDateFormatter to set my date in my iPhone app, and dates
I'd like to use an STL set in my iPhone app (which is written
The iPhone app that I am working on requires GET calls to a 3rd
In my iPhone app I have a UIViewController that has a UITableView and another

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.