VOGONS


First post, by aiodev

User metadata
Rank Newbie
Rank
Newbie

Hello everyone, how are you? Please, how can I change the font in Dosbox?

Because I want to use Dosbox to use a text editor for coding HTML, CSS, etc...

Because even though I have set the keyboard layout to 'br' (for Brazil) in the configuration file and these characters appear in the text editor itself, when I save the file to open it in the browser on my physical machine (Linux), the special characters appear bugged, which suggests that if I change the font (which comes complete), this can be resolved.

But since I don't know how to do it (despite having looked well), I came here to ask for help, thank you.

Reply 1 of 4, by jtchip

User metadata
Rank Member
Rank
Member

By special characters do you mean non-ASCII characters like letters with accents and cedillas (e.g. ê, ç)? Then it is likely a character encoding issue. Linux usually assumes UTF-8 encoding whereas DOS uses code pages which specify a different characters for the 128-255 range, usually 437 for US English and 850 for Western Europe.

It's not a font issue since, as you say, it looks fine in DOS. Either set the text editor to use UTF-8 (probably impossible as period correct editors don't support that) or convert the file to UTF-8 in Linux. Some Linux text editors like KWrite can interpret the open text file as different character encodings (second option from the right in the status bar at the bottom) and then save it as a different encoding (File..Save As with Encoding).

Reply 2 of 4, by aiodev

User metadata
Rank Newbie
Rank
Newbie

Hello, how are you? Sorry for the delay.
I came to the conclusion that the problem is really the font, because I opened an .html file in Fed (text editor) within Dosbox and the special characters were bugged, and I also came to this conclusion due to the fact that, in the Dosbox configuration file, it changes the keyboard layout and not the font.

So I really will have to change the font, and even after searching a lot on the internet I couldn't find it, so, does anyone please know how to do this, that is, change the font in Dosbox? Thanks.

Reply 3 of 4, by jtchip

User metadata
Rank Member
Rank
Member

Which character encoding does the HTML file use? I tried keyb br in DOSBox and it loads code page 858, essentially 850 with the Euro (€) symbol. You can change the code page with keyb br 850 or a different code page. FED does not support UTF-8, you have to convert the encoding of the HTML file to a code page that DOS supports (and then make sure the metadata specifies the correct code page so that it displays correctly in a web browser), if you really want to edit it in DOS.

Even if a DOS text editor supports UTF-8, it'll have to use graphical mode because text mode only supports 8-bit characters, which isn't sufficient to display the wide variety of Unicode characters.

Reply 4 of 4, by Jo22

User metadata
Rank l33t++
Rank
l33t++

Back in the late 90s/early 2000s it wasn't uncommon to use HTML entities.
Especially since popular OSes like Windows 98 didn't support Unicode yet.

https://en.wikipedia.org/wiki/HTML_entity
https://www.freeformatter.com/html-entities.html

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//