Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. OEM / IBM-PC8 font

OEM / IBM-PC8 font

Scheduled Pinned Locked Moved C#
csharpgraphicsjsonhelp
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dale Thompson
    wrote on last edited by
    #1

    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

    D 1 Reply Last reply
    0
    • D 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

      D Offline
      D Offline
      Dale Thompson
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups