How does the Viewer Pane display the text file fonts: with a default font or the actual file fonts?

Hi,

I need to create a text file with paragraphs in many different fonts for Ocular AI OCR font training. I have created such a file with Microsoft Word. I saved it as a Windows text file. According to Google Generative AI:

To save a Microsoft Word document "as a text document" while retaining different fonts, open the "File" menu, select "Save As," choose "Plain Text (.txt)" as the file type, and then click "Save" - this will preserve the various fonts within the text file despite stripping away most other formatting elements.

Key points to remember:

** "Save As" option: Access the "Save As" option in the "File" menu to choose a different file format.*
** "Plain Text (.txt)" format: Select "Plain Text (.txt)" as the save type to create a text document.*
** Formatting limitations: While different fonts will be maintained in the text file, other formatting like bold, italics, or alignment may not be fully preserved.*

I need to be absolutely sure that my text file actually has all the different fonts I used. Unfortunately, I cannot do this by opening this file in a text editor. All the text editors I have used seem to display any text file (other than those they have created) they open in their default font.

(I want to create my font text file using VBA/code. It's 150 pages and changing the font of several hundred paragraphs manually would be tedious).

I have used the Directory Opus Viewer Pane (F7) to view my font text file without opening it. The pane reveals all the paragraphs I created to be in same font.

When I tried to display a Word document Alasassy Caps all that was displayed was an image: a square box containing a page of paper slightly folded at the top right hand corner and with a) lines across it (probably representing text) b) two large thick arrows at 45 degree angles pointing at each other. I would guess this is a symbol for a text document with content (a font?) that cannot be displayed.

When I saved a Word document using the Arial Black 12pt font I got the same font as I did when I viewed by text font file. Finally, in my text font file some font paragraphs displayed in Viewer Pane contained not text but about seven lines of question marks (?): ????????????. I assume this was text in a font that could not be displayed - the font in question is presumably not in the D/Opus Viewer Pane program.

Finally I created a text fiile using Vovsoft Text Edit Plus using Terminal 14pt font. I was able to save it using this format and open it again in Text Edit Plus in Terminal 14pt font. However, when I viewed it in the D/Opus Viewer Pane the font was anything but Terminal 14pt font. It very much looked like the same font that was displayed in every other file I viewed using the D/Opus Viewer Pane.

From my experiments of saving Word documents using different fonts as text files (described above) I would have to conclude that the D/Opus Viewer Pane does not display text files as they are, but displays them using a default font that is different than the font they were created and saved in.

So, 1) am I right in this assumption 2) is there any way of using D/Opus to view the actual font used in a text file rather than the default font D/Opus uses (presumably) to display text files 3) do you happen to have any suggestions, like other software, for how I might confirm that the fonts I used in a Word document that is then saved as a text document are actually the fonts used in that text documents.

I thank you in advance for your help and suggestions.

Text files don't contain any fonts or any formatting at all.

The AI made that up and is talking nonsense. Plain text files don’t have fonts, by definition. They are just the text itself.

You can change the font Opus’s plain-text viewer uses if you want, but that will affect all plain-text files displayed using it.

None of this really involves Opus. You’ll see the same results in all tools that can display plain-text files.

Thanks for enlightening me. So much for AI. I very much take your obvious point that plain text files cannot, virtually by definition, contain anything other than one, the default, font.

However, the AI OCR program I'm using, Oclar wants me to load text files so the program can do font training. I can't see this would make any sense if you cannot have text files with different fonts. The preceding step before font training is loading text files for language training. If all text files have only one font (though I suppose different text editors/creators could have different default fonts) then the second step, font training, would be redundant.

I would have thought that programmers who work with AI and OCR would have been aware of the unformity of fonts across text files. I guess not, but it still strikes me as odd.

Thanks again for setting me on the right path and saving me from a lot of useless labor.

It's not that plain text files have uniform fonts, it's that they have no fonts.

It's like listening to the radio and wondering what font is being used. The question itself is meaningless.

When a text file is displayed, a font is used by the program that displays it, but this isn't specified by the text file itself.

If your OCR program is Ocular (Ocular Github) then, this is not what is requested.
It seems you first need to initialize the font model (here you can provide a list of font names that are installed on your system), then to train the model with provided plain text files.
The program will generate rendered versions of the text files with the selected fonts.

Anyway, everything you'll need to do is to be asked on this github, not here.

Thanks again. I fully understand now. Apologies for wasting your time.