0 Replies Latest reply on Feb 12, 2008 3:09 AM by happybrowndog

    Font metrics for translation of character based displays


      I have a rather complex question to ask with regard to font metrics.

      I'm working on a rather complex client/server project. The client is a Flex front end. The project is to convert programs written in another language that is meant for output to character based displays (ie: TTY terminals), but instead display the screen output in Flex. Programs written for character display systems such as TTY terminals uses a "curses"-like output. That is, each x coordinate is the width of a character cell and each y coordinate is the height of a character cell, and all cells are the exact same width and height. So for example, some code may be like the following:
      @ 3,4 print "PRICE:"
      To create an input box, the code may be like the following:
      @ 9,4 get $price length 6
      The first line prints "PRICE:" at coordinates x=3,y=4 and the 2nd line prints an input box of length 6 characters at coordinates x=9,y=4. Thus the input box is to the right of the label with no spaces in between.

      The Flex program must take the above coordinates, possibly even convert them, and produce similar results. Is there a way (I presume using Font metrics) to produce the desired output? Assuming the application default font is a fixed length family type, such as Courier, can coordinates be imitated as such for both text labels and the length of input boxes?

      Can someone please provide some code snippets or hints of how one can achieve this?