makotok/Hanappe

Improvement of the issues that blur the text drawing.

Closed this issue · 8 comments

If set the scale of the Viewport, drawing text is blurred.
I do to improve the text does not blur.

Also, I kept to the compatibility problem.

Have you seen this thread?

http://getmoai.com/forums/post7450.html

Here is what I do to work around the issue, the scaleFactor is used to scale the viewport and text separately.

text:setTextSize(textSizeLarge * scaleFactor)
text:setGlyphScale(1 / scaleFactor)

Thank you for information.

How I fix is similar.
However, it is expected that without changing the code of this existing, can be enabled / disabled.

I have implemented a prototype basis.
It works well.
However, time seems to take a little.

Text was clean.

However, the cursor of the TextInput is funny.
"MOAITextBox: getStringBounds" returns a range that is different from the actual display.

It is enabled by setting the following options.

flower.Label.HIGH_QUALITY_ENABLED = true

I don't know if this is entirely related to your range problem. The numbers you are using for auto-resizing the labels are so large that it causes MOAITextBox::GetBoundsForRange to have rounding errors due the size values being float datatypes.

--- Max width for fit size.
Label.MAX_FIT_WIDTH = 10000000

--- Max height for fit size.
Label.MAX_FIT_HEIGHT = 10000000

--- default fit length.
Label.DEFAULT_FIT_LENGTH = 10000000

The values above are way too large.

I ran into this in my own private Hanappe fork. I fixed it by doing this:

M.MAX_WIDTH = 10000
M.MAX_HEIGHT = 10000
M.DEFAULT_LENGTH = 10000000

--------------------------------------------------------------------------------
-- The constructor.
-- @param params (option)Parameter is set to Object.<br>
--------------------------------------------------------------------------------
function M:init(params)
    M.MAX_WIDTH = Application.viewWidth
...

By using smaller numbers, the precision of the float values used in MOAITextBox won't be as much of an issue. Its not the best way to fix this but it improves the situation slightly.

Was resolved with the following problems.

moai/moai-dev#720

However, there is a problem with the performance.
Takes a long time to draw the Label.

I seem to have a problem with drawing performance of MOAITextBox.
I wonder Is there a way to solve?

Performance of the text is a little bad.
However, I was clear other problems.