Author Topic: UIPopupList with reference font  (Read 3089 times)

netics

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 16
    • View Profile
UIPopupList with reference font
« on: July 18, 2017, 02:20:20 AM »

There is a bug when using reference font on UIPopupList.
When I set a reference font for UIPopupList, it converted to concrete font automatically.

There is a problem in auto-upgrade code for old version.
It should be change to

UIPopupList.OnEnable
  1.                 // Auto-upgrade to the true type font
  2.                 if (trueTypeFont == null && bitmapFont != null && bitmapFont.isDynamic)
  3.                 {
  4.                     if( bitmapFont.replacement == null )
  5.                     {
  6.                         trueTypeFont = bitmapFont.dynamicFont;
  7.                         bitmapFont = null;
  8.                     }
  9.                 }
  10.  

UIPopupList.OnValidate
  1.                 else if (fnt != null)
  2.                 {
  3.                     // Auto-upgrade from 3.0.2 and earlier
  4.                     if (fnt.isDynamic)
  5.                     {
  6.                         if( fnt.replacement == null )
  7.                         {
  8.                             trueTypeFont = fnt.dynamicFont;
  9.                             fontStyle = fnt.dynamicFontStyle;
  10.                             fontSize = fnt.defaultSize;
  11.                             mUseDynamicFont = true;
  12.                         }
  13.                     }
  14.                     else
  15.                     {
  16.                          bitmapFont = fnt;
  17.                          mUseDynamicFont = false;
  18.                     }
  19.                 }
  20.  

Thank you.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIPopupList with reference font
« Reply #1 on: July 22, 2017, 02:37:38 PM »
Thanks, I'll make the changes.