Announcement

Collapse
No announcement yet.

Windows fonts in Dos?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Windows fonts in Dos?

    It is *not* possible to use multiple window fonts in Dos
    Powerbasic output to the screen, right? Example, with the
    desired font indicated on the right. This is for a small
    drive-in. (Everything lines up when I type it in, but not
    after I submit it. Hope it is clear anyway.

    WINDOW ORDER MENU Qty....<-- Times New Roman 30
    Hamburger 2/3 pounder $2.79 2.....<--- Courier Bold 18
    Banana Split (Large) $1.89 1.....<--- Courier Bold 18

    Order Subtotal: $7.47........<--- Arial Bold 14
    Sales Tax 6% .45
    Order Total $7.92

    SMILE & THANK CUSTOMER!..........<--- BACCUS BOLD 30 Blink

    If it is possible, can anyone please give me an example or
    starting point so that I may learn this myself? Of co

    Thank you for your time.

    Robert

    ------------------




    [This message has been edited by Robert Carneal (edited August 31, 2001).]

  • #2
    It is possible to "reprogram" the standard font table, but you only have 255 or 256 characters available at any time, and it will only work if the program is running in full-screen mode (ie, not in a DOS window because Windows provides an emulated view for windowed DOS box).

    For example, you could redefine the 26 characters starting at ASCII 128 to cover the range "A" to "Z" with a different appearance, and translate your strings to display characters in that section.

    In such a manner, PRINT CHR$(128) would display the image of the 1st redefined character, say an "A".

    Egbert Zijlema has kindly posted some code for font reprogramming on his section at http://www.basicguru.com/zijlema/pbdos.html

    Another approach would be to use a graphics mode and draw the characters individually (lots of work unless someone has a library written for this).

    If you really want to display true-type (including variable-width ) Windows fonts, then you would best to write a Windows program to do so with PB/DLL (or PB/CC and possibly Graphics Tools).

    I hope this helps!


    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment


    • #3
      I have been working on a library which reads a data file and draws
      the fonts on the screen. There is a bug though....the output
      comes out slanted.

      I also have a "drawfont.bas" whioch draws graphical characters
      on the screen with draw statements. I Include it, and use my
      custom "print" routine.

      I think the first one will be much more useful, since it supports

      1. Screen colors or font-defined colors
      2. Transparency of pixels
      3. A 16-color + Transparency palette

      I just hope I can get it working so I can integrate it into
      EdgeOS (a suite of PowerBASIC libraries to support a single
      interface done entirely in PB)

      Amos

      ------------------
      Amos

      Comment


      • #4
        I downloaded a couple fonts for my project, but the user didn't
        like it. (She is 12, wants a game where puzzles are involved.)
        I ended up making my own fonts using LINE statements, time
        consuming patient trying to say the least.

        Thanks to everyone who wrote trying to help me. You did help me,
        but now that I have what she wants, any more replies are kind
        of moot.

        Thanks everyone.

        Robert

        ------------------

        Comment


        • #5
          For possible other users who might be interested in this topic, another way to try is DRAW statement. Compared to building chars with LINE, IMO it’ s very easier and faster to use and probably it runs very faster; it’ s also more powerful (for instance, with a single command one can scale a char (if the char was built well)).

          ------------------

          Comment


          • #6
            It is actually possible to have 2 fonts on screen simultaneously in DOS, I use 2 character sets occasionally. Take a look at Int10h, AX=1104h.
            I have the assembler somewhere (I think, it was written 10 years ago!) so I'll try & look it out if anyone is interested.

            ------------------

            Comment

            Working...
            X