Outline Letters
#1
Well we've rotated them every which way, how about outlining them?
Code:
_TITLE "Outline Letter bplus 2018-03-03"
RANDOMIZE TIMER
CONST xmax = 1260
CONST ymax = 600


COMMON SHARED cN, pR!, pG!, pB!

SCREEN _NEWIMAGE(xmax, ymax, 32)
_SCREENMOVE 100, 20
mess$ = "Bplus strikes again!"
PRINT mess$

w = 8 * LEN(mess$): h = 16
DIM p(8 * w, 8 * h)
black&& = POINT(0, 0)
FOR y = 0 TO h - 1
    FOR x = 0 TO w - 1
        IF POINT(x, y) <> black&& THEN
            FOR yy = 0 TO 7
                FOR xx = 0 TO 7
                    p(8 * x + xx, 8 * y + yy) = 1
                NEXT
            NEXT
        END IF
    NEXT
NEXT

'now hollow out letter
DIM newP(8 * w, 8 * h)
FOR y = 0 TO 8 * h
    FOR x = 0 TO 8 * w
        IF x > 0 AND x < 8 * w THEN
            IF y > 0 AND y < 8 * h THEN
                IF p(x, y) THEN
                    IF p(x - 1, y) AND p(x + 1, y) AND p(x, y - 1) AND p(x, y + 1) THEN
                        newP(x, y) = 0
                    ELSE
                        newP(x, y) = 1
                    END IF
                ELSE
                    newP(x, y) = 0
                END IF
            ELSE
                newP(x, y) = p(x, y)
            END IF
        ELSE
            newP(x, y) = p(x, y)
        END IF
    NEXT
NEXT

CLS
xo = 5: yo = 235: m = 4
resetPlasma
WHILE 1
    CLS
    FOR y = 0 TO 8 * h
        FOR x = 0 TO 8 * w
            IF newP(x, y) THEN
                IF cycle MOD 4 = 0 THEN
                    changePlasma
                    LINE (x, y)-STEP(0, 4), , BF
                ELSE
                    LINE (x, y)-STEP(0, 4), _RGB(lc, lc, lc), BF
                END IF
                x1 = x + 20 * COS(A)
                y1 = y + 40 * COS(A) * SIN(A)
                PSET (x1, y1 + lc + 200), _RGB(255, 255, 0)
            ELSEIF p(x, y) THEN
                LINE (x, y)-STEP(0, 4), _RGB32(100, 0, 0), BF
            END IF
        NEXT
    NEXT
    _DISPLAY
    _LIMIT 30
    A = A + _PI(1 / 12)
    lc = lc + 1
    lc = lc MOD 255
    IF lc MOD 255 = 0 THEN cycle = cycle + 1: resetPlasma
WEND

SUB changePlasma ()
    cN = cN + 1
    COLOR _RGB(127 + 127 * SIN(pR! * .1 * cN), 127 + 127 * SIN(pG! * .1 * cN), 127 + 127 * SIN(pB! * .1 * cN))
END SUB

SUB resetPlasma ()
    pR! = RND ^ 2: pG! = RND ^ 2: pB! = RND ^ 2
END SUB


Attached Files Thumbnail(s)

B += x
Reply
#2
@Bplus,

You should check out my hardware accelerated text demo with outlines that I shared on this forum back on March 8th, 2017.

You can see it here: http://qb64.thejoyfulprogrammer.com/show...hp?tid=588
Dedicated to empowering computer programming hobbyists, tinkerers, amateurs, and enthusiasts.
profile for Walter Whitman at Stack Overflow, Q&A for professional and enthusiast programmers


Reply
#3
OK

Walter,

I see this site acting very strangely today! (now 2018-03-04 12:44 PM Ohio, USA time)

Slow downs and hang ups, and haven't been able to log out since last night.

Now I see new text font everywhere and even Quick Reply Window is different.

Me thinks you are Pioneering again!
B += x
Reply
#4
And now (12:48 PM) the font is different again!
B += x
Reply
#5
Hi Walter, 

Ok I checked out your link, chose the 2nd .bas download (2017-03-11) and ran code and then looked at it but...

don't see the connection except it involves text?  ?? It's not even rotating or scaling let alone outlining.

BTW this outline letters code is collateral from AI? idea to find shortest path through maze, a side show tangent.
B += x
Reply
#6
@Bplus,

I did experience some strange things earlier, but it soon corrected itself. I didn't have anything to do with it this time, so I do not what was going on. It is possible they had a failover on the server my site is on, and took them a short time to switch it to another. I was getting a 501 error during that time as well on this site.

The demo I shared a link to had outlines around the text, that is what it had to do with this post. However, it was a cheap way of doing those on text, and would work for any font since we are dealing with actual bitmap text instead of vector shapes.
Dedicated to empowering computer programming hobbyists, tinkerers, amateurs, and enthusiasts.
profile for Walter Whitman at Stack Overflow, Q&A for professional and enthusiast programmers


Reply