Author Topic: Dynamic font support for NGUI  (Read 70836 times)

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,764
    • View Profile
Re: Dynamic font support for NGUI
« Reply #90 on: February 22, 2013, 10:04:48 AM »
Hmm, I've seen that too, but it hasn't had any problems; all the characters are shown. Odd.

fredxxx123

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
Re: Dynamic font support for NGUI
« Reply #91 on: February 22, 2013, 09:42:54 PM »
Hmm, I've seen that too, but it hasn't had any problems; all the characters are shown. Odd.

I had problem for that, issued when dynamic font rebuild texture.
In previous version, 'RegisterFont' was called before 'RequestCharactersInTexture'.

  1.             //JUDIVA, include symbols in font
  2.             RegisterFont(this);
  3.             if (UseDynamicFont)
  4.                 dynamicFont.RequestCharactersInTexture(text, dynamicFontSize, dynamicFontStyle);
  5.  

Before add 'UIFont.RegisterFont(UIFont font)', that can't make 'UILabel' changed flag(content will be incorrect) when font rebuild in my case.
thanks you  ;)

wr01r

  • Guest
Re: Dynamic font support for NGUI
« Reply #92 on: February 24, 2013, 09:32:06 PM »
I can see this problem when using UILabels 2 or more.
If texture rebuild by updating label.text, Other labels didn't call RequestCharactersInTexture().
Other labels collapsed.
Because didn't call textureRebuildCallback, and others label didn't call MarkAsChanged().

XeNoTimE

  • Guest
Re: Dynamic font support for NGUI
« Reply #93 on: February 25, 2013, 09:08:42 AM »
I post a video link showing the problem so that everybody understands it.
http://youtu.be/2-kKQyFGzo8

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,764
    • View Profile
Re: Dynamic font support for NGUI
« Reply #94 on: February 25, 2013, 10:55:17 AM »
Xeno: You need a soft clipping shader made for the dynamic font. I'll see if I can manufacture one. :)

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,764
    • View Profile
Re: Dynamic font support for NGUI
« Reply #95 on: February 26, 2013, 05:18:37 AM »
This should work, although I'm not a shader expert, so please check my work and fix anything broken. ;)

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,764
    • View Profile
Re: Dynamic font support for NGUI
« Reply #96 on: February 26, 2013, 10:13:19 AM »
I'm working on a pull request to push this into the mainline of NGUI, but it's tricky, because NGUI has to support unity 3.5 as well, so everything has to be done delicately. Hopefully, it will be included soontm. ;)

XeNoTimE

  • Guest
Re: Dynamic font support for NGUI
« Reply #97 on: February 26, 2013, 01:14:38 PM »
Hi Nicki.
Thank you for your fast and efficient work !  :)
It works great on my list with soft clipping but not with standard unclipped UILabel which do not show.
So I think I must use for these labels another dynamic font with normal "Unlit - Transparent Colored (DynamicFont)" shader, if I am not mistaken.  ;)

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,764
    • View Profile
Re: Dynamic font support for NGUI
« Reply #98 on: February 26, 2013, 03:33:37 PM »
You should be able to use the DynamicFontShader I provided higher up for that. You should always use that on your materials, then UIPanel will switch to the other ones when needed.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,764
    • View Profile
Re: Dynamic font support for NGUI
« Reply #99 on: February 26, 2013, 03:34:34 PM »
Do remember that since they use their own material, you have to move the Label forward on the Z position, or it will likely be hidden behind other widgets. I usually keep my labels at -1, while the rest is at 0.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 327
  • -Receive: 1153
  • Posts: 22,063
  • Toronto, Canada
    • View Profile
Re: Dynamic font support for NGUI
« Reply #100 on: February 26, 2013, 07:27:24 PM »
I've received the pull request, Nicki -- and I will check it out soon-ish. Caught up in some things atm.

jeldrez

  • Sr. Member
  • ****
  • Thank You
  • -Given: 8
  • -Receive: 4
  • Posts: 352
    • View Profile
Re: Dynamic font support for NGUI
« Reply #101 on: February 27, 2013, 08:12:21 AM »
Do remember that since they use their own material, you have to move the Label forward on the Z position, or it will likely be hidden behind other widgets. I usually keep my labels at -1, while the rest is at 0.

I usually have this issue.

jeldrez

  • Sr. Member
  • ****
  • Thank You
  • -Given: 8
  • -Receive: 4
  • Posts: 352
    • View Profile
Re: Dynamic font support for NGUI
« Reply #102 on: February 28, 2013, 08:29:54 AM »
hey, I'm the only who see little black pixels around the font sometimes? Mainly when it's a small label.
I really want to use dynamic fonts in my project because I have to localize them into EFIS more Japanese and Korean, and it's going to be a lot of textures if I do it the old way (BmFont), but this issue how it looks I don't know how to fix it. Somebody knows?

rockafnan

  • Guest
Re: Dynamic font support for NGUI
« Reply #103 on: March 01, 2013, 05:58:40 AM »
Hi, I've this odd issue coming... the font size set in font is 60 and if make the UIFont prefab with same size (60) is looks fine but If I set the font size in prefab to 30, it looks like in the attached screenshot.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,764
    • View Profile
Re: Dynamic font support for NGUI
« Reply #104 on: March 01, 2013, 06:41:58 AM »
You also have to set the font size on the ttf file.