Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Custom font issues

I am using a custom font. However, I want to use a different weight (ie bold). Setting fontWeight to bold in the font object does not do it.

It seems I need the bold version of the same font. I tried adding this bold version of the font but could not get it to work.

Anyone know how to use a custom font including different weights in the same font family?

I am using Titanium 1.2.1 and iOS SDK 4.2

— asked November 11th 2010 by Ken Woodward
  • custom
  • font
  • fontweight
  • mobile
0 Comments

3 Answers

  • Let's say you have 2 fonts that are the same name but different weights. (ie: (Museo300-Regular.otf and Museo500-Regular.otf)
    After you go through the install, plist etc. mentioned above, you do this:
    font: {
    fontFamily:'Museo-300',
    fontSize:24
    }
    or

    font: {
    fontFamily:'Museo-500',
    fontSize:24
    } .

    This worked for me : )

    — answered July 13th 2012 by dw fresh
    permalink
    0 Comments
  • Ken

    You have not provided your dev platform and SDK.
    Please see this information about the fonts supported on each platform.

    Cheers

    — answered November 13th 2010 by Paul Dowsett
    permalink
    0 Comments
  • Has anyone solved this issue yet? I'm having the same issue with the font Rockwell. I'm trying to only use Rockwell Bold, but it only shows up as Rockwell Regular.

    I even tried to resave the bold version of the font in a font editor program to Rockwell Regular, and still no dice.

    Any suggestions? My last resort is to find a font similar to Rockwell Bold and use that instead.

    I'm using Titanium 1.7.5 and iOS SDK 5.0

    — answered January 13th 2012 by Mark Goldsmith
    permalink
    1 Comment
    • Ok nevermind, I just figured out the solution that worked for me (and Rockwell font). I found the solution here:
      http://stackoverflow.com/questions/6109610/using-a-custom-font-with-bold-text-in-a-uilabel

      So the steps I took were:

      I followed this video tutorial to add the fonts:
      http://www.rafaelhernandez.org/custom_fonts.mov

      I added both Rockwell.ttf and Rockwell_Bold.ttf to the Resources folder, and then added both to the Info.plist in the root of my project.

      Then instead of naming the font weight I called Rockwell Bold like this:

       font: {
                fontFamily:'Rockwell-Bold',
                fontSize:16
               }
      

      — commented January 13th 2012 by Mark Goldsmith
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.