Closed paulocoutinhox closed 6 months ago
What is wrong?
Have you followed it with a debugger to narrow down where the issue is occurring?
Sure. Im try debug but i don't understand why it is cutting the chars that is not in the original text. I read all the source code, step by step with debug, but don't make sense to me.
The steps is:
void GBasicTextField::setTextFieldText()
{
if (_templateVars != nullptr)
_label->setText(parseTemplate(_text.c_str()));
else
_label->setText(_text);
}
That call FUILabel.cpp setText:
void FUILabel::setText(std::string_view value)
{
if (_fontSize < 0)
applyTextFormat();
setString(value);
}
That call core/2d/Label.cpp method setString:
void Label::setString(std::string_view text)
{
if (text.compare(_utf8Text))
{
_utf8Text = text;
_contentDirty = true;
std::u32string utf32String;
if (StringUtils::UTF8ToUTF32(_utf8Text, utf32String))
{
_utf32Text = utf32String;
}
}
}
And when i changed the text, it set the new string, "text" in my sample, without problems:
Don't appear be nothing specific with FairyGUI, since it use Axmol Label.
And the TTFConfig of Axmol label is this:
The font is ok, it generate the first text of label without problems.
The problems happen when i change the label string/text.
Don't appear be nothing specific with FairyGUI, since it use Axmol Label.
Have you tested the same font with an ax::Label
to see if it has the same issue? If it does not have an issue, then you should compare the behaviour of a standard ax::Label
with that of the one used by FairyGUI. Follow it in the debugger to the construction of the texture from the text itself, and you should be able to spot the difference.
Hi, sure. Is this I'm doing, but without success. I'm debugging but do not discover the problem.
Hi,
I think that there is wrong in my current project, because i create another sample with FairyGUI and axmol Label, and both works fine :(
In test project it works on both devices.
In my real project it have problems on Android only:
I solve the problems settings correct resolution in design resolution and the text problems is related to threads, because i call JNI somethings and it don't render when come from JNI call (i dont know why, but i call on callback the method runInAxmolThread). Thanks.
BEFORE CHANGE TEXT
AFTER CHANGE TEXT
The letter "x" that is not in design mode don't appear when new text have it.
Code:
What is wrong?