Qbasicnews.com

Full Version: Problems with gfxprint on Linux FreeBasic v.12
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
When running this programm i get no text output on the screen, but
print works fine.

Code:
DECLARE SUB GfxPrint( BYREF text AS STRING, _
        BYVAL x AS INTEGER, BYVAL y AS INTEGER, _
        BYVAL col AS INTEGER, BYVAL buffer AS ANY PTR = 0 )

'Zeichensatz:
    TYPE fb_FontType
        h AS INTEGER
        data AS UBYTE PTR
    END TYPE

    EXTERN fb_FontData ALIAS "fb_font_8x8" AS fb_FontType
    'EXTERN fb_FontData ALIAS "fb_font_8x14" AS fb_FontType
    'EXTERN fb_FontData ALIAS "fb_font_8x16" AS fb_FontType


screen 20
xptext$="Hello"
color 40,80
GfxPrint xptext$,30,30,20
sleep 9000
end

SUB GfxPrint( BYREF text AS STRING, _
            BYVAL x AS INTEGER, BYVAL y AS INTEGER, _
            BYVAL col AS INTEGER, BYVAL buffer AS ANY PTR = 0 )

        DIM row AS INTEGER, i AS INTEGER
        DIM bits AS UBYTE PTR

   if CurrentTextColorBG>-1 then
      line (x,y)-(x+len(text$)*8,y+14),CurrentTextColorBG,BF
   end if

        FOR i = 1 TO LEN(text)
            bits = fb_FontData.data + _
                (ASC(MID$(text, i, 1)) * fb_FontData.h)
            FOR row = 0 TO fb_FontData.h-1
                IF (buffer) THEN
                    LINE buffer, (x + 7, y + row)_
                        -(x, y + row), col,, *bits
                ELSE
                    LINE (x + 7, y + row)-(x, y + row),_
                        col,, *bits
                END IF
                bits += 1
            NEXT row
            x += 8
        NEXT i
END SUB
MrBobble
From the other message you posted I guess you're using a recent CVS snapshot of gfxlib that you compiled yourself... If this is the case, you should check the changelog...
You'll find that I discovered a bug in the styled LINE drawing, so that to fix this I had to break the GfxPrint routine I published in the gfxlib.txt documentation; the gfxlib.txt in CVS provides a new version of this routine that works with 0.13, so you have to recopy it from there.