Page 1 of 1

How to print graphic characters

Posted: Sun Dec 20, 2020 3:55 pm
by Enrico Maria Giordano
In this sample, the graphic character (a vertical line) is not printed. Any ideas?

Code: Select all

#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oPrn, oFnt

    PRINT oPrn PREVIEW
        DEFINE FONT oFnt NAME "Courier New" SIZE 0, -16 OF oPrn

        PAGE
            oPrn:Say( 100, 100, "This should be a vertical line (ALT-179): " + CHR( 179 ), oFnt )
        ENDPAGE
    ENDPRINT

    RELEASE FONT oFnt

    RETURN NIL
EMG

Re: How to print graphic characters

Posted: Sun Dec 20, 2020 4:27 pm
by karinha
https://tools.oratory.com/altcodes.html

Code: Select all

// https://tools.oratory.com/altcodes.html

#include "Fivewin.ch"

FUNCTION MAIN()

   LOCAL oPrn, oFnt, cAlt_179 := "| ³ ãäå |"
   LOCAL cAlt_124 := "|"

   PRINT oPrn PREVIEW

      DEFINE FONT oFnt NAME "Courier New" SIZE 0, -16 OF oPrn

      PAGE
         //oPrn:Say( 100, 100, "This should be a vertical line (ALT-179): " + CHR( 179 ), oFnt )

         oPrn:Say( 100, 100, "This should be a vertical line (ALT-124): " + cAlt_124, oFnt )
      ENDPAGE

   ENDPRINT

   RELEASE FONT oFnt

RETURN NIL
 
Regards, saludos.

Re: How to print graphic characters

Posted: Sun Dec 20, 2020 5:44 pm
by Enrico Maria Giordano
Thank you, but I need to print an existing text file containing graphic characters like CHR( 179 ).

EMG

Re: How to print graphic characters

Posted: Mon Dec 21, 2020 2:08 am
by nageswaragunupudi
Please define the font with OEM charset like this:

Code: Select all

        DEFINE FONT oFnt  NAME "Courier New" SIZE 0, -16 OF oPrn CHARSET 255
 

Re: How to print graphic characters

Posted: Mon Dec 21, 2020 9:25 am
by Enrico Maria Giordano
Thank you, it works! :-)

EMG