By changing the main font, the fallback font changes as well. That is reasonable, since fallbacks are chosen to be similar to the main font. Using the steps outlined from How to find all fonts used in a PangoLayout - #3 by pangocoder we can see that:
- When Arial is specified, the chinese item is rendered using MS Gothic 108
- When Segoe UI is specified, the chinese item is rendered using Yu Gothic UI 108
Turns out hb_ot_layout_get_baseline_with_fallback
returns a wrong baseline for MS Gothic. I have now opened Wrong value from hb_ot_layout_get_baseline_with_fallback() w/ MS Gothic font · Issue #4311 · harfbuzz/harfbuzz · GitHub