Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Why fonts look so strange? May be I do something wrong? — Gideros Forum

Why fonts look so strange? May be I do something wrong?

romkaromka Member
edited October 2013 in General questions
In attach you can find the screenshot. Upper word is a sprite, lower word is a TextWrap which uses font Biko:
local font = TTFont.new('resources/fonts/ttf/Biko_Regular.ttf', 24, nil, true)
self.level = TextWrap.new('Level', 100, 'left', 2, font)
I also tried to use class Font instead of TTFont with the font generated by GiderosFontCreator from the same file Biko_Regular.ttf. But in this case result were even worse then on screenshot.

How to make text in textfield look better? In nearby topic I found the game Cosmo Ship and fonts in this game looks great!
fonts.png
151 x 134 - 3K

Comments

  • Try it in same resolution in player and in application.
  • This screenshot was made in Gideros Player on my Samsung Galaxy S4 (resolution 1080x1920). These two words I put near each other on screen, it means that these two words from one screenshot, not from different.
  • tkhnomantkhnoman Member
    edited October 2013
    I'm not sure what is the problem, but i also use Gideros Font Creator for Cosmo Ship, with font size at 50, then i do something like text:setScale(size / 50,size / 50) to set fontsize.
  • petecpetec Member
    edited October 2013
    @romka I've no idea what happens in TextWrap as I don't use it but I've had similar problems with ttf fonts when the position of the text is not a whole number - often caused by me using self.textLine:getWidth()/2 to centre the text. If the width of the text is an odd number then width/2 will be something and a half. I find if I do math.floor(self.textLine:getWidth()/2) to keep the x position a whole number the text displays cleanly. Could something like that be causing the problem inside TextWrap?

  • Also try creating font without nil, like:
    local font = TTFont.new('resources/fonts/ttf/Biko_Regular.ttf', 24, true)
    And yes another is the positioning, use only full pixels, without decimal parts
  • Guys, thank you for your answers. This problem was because I set scale for TextWrap object to values from 0.5 to 2. Now if I need to resize text block I change value of font size in TTFont.new() and fonts look good.
Sign In or Register to comment.