QUOTE(FlierMate1 @ Aug 17 2022, 02:34 PM)
Are you using my code? Do you mean the line splitting not working properly?
The logic behind my code is to treat each CJK char as two Roman alphabets (e.g. 'ABC'), it is far from perfect.
I think with use of space padding, you have already solved your problem.
When printing chi and eng together, the text counting is not accurate due to the font printing via POS printer for eng and chi are different, although same font size.
Below is my version in c#, I'm using a rectangle to wrap the text, so text will auto goes to next line.
CODE
Size size = TextRenderer.MeasureText(TextToPrint, CustomFont1, new Size(240, 16), TextFormatFlags.WordBreak);
Rectangle rectF1 = new RectangleF(50, (Offset + 20), size.Width + 20, size.Height);
graphics.DrawString(TextToPrint, CustomFont1, Brushes.Black, rectF1);