OEM / IBM-PC8 font
-
Hello, I'm playing around with Shripad Kulkarni's C# TELNET Client - mostly refactoring what he had done and expanding it out to support ANSI (and maybe VT-100 emulation). I've just finished implementing the rest of the telnet protocol. However, I'm having problems with the font selection. I'm trying to select a font that will display the original 8-bit OEM/IBM-PC8 font (with all the line characters, etc). Here is the font I'm using: System.Drawing.Font( "Lucinda Console", 10.2F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ( ( System.Byte )( 255 ) ) ); I've tried both 0 (ANSI) and 255 (OEM) for the last argument. The text buffers go through a few Encoding.ASCII.GetString() calls too. Thanks for your help. Dale Thompson
-
Hello, I'm playing around with Shripad Kulkarni's C# TELNET Client - mostly refactoring what he had done and expanding it out to support ANSI (and maybe VT-100 emulation). I've just finished implementing the rest of the telnet protocol. However, I'm having problems with the font selection. I'm trying to select a font that will display the original 8-bit OEM/IBM-PC8 font (with all the line characters, etc). Here is the font I'm using: System.Drawing.Font( "Lucinda Console", 10.2F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ( ( System.Byte )( 255 ) ) ); I've tried both 0 (ANSI) and 255 (OEM) for the last argument. The text buffers go through a few Encoding.ASCII.GetString() calls too. Thanks for your help. Dale Thompson
Dale Thompson wrote: I'm trying to select a font that will display the original 8-bit OEM/IBM-PC8 font (with all the line characters, etc). Here is the font I'm using: System.Drawing.Font( "Lucinda Console", 10.2F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ( ( System.Byte )( 255 ) ) ); I've tried both 0 (ANSI) and 255 (OEM) for the last argument. The text buffers go through a few Encoding.ASCII.GetString() calls too. If anyone is interested, I found (guessed) the answer to this question. Unrelated to the problem - my code snippet had an error, it is "Lucida Console" (not Lucinda). But the key to the problem has to do with the "Encoding.ASCII.GetString()" calls The provided ASCII encoding only support 7 bit ASCII. This is where the translation from 16 bit Unicode to what is displayed happens - anything that is 128 or above isn't supported by the supplied ASCII encoding. The trick is to use the right codepage for the encoding. In this case, after a little research, I found that I needed to use the old IBM Codepage 437! So - using "Encoding.GetEncoding( 437 ).GetString()" corrects the problem and displays PC graphics characters! Hope this info is of use to someone out there! :) Dale Thompson