Looking at the generated PDF file with the CLI application:
stream
/F0 16 Tf
0 0 0 rg
BT
425.20 416.80 TD
(æøå) Tj
ET
endstream
endobj
8 0 obj
<<
/Type /Font
/Subtype /Type1
/Encoding /WinAnsiEncoding
/FirstChar 32
/LastChar 255
/BaseFont /Helvetica-Bold
/Name /F0
>>
endobj
The content looks to be written in ANSI/ : (æøå)
With the GUI code:
stream
/F0 16 Tf
0 0 0 rg
BT
425.20 416.80 TD
(XE6XF8XE5) Tj
ET
endstream
endobj
8 0 obj
<<
/Type /Font
/Subtype /Type1
/Encoding /WinAnsiEncoding
/FirstChar 32
/LastChar 255
/BaseFont /Helvetica-Bold
/Name /F0
>>
endobj
The content looks to be written in UTF8 : (I recognize the sequence XE6XF8XE5)
This is probably the reason the CLI application works, but
the GUI application fails. The CLI application writes the file
in the windows codepage CP1252 and the GUI application
write the file in UTF8.
The font then fails to render correctly for the UTF8 content
as it is has WinAnsiEncoding.
I expected something in the lines of:
FPage.WriteText(150, 150, RawBytestring(UTF8ToCP1252('æøå')));
to work, but is does not. (I can hand edit the generated PDF file
with the GUI, change codepage to CP1252 and type the character.
The PDF then renders correctly).
I will look into adding proper Unicode fonts to the application.
Thanks for the help.