Emgu-CV-4.5.3 : Freetype2 class dont show correctly utf8 text

hi, i use this code for show utf8 text on image, [ Persian text, utf8 format ], but my text show inverted! - how i can fix this problem?

#region Create Image Output
Mat ImageOutput = new Mat(400, 600, DepthType.Cv8U, 3);
ImageOutput.SetTo(new MCvScalar(System.Drawing.Color.Wheat.B, System.Drawing.Color.Wheat.G, System.Drawing.Color.Wheat.R));
#endregion

#region Variables
string text = "سلام";
var centerPoint = new System.Drawing.Point(ImageOutput.Cols / 2, ImageOutput.Rows / 2);
int fontHeight = 36;
MCvScalar color = new MCvScalar(0, 0, 255);
int thickness = 1;
LineType lineType = LineType.EightConnected;
bool bottomLeftOrigin = false;
#endregion

#region Add text to image
// create an object from 'Freetype2' class
Emgu.CV.Freetype.Freetype2 freetype2 = new Emgu.CV.Freetype.Freetype2();

// set font
string windowsFontsPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Fonts);
string fontPath = windowsFontsPath + @"\Tahoma.ttf";
freetype2.LoadFontData(fontPath, 0);

// PutText
freetype2.PutText(ImageOutput, text, centerPoint, fontHeight, color, thickness, lineType, bottomLeftOrigin);
#endregion

#region Show Result
AddImage(ImageOutput.ToImage<Bgr,byte>(), "ImageOutput");
#endregion

What my code shows in the output is wrong ( it is displayed in reverse ) :
0

My codes should show this text [ when i try publish my question, site tell me "Sorry, new users can only put one embedded media item in a post.
" then i upload second image on other website ]:

  • سلام = HI :wink:

can reproduce this.

probably a bug in how opencv uses the results from freetype.

you should open an issue on opencv’s github about this.

#!/usr/bin/env python3
import numpy as np
import cv2 as cv

ft = cv.freetype.createFreeType2()
#ft.loadFontData(R"C:\Windows\Fonts\Tahoma.ttf", 0)
ft.loadFontData(R"C:\Windows\Fonts\Calibri.ttf", 0)

canvas = np.empty((400, 600, 3), np.uint8)
canvas[:] = (179, 222, 245)

text = "سلام = HI"
text = "\u0633\u0644\u0627\u0645 = HI"

ft.putText(
	img=canvas,
	text=text,
	org=(100, 200),
	fontHeight=100,
	color=(0, 0, 255),
	thickness=cv.FILLED,
	line_type=cv.LINE_AA,
	bottomLeftOrigin=True
)

cv.imshow("canvas", canvas)
cv.waitKey()
cv.destroyAllWindows()

image