Announcement

Collapse
No announcement yet.

Magic Hocu-pocus printing problem

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

  • Magic Hocu-pocus printing problem

    I want to change the printing font of my program. It works well with Courier New since years but the text weight is very light. Changing the font produce a great Problem.

    One line in Courier New looks like
    Monatsaufstellung der Einzelrechnungen für Monat 05/2019

    but changing the font to Consolas the line looks like
    Monatsaufstellung der Einzelrechnungen für Monat 5 019

    also the C from Consolas in the first line is a little bit damaged.

    but apparently not on every printer, some printer prints it as the programmer want.
    All other sides are printed correct.
    Magic hocus-pocus.

    Code:
    #COMPILE EXE
    #DIM ALL
    
    FUNCTION PBMAIN () AS LONG
    
       LOCAL fhndl AS DWORD
       LOCAL Tem AS STRING
       LOCAL FONTNAME AS STRING
       LOCAL Punkte&, FONTSTYLE&
    
       FONTNAME$ = "CONSOLAS"
       Punkte& = 11
       FONTSTYLE& = 0
    
       XPRINT ATTACH DEFAULT
       FONT NEW FONTNAME$, Punkte&, 0, 0 TO fhndl
       XPRINT SET FONT fhndl
       XPRINT "Ausgewählter Font: "; FONTNAME$;
       XPRINT
       XPRINT
       XPRINT
       XPRINT
       FONTSTYLE& = 1
       FONT NEW FONTNAME$, Punkte&, FONTSTYLE&, 0 TO fhndl
       XPRINT SET FONT fhndl
       XPRINT "Monatsaufstellung der Einzelrechnungen für Monat ";
       Tem$ = "05"
       XPRINT Tem$;"/";
       Tem$ = "2019"
       'here we lose something
       XPRINT Tem$;
       XPRINT
       XPRINT
       'this will be printed correct
       Tem$ = "Monatsaufstellung der Einzelrechnungen für Monat " + Tem$
       XPRINT Tem$;
       XPRINT
       XPRINT
       XPRINT CLOSE
    
    END FUNCTION

  • #2
    Roger,

    Try using Punkte& = 11.5
    Rgds, Dave

    Comment


    • #3
      Did quick test and get correct result with Consolas looking as it should and line ending with ..Monat 05/2019. Printer trouble och other - not shown - code affecting result?

      Comment


      • #4
        Inital test here, with PBCC604, found same results as reported in OP.

        Looks like things became spooky from Ver PBCC601 as per attached.

        Click image for larger version  Name:	HocuPocus.png Views:	0 Size:	68.9 KB ID:	782518
        Rgds, Dave

        Comment

        Working...
        X