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

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Dynamic font support for NGUI
« Reply #75 on: February 05, 2013, 08:17:18 AM »
I just want to verify; none of you guys can do clipping with the dynamic fonts right? I'm trying to make a shader to handle it, but I'm a complete nub in shaders. :S

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Dynamic font support for NGUI
« Reply #76 on: February 06, 2013, 05:24:18 AM »
After hacking at it most of yesterday I got some shaders that cover dynamic fonts with alpha clipping and without clipping. I think maybe Unisip made something similar or even identical earlier in the thread, but I didn't see it until now and banged my head against these shaders for a while.

Anyways, here take take.

adam718

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 60
    • View Profile
Re: Dynamic font support for NGUI
« Reply #77 on: February 13, 2013, 10:00:45 PM »
Wow, Great WORK!!!
I will also test it in several cases, and will contribute as possible as I can.

Otherwise, I hope Aren consider this feature as NGUI is widely used in many countries.

jeldrez

  • Sr. Member
  • ****
  • Thank You
  • -Given: 8
  • -Receive: 4
  • Posts: 352
    • View Profile
Re: Dynamic font support for NGUI
« Reply #78 on: February 15, 2013, 09:55:24 AM »
I'm having this issue now:

Assets/NGUI/Scripts/UI/UIFont.cs(921,64): error CS1501: No overload for method `ParseSymbol' takes `3' arguments

I just update NGUI to version 2.3.3b and Unity v 4.0.0f7 and applied the Dynamic Font package.

Anyone knows?

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Dynamic font support for NGUI
« Reply #79 on: February 15, 2013, 12:24:42 PM »
Probably just something in the newest version of NGUI breaks it. I'll take a look on monday, since I'm using it in a new project as well.

I would have been nice if it was built in to NGUI by default..hint hint nudge nudge.  8)

jeldrez

  • Sr. Member
  • ****
  • Thank You
  • -Given: 8
  • -Receive: 4
  • Posts: 352
    • View Profile
Re: Dynamic font support for NGUI
« Reply #80 on: February 15, 2013, 12:28:29 PM »
I would have been nice if it was built in to NGUI by default..hint hint nudge nudge.  8)
Yeahh, this should be into NGUI!

Thanks Nicki!
I would really appreciate the help.

Regards,
Emilio

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Dynamic font support for NGUI
« Reply #81 on: February 18, 2013, 04:22:58 PM »
I did take a look and got it sorta integrated, but it's offsetting the text right now, so I have to mess with it some more.

jeldrez

  • Sr. Member
  • ****
  • Thank You
  • -Given: 8
  • -Receive: 4
  • Posts: 352
    • View Profile
Re: Dynamic font support for NGUI
« Reply #82 on: February 18, 2013, 05:20:00 PM »
Wow, thanks Nicki!
Waiting for your solution.

PS: I checked out your Subway Surfers game and I've already spend hours playing it, great work!

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Dynamic font support for NGUI
« Reply #83 on: February 19, 2013, 04:00:42 AM »
So this was made for 2.3.3f and we've since moved to 2.3.3h, but I don't think anything has changed in fonts since then. In any case, these files work properly.

ArenMook, if I were to clean it up a little and made a pull request, would you consider letting it into the mainline?

jeldrez

  • Sr. Member
  • ****
  • Thank You
  • -Given: 8
  • -Receive: 4
  • Posts: 352
    • View Profile
Re: Dynamic font support for NGUI
« Reply #84 on: February 19, 2013, 08:55:05 AM »
Thanks a lot Nicki!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Dynamic font support for NGUI
« Reply #85 on: February 19, 2013, 09:10:45 AM »
@Nicki: You have Pro, so you can submit pull requests at your leisure. But yeah, make sure it's all proper-ish  :)

adam718

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 60
    • View Profile
Re: Dynamic font support for NGUI
« Reply #86 on: February 21, 2013, 02:39:47 AM »
So this was made for 2.3.3f and we've since moved to 2.3.3h, but I don't think anything has changed in fonts since then. In any case, these files work properly.

ArenMook, if I were to clean it up a little and made a pull request, would you consider letting it into the mainline?

Hi Thank you.
I replaced UIFont.cs and other 3 files.
I tested it in Chat Window. but when I was typing chinese or korean, text was not displayed immediately, only shown after the character is completed.
And this problem happens when I use BMFont and TTF(dynamic font) (it works well in NGUI ordinary version)

ngui 2.3.3,
unity 4.0.1.

dynamic font function is not suitable for typing?

Thank you.
« Last Edit: February 21, 2013, 02:42:57 AM by adam718 »

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Dynamic font support for NGUI
« Reply #87 on: February 21, 2013, 03:29:59 AM »
Ooh, if I remember correctly, the sign in Chinese is put together pressing multiple characters in a row right? It MAY be that it only writes a character to the texture once it's completely finished. In the regular bitmap version, it changes between characters on the way to the final one.

XeNoTimE

  • Guest
Re: Dynamic font support for NGUI
« Reply #88 on: February 21, 2013, 05:18:45 AM »
You're awesome^_^

Recently I was also working on Dynamic font support for NGUI.I used a similar mothed just as you offered. A problem puzzled me.You know,I just used the Panel Clipping(Soft Clip) to make a Scrool List.But it did not work normally,I mean the clipping bounder could not clip the Lables.I have tried some shaders,including the Shaders you offered  (specified shaders for dynamic font such as "Unlit - Transparent Colored (DynamicFont)"....).

Then I used the  "Unlit - Transparent Colored (Packed)" shader offered in Ngui's new edition and It really worked.Unfortunately,The color of Lables chaged and became another color that was similar to the original color.

Have you ever encountered such problem.Please give me some help,3Q O(∩_∩)O~

+1. I have the same problem (Soft clipped panel with UIGrid and UILabel elements). Whichever shader I use from Unlit - Transparent Colored (DynamicFont) serie, I have either a clipping problem or simply the text not shown. The others UILabel work good. I'm using NGUI 2.3.3 with the last modified UIFont, UIFontInspector and associated shaders.
Any ideas on how to correct this problem ?
Thanks in advance.

wr01r

  • Guest
Re: Dynamic font support for NGUI
« Reply #89 on: February 22, 2013, 07:42:07 AM »
Hello.
I found this problem.

UIFont.RegisterFont(UIFont font) was not call from anywhere in the UIFont.cs at February 19.
So I can see "character not found in font" message on rebuild the Texture.