Author Topic: New fonts imported with an outline  (Read 5967 times)

DrLoomis

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
New fonts imported with an outline
« on: June 10, 2013, 05:19:31 PM »
I have a number of fonts I created many weeks ago. I'm not sure what version of NGUI I used, but it was certainly pre-2.6. These fonts all work fine.

I tried to create some new fonts today, and before I ran into the "creating a new font crashes Unity" bug I successfully created one font. However, the newly-created font had an outline around it. The outline was within the boundaries of the letters themselves; selecting "outline" from the encoding dropdown added an additional outline outside of the letters, as expected.

I was confused by this behavior, so as a test I went and created a new font using the exact same png and txt files I used to create my working fonts weeks ago. Those new fonts also had the outline.

What has changed with font importing? How do I disable these outlines? The issue is clearly with NGUI, given that it occurs with the exact same source files that previously created fonts without outlines in pre-2.6 versions.

OS X 10.8.4
Unity 3.5.7f6

Image attached.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: New fonts imported with an outline
« Reply #1 on: June 10, 2013, 11:26:59 PM »
That "outline" you are seeing tells me that you have glyphs not only in Alpha, but also in RGB channels -- which -- if you watch the video carefully -- is wrong. RGB channels must be white.

DrLoomis

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Re: New fonts imported with an outline
« Reply #2 on: June 11, 2013, 12:42:23 PM »
They are white. Like I said, I created these from the exact same files that previously worked in 2.5.x. The only thing that changed was upgrading NGUI.

In fact, yesterday while I was making fonts over and over and over again because of continued crashing, a few times I got those files to produce normal fonts without outlines.

It's impossible that this is a bug with the source files, unless 2.5.x had its own bug that was causing my original source files (which have worked for ... 9 months or so) to come out fine, and then 2.6.x "fixed" the bug and started making the same source files have an outline, but only sometimes.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: New fonts imported with an outline
« Reply #3 on: June 11, 2013, 12:58:43 PM »
Do you have pre multiply alpha checkbox enabled in the Atlas Maker? That would cause it to be black.

DrLoomis

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Re: New fonts imported with an outline
« Reply #4 on: June 11, 2013, 01:03:50 PM »
That was indeed selected. I recreated the font, then unchecked the box and updated the atlas and that seems to have fixed it. Thanks!

gretty

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 13
    • View Profile
Re: New fonts imported with an outline
« Reply #5 on: December 01, 2013, 07:10:55 PM »
Sorry for reviving an old thread but I am getting the exact same problem.

I have tried ArenMook's advice to 'have pre multiply alpha checkbox enabled' but my NGUI Atlas Maker doesn't have that option (see screen capture below). How do I set the pre multiply alpha checkbox?


gretty

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 13
    • View Profile
Re: New fonts imported with an outline
« Reply #6 on: December 02, 2013, 04:45:17 AM »
No responses :(

Agent_007

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 5
  • Posts: 27
    • View Profile
Re: New fonts imported with an outline
« Reply #7 on: December 02, 2013, 08:46:12 AM »
Quote
NGUI Atlas Maker doesn't have that option (see screen capture below)
You aren't using latest NGUI version?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: New fonts imported with an outline
« Reply #8 on: December 02, 2013, 08:53:27 AM »
Open up the font's texture in photoshop and set the RGB channels to pure white. Only the alpha should have visible glyphs in them.

gretty

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 13
    • View Profile
Re: New fonts imported with an outline
« Reply #9 on: December 02, 2013, 05:20:52 PM »
Thanks for the replies :) Its very much appreciated.

I am using the free version and I have the latest free version AFAIK - upon checking the readme file in the NGUI folder it says version 2.0.7c although I did just download the free version on the home page and upgrade (I had an older version yesturday) so this readme might be from the old version.

Open up the font's texture in photoshop and set the RGB channels to pure white. Only the alpha should have visible glyphs in them.

Do you mean make all the text white or make all the background white (and the text black)? Below is my .tga that was produced using BMFont - the text is already white and my BMFont export settings (notice the RGBA values - are these correct?). Maybe I should be producing a .bmp or .png instead of a .tga?

   

Is this how it should be?
« Last Edit: December 02, 2013, 05:26:06 PM by gretty »

ChrisR

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 33
    • View Profile
Re: New fonts imported with an outline
« Reply #10 on: December 03, 2013, 06:02:53 AM »
Not quite!  You want the following settings:

A: Glyph
R: One 
G: One 
B: One


gretty

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 13
    • View Profile
Re: New fonts imported with an outline
« Reply #11 on: December 03, 2013, 08:30:17 PM »
Not quite!  You want the following settings:

A: Glyph
R: One 
G: One 
B: One



Awesome that fixed it! :D Thanks ChrisR