Fix Heap-buffer-overflow in TextPage::updateFont

Bug #76442