Critical Performance Issue & Deadlock in Build 5570/5572 - Blend2D Font Rendering Engine with Non-ASCII (CJK) Characters

 

Description: Since the introduction of the Blend2D rendering engine in Build 5570 (and persisting in 5572), the terminal experiences severe unresponsiveness or complete deadlocks when using non-ASCII character sets (specifically Simplified Chinese, font "Microsoft YaHei").

This is a significant regression in the UI framework's performance and stability.

Technical Analysis & Observations:

  1. Rendering Bottleneck: When #define CONTROLS_FONT_NAME is set to a Chinese font (e.g., "微软雅黑"), the terminal freezes immediately upon loading any indicator or EA that utilizes the Controls library.

  2. Glyph Processing Failure: Even with standard fonts like "Arial", there is a noticeable lag compared to previous builds. This suggests that the Blend2D integration layer is failing to properly cache font handles or is re-indexing the font face on every frame (OnPaint/OnChartEvent).

  3. Encoding/JIT Conflict: The issue appears to be located in the interface between MQL5's UTF-16 string handling and Blend2D’s font rasterization pipeline. For complex glyphs (Chinese/Arabic), the JIT compiler or the Atlas allocator seems to enter an infinite loop or trigger excessive memory reallocation, leading to a Main Thread deadlock.

Steps to Reproduce (Minimal Demo):

// This code causes an immediate freeze in Build 5570/5572
input string mFontName = "微软雅黑"; // Microsoft YaHei

#include <Controls/Defines.mqh>
#undef CONTROLS_FONT_NAME 
#define CONTROLS_FONT_NAME mFontName

// Load any standard Control-based Indicator/EA

Environment:

  • MT5 Version: Build 5570, 5572 (latest).

  • OS: Windows 10/11 (Chinese Simplified Locale).

  • Hardware: Observed across multiple CPU architectures (AVX2 supported).

Request: Please investigate the font face mapping and glyph caching logic within the new Blend2D implementation. The community needs a fix or a toggle to fallback to the legacy GDI/GDI+ rendering for non-English locales until the JIT rendering for multi-byte characters is stabilized.

 
Thank you. Transmitted.