Cyrillic text not displayed in TextField

I created a very basic example:

		var format = new TextFormat ("Roboto Bold", 20, 0x7A0026);
		var textField = new TextField ();
        	textField.autoSize = TextFieldAutoSize.LEFT;
		
		textField.defaultTextFormat = format;
		textField.embedFonts = true;
	textField.text = str;

Which works as expected with Latin characters, however when I add Cyrillic text shows two “empty question mark” symbols per each character (which is 2 bytes);
I checked the same font in common html - it displays Cyrillic letters. Passing any kind of output of Utf8 class didn’t solve the issue.
Tracing Cyrillic strings shows correct character in the console.

The font is in ttf format. The issue reproduces in neko/html5/ios/mac.

Any help would be appreciated.

I’m new to Haxe/Openfl, so it might be a stupid question. However I’m about to implement a custom bitmap font to bypass the issue :grinning:

Hello, I think your font doesn’t have cyrillic characters. I guess your browser switches the font to display it correctly. Can you check if your font has the cyrillic characters? Maybe you can try to download it from here and click on customize and then cyrillic. https://fonts.google.com/specimen/Roboto?selection.family=Roboto

this is the css I used for testing, it seems that the browser can not tell which font to use for replacement:
@font-face {
font-family: “rob”;
src: url(“r.ttf”);
}
button{
font-family: “rob”;
}

I tried downloading from google and from other sources but with no luck.
I can provide a sample if needed

solved: I used a for loop for adding text as separate letters, so I got only half of a Cyrillic letter for my TextField :grinning:

1 Like

glad you find a solution.