Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

bitmap fonts and reference resolution (b19 vs b20)?

Discussion in 'UGUI & TextMesh Pro' started by rakkarage, Oct 13, 2014.

  1. rakkarage

    rakkarage

    Joined:
    Feb 3, 2014
    Posts:
    683
    in b19 bitmap fonts would use reference resolution to scale like these images show
    http://docs.unity3d.com/460/Documentation/Manual/HOWTO-UIMultiResolution.html
    has this changed in b20 because my text is not scaling the same
    even though dynamic non-bitmap fonts do seem to scale the same
    maybe something to do with this?
    • UI: Change UI scaling behaviour. Sprite texel density is now controlled by the sprite's own pixelsPerUnit property relative to the Canvas referencePixelsPerUnit property. Text texel density is now controlled by the Canvas scale factor, so it maintains one texel per screen pixel. Graphic pixelsPerUnit property has been removed, though a read-only pixelsPerUnit property has been added to Text and Image components. PhysicalResolution component has a new property to control default sprite DPI.
    is there some way to make bitmap fonts automatically scale like they used to? like dynamic fonts still do?

    thanks
     
  2. rakkarage

    rakkarage

    Joined:
    Feb 3, 2014
    Posts:
    683
    b19

    b20
     
  3. rakkarage

    rakkarage

    Joined:
    Feb 3, 2014
    Posts:
    683
  4. Marble

    Marble

    Joined:
    Aug 29, 2005
    Posts:
    1,266
    Is there a way to reproduce the behavior shown in the second screenshot now that this issue has been fixed? I'd like to have a Text element anchored inside a Canvas but not scale with it.
     
  5. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    You are looking for the behavior to be something like this. Correct?

     
  6. rakkarage

    rakkarage

    Joined:
    Feb 3, 2014
    Posts:
    683
    in the second screenshot the text stays the same size
    and ya i was using a content size fitter and canvas scaler to make it scale without those i think it will behave like 2nd

    but ya we should all buy textMeshPro right :)
    does it deal with .fontsettings or just .ttf?
     
  7. Marble

    Marble

    Joined:
    Aug 29, 2005
    Posts:
    1,266
    @rakkarage is correct. I meant a canvas that scales with resolution and interior (anchored) text that does not.
     
  8. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Although TextMesh Pro can work with Bitmap fonts which is what Unity currently uses, TextMesh Pro was designed to use Distance Field as it's primary font rendering. The main advantage is that (1) only one font asset is needed to render the font at any point size or resolution. (2) Adding a stroke, soft shadow, dilation, bevel, glow, etc is all dynamic and essentially a different material being applied to the font asset. So from (1) Font Asset created with the built-in Font Asset Creator (from a .TTF or TrueType font), you get an unlimited number of visual styles which renders perfectly at any point size and resolution.

    Here is a short video that kind of explains some of this.


    For more information, check out the links in my signature. There are additional advantages to using TextMesh Pro which relate to improve control over the layout of the text. Things like justified text, character, line and paragraph spacing control, kerning, enhanced Rich Text Tag, etc...