Author Topic: How to make bold or italic font by NGUI  (Read 13542 times)

lzt120

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 68
    • View Profile
How to make bold or italic font by NGUI
« on: May 31, 2012, 04:16:31 AM »
How can I make the font to be bold or italic ?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How to make bold or italic font by NGUI
« Reply #1 on: May 31, 2012, 07:29:58 AM »
By creating a new font. :P

I personally just change the font's color to emphasize something.

lzt120

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 68
    • View Profile
Re: How to make bold or italic font by NGUI
« Reply #2 on: June 28, 2012, 02:24:52 AM »
this would be complicated. if can add some function to do it by coding ?

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: How to make bold or italic font by NGUI
« Reply #3 on: June 28, 2012, 03:19:50 AM »
Bitmap fonts do not work that way.

The most you could do is to add a outline in the same color to make it pseudo-bold.

Remember that bold and italic fonts are actually different glyphs that the regular ones. Because just slanting regular ones look like crap.

Just make a secondary and tertiary font for your effects (it will suck for doing inline changes though).

Maybe @ArenMook could do some magic so you can use multiple fonts files for a single label, if you want bold / italic. ;)

DrLoomis

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Re: How to make bold or italic font by NGUI
« Reply #4 on: October 22, 2012, 06:09:55 PM »
Hey guys, I'm running into the same question and have a few follow-ups:

1) Is it possible to selectively add an outline or shadow to specific words within a label, or is it all-or-nothing per-label? For example, is there a way to create the following sentence in one label, using the outline/shadow features as pseudo-bold?

     Walk to the door and press the button to proceed.

2) If not, is there any way to create two fonts (one normal, one bold) and use both of them in the same label to achieve the result above? Or would I need to get fancy and do some sort of overlay where there are two labels in the same spot and the normal words are printed in one label and the bold ones are printed in another, and I have to make the non-bold/non-normal words invisible in the respective labels to keep things in line (just one idea)?

Basically, I'm just looking for any way to highlight specific words on a label. I realize you can do it with color, but in my UI I'm emulating a typewriter with black ink so it's hard to justify why certain words would be typed in red.  :)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How to make bold or italic font by NGUI
« Reply #5 on: October 22, 2012, 08:02:24 PM »
No and no. If you want to highlight something, just change its color using [RrGgBb] syntax. But... seeing as you said you use a black text... that's more complicated for you. I can't suggest anything.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: How to make bold or italic font by NGUI
« Reply #6 on: October 23, 2012, 03:36:37 AM »
Ok, I can think of possibly one way of doing it, but you're probably not gonna like it.

Remember the video about adding emoticons to the font? You can add bold and italic characters as "smileys" that are triggered by some combination of characters.

For instance:
My italic text is bold
Could be: "My /i/t/a/l/i/c text is *b*o*l*d"
You just have to add them all manually to the atlas and font file.

http://www.youtube.com/watch?v=JbqfK3mU140