Can I replace text while keeping the same font?

Q: Can I replace text while keeping the same font?

I can search and replace the text, but I have an problem with the font
not showing properly when I try to use the original pdf's embedded

Is there anything I need to do to render the font correctly?

if instr(elem_text,"old",1) then 'Search string found
    Dim gs As GState = element.GetGState()
    Dim current_font As PDF.Font = gs.GetFont 'Grab the font
used for the orig element
    Dim current_font_size As Double = gs.GetFontSize 'Grab the
fontsize used for the orig element

    new_str = Replace(orig_str, srch_str, repl_str, 1, -1,
    tm = element.GetTextMatrix()
    Dim itr As CharIterator = element.GetCharIterator()
    tm.m_h += itr.Current.x
    tm.m_v -= itr.Current.y

    Dim ex As ElementBuilder = New ElementBuilder
    ' Note for this orig pdf, current_font is an embedded font "Arial
    element = ex.CreateTextRun(new_str, current_font,
end if
writer.WriteElement(element) '<<<<<< Does not display properly when
Current_font is Embedded
A: Modifying text while keeping the old font can be tricky (please
search for "How do I edit PDF text" in this forum. The problem is that
the font may use custom encoding or may be missing required glyphs (if
the font is subsetted). Usually it is much simpler to use a new font
instead of the old one.

You can also swap the old font with a new one so that the font change
is applied globally to all text (please see
Unfortunately font swapping in PDF can also get tricky.