News:

Welcome to RetroCoders Community

Main Menu

I'm in the midst of setting up a third font

Started by CharlieJV, May 13, 2023, 04:12 PM

Previous topic - Next topic

ZXDunny

I do wonder if you could enable WebGL and a shader to use nearest neighbour scaling up to the next integer scale, then bilinear for the rest of the way to the chosen screen resolution.

I use something similar (but done on the CPU rather than the GPU) in SpecBAS and it does really help with those nasty non-integer scalings you get - and the massive blurring when you scale up with bilinear from a small screen size.

Of course, I have no idea how to actually achieve that in a browser!

CharlieJV

#16
Quote from: ZXDunny on May 15, 2023, 05:27 PMI do wonder if you could enable WebGL and a shader to use nearest neighbour scaling up to the next integer scale, then bilinear for the rest of the way to the chosen screen resolution.

I use something similar (but done on the CPU rather than the GPU) in SpecBAS and it does really help with those nasty non-integer scalings you get - and the massive blurring when you scale up with bilinear from a small screen size.

Of course, I have no idea how to actually achieve that in a browser!
Quote from: ZXDunny on May 15, 2023, 05:27 PMWebGL

Aside: WebGL

Very possibly. If and when that sniffs of something fun to dig into, I'll roll up my sleeves.

I'm pretty sure that will have to wait for when it hurts too much not to dig into it.

For the moment, the so-so appearance of fonts doesn't quite annoy me yet.

BTW, blurriness would be caused by smoothing.  No blurriness when smoothing turned off.  However, is the scaling-related naughty pixels ever so much more noticeable with smoothing turned off.

Smoothing turned off (two screenshots, maybe just a few pixels bigger in one versus the other, just to see differences in appearance of naughty pixels):

You cannot view this attachment.

You cannot view this attachment.

Smoothing turned on:

You cannot view this attachment. 



johnno56

Umm...  Have I opened a "can of worms" with all this font stuff? Apologies.

If I think about it, I suppose like every other 'new' program, I try to include some of the 'cool stuff' from the programmes that I like, to 'make' them somewhat similar or alike to what I are used to... Instead of just accepting the limitations of the 'new' program and use it as intended... I hope that I am making sense... If not, it is probably the lack of blood in my caffeine system....

Anyway, I will finish the font I am working on, then probably move on to something else... lol  Too much of a brain-drain... lol
May your journey be free of incident.  Live long and prosper.

CharlieJV

Quote from: johnno56 on May 15, 2023, 07:12 PMUmm...  Have I opened a "can of worms" with all this font stuff? Apologies.

If I think about it, I suppose like every other 'new' program, I try to include some of the 'cool stuff' from the programmes that I like, to 'make' them somewhat similar or alike to what I are used to... Instead of just accepting the limitations of the 'new' program and use it as intended... I hope that I am making sense... If not, it is probably the lack of blood in my caffeine system....

Anyway, I will finish the font I am working on, then probably move on to something else... lol  Too much of a brain-drain... lol

Nah nah, it is all good.

Thanks to the back and forth, I just noticed and fixed my lowercase "p": I had forgotten to make the first column of pixels blank.  Now, lower case "m" is no longer right up against lowercase "p". 

johnno56

Ok this is the BAM version of ZX Spectrum's normal font. Characters 32 to 126

license: Freeware: link: https://www.fontspace.com/zx-spectrum-7-font-f15573

' ZX Spectrum - normal

SCREEN 7

COLOR 15,0

'       SPACE TO @

_LETCHR$(32, "........" + "........" + "........" + "........" + "........" + "........" + "........" + "........" ) ' SPACE
_LETCHR$(33, "........" + "...X...." + "...X...." + "...X...." + "...X...." + "........" + "...X...." + "........" ) ' EXCLAIM
_LETCHR$(34, "........" + "..X..X.." + "..X..X.." + "........" + "........" + "........" + "........" + "........" ) ' QUOTE DOUBLE
_LETCHR$(35, "........" + "..X..X.." + ".XXXXXX." + "..X..X.." + "..X..X.." + ".XXXXXX." + "..X..X.." + "........" ) ' HASH
_LETCHR$(36, "........" + "....X..." + "..XXXXX." + "..X.X..." + "..XXXXX." + "....X.X." + "..XXXXX." + "....X..." ) ' DOLLAR
_LETCHR$(37, "........" + ".XX...X." + ".XX..X.." + "....X..." + "...X...." + "..X..XX." + ".X...XX." + "........" ) ' PERCENT
_LETCHR$(38, "........" + "...X...." + "..X.X..." + "...X...." + "..X.X.X." + ".X...X.." + "..XXX.X." + "........" ) ' AMPERSAND
_LETCHR$(39, "........" + "....X..." + "...X...." + "........" + "........" + "........" + "........" + "........" ) ' QUOTE SINGLE
_LETCHR$(40, "........" + ".....X.." + "....X..." + "....X..." + "....X..." + "....X..." + ".....X.." + "........" ) ' PARENTH LEFT
_LETCHR$(41, "........" + "..X....." + "...X...." + "...X...." + "...X...." + "...X...." + "..X....." + "........" ) ' PARENTH RIGHT
_LETCHR$(42, "........" + "........" + "...X.X.." + "....X..." + "..XXXXX." + "....X..." + "...X.X.." + "........" ) ' ASTERISK
_LETCHR$(43, "........" + "........" + "....X..." + "....X..." + "..XXXXX." + "....X..." + "....X..." + "........" ) ' PLUS
_LETCHR$(44, "........" + "........" + "........" + "........" + "........" + "....X..." + "....X..." + "...X...." ) ' COMMA
_LETCHR$(45, "........" + "........" + "........" + "........" + "..XXXXX." + "........" + "........" + "........" ) ' HYPHEN
_LETCHR$(46, "........" + "........" + "........" + "........" + "........" + "...XX..." + "...XX..." + "........" ) ' PERIOD
_LETCHR$(47, "........" + "........" + "......X." + ".....X.." + "....X..." + "...X...." + "..X....." + "........" ) ' SLASH
_LETCHR$(48, "........" + "..XXXX.." + ".X...XX." + ".X..X.X." + ".X.X..X." + ".XX...X." + "..XXXX.." + "........" ) ' 0
_LETCHR$(49, "........" + "...XX..." + "..X.X..." + "....X..." + "....X..." + "....X..." + "..XXXXX." + "........" ) ' 1
_LETCHR$(50, "........" + "..XXXX.." + ".X....X." + "......X." + "..XXXX.." + ".X......" + ".XXXXXX." + "........" ) ' 2
_LETCHR$(51, "........" + "..XXXX.." + ".X....X." + "....XX.." + "......X." + ".X....X." + "..XXXX.." + "........" ) ' 3
_LETCHR$(52, "........" + "....X..." + "...XX..." + "..X.X..." + ".X..X..." + ".XXXXXX." + "....X..." + "........" ) ' 4
_LETCHR$(53, "........" + ".XXXXXX." + ".X......" + ".XXXXX.." + "......X." + ".X....X." + "..XXXX.." + "........" ) ' 5
_LETCHR$(54, "........" + "..XXXX.." + ".X......" + ".XXXXX.." + ".X....X." + ".X....X." + "..XXXX.." + "........" ) ' 6
_LETCHR$(55, "........" + ".XXXXXX." + "......X." + ".....X.." + "....X..." + "...X...." + "...X...." + "........" ) ' 7
_LETCHR$(56, "........" + "..XXXX.." + ".X....X." + "..XXXX.." + ".X....X." + ".X....X." + "..XXXX.." + "........" ) ' 8
_LETCHR$(57, "........" + "..XXXX.." + ".X....X." + ".X....X." + "..XXXXX." + "......X." + "..XXXX.." + "........" ) ' 9
_LETCHR$(58, "........" + "........" + "........" + "...X...." + "........" + "........" + "...X...." + "........" ) ' COLON
_LETCHR$(59, "........" + "........" + "...X...." + "........" + "........" + "...X...." + "...X...." + "..X....." ) ' SEMI COLON
_LETCHR$(60, "........" + "........" + ".....X.." + "....X..." + "...X...." + "....X..." + ".....X.." + "........" ) ' LESS THAN
_LETCHR$(61, "........" + "........" + "........" + "..XXXXX." + "........" + "..XXXXX." + "........" + "........" ) ' EQUALS
_LETCHR$(62, "........" + "........" + "...X...." + "....X..." + ".....X.." + "....X..." + "...X...." + "........" ) ' GREATER THAN
_LETCHR$(63, "........" + "..XXXX.." + ".X....X." + ".....X.." + "....X..." + "........" + "....X..." + "........" ) ' QUESTION
_LETCHR$(64, "........" + "..XXXX.." + ".X..X.X." + ".X.X.XX." + ".X.XXXX." + ".X......" + "..XXXX.." + "........" ) ' AT

'       UPPERCASE A to Z

_LETCHR$(65, "........" + "..XXXX.." + ".X....X." + ".X....X." + ".XXXXXX." + ".X....X." + ".X....X." + "........" ) ' A
_LETCHR$(66, "........" + ".XXXXX.." + ".X....X." + ".XXXXX.." + ".X....X." + ".X....X." + ".XXXXX.." + "........" ) ' B
_LETCHR$(67, "........" + "..XXXX.." + ".X....X." + ".X......" + ".X......" + ".X....X." + "..XXXX.." + "........" ) ' C
_LETCHR$(68, "........" + ".XXXX..." + ".X...X.." + ".X....X." + ".X....X." + ".X...X.." + ".XXXX..." + "........" ) ' D
_LETCHR$(69, "........" + ".XXXXXX." + ".X......" + ".XXXXX.." + ".X......" + ".X......" + ".XXXXXX." + "........" ) ' E
_LETCHR$(70, "........" + ".XXXXXX." + ".X......" + ".XXXXX.." + ".X......" + ".X......" + ".X......" + "........" ) ' F
_LETCHR$(71, "........" + "..XXXX.." + ".X....X." + ".X......" + ".X..XXX." + ".X....X." + "..XXXX,," + "........" ) ' G
_LETCHR$(72, "........" + ".X....X." + ".X....X." + ".XXXXXX." + ".X....X." + ".X....X." + ".X....X." + "........" ) ' H
_LETCHR$(73, "........" + "..XXXXX." + "....X..." + "....X..." + "....X..." + "....X..." + "..XXXXX." + "........" ) ' I
_LETCHR$(74, "........" + "......X." + "......X." + "......X." + ".X....X." + ".X....X." + "..XXXX.." + "........" ) ' J
_LETCHR$(75, "........" + ".X...X.." + ".X..X..." + ".XXX...." + ".X..X..." + ".X...X.." + ".X....X." + "........" ) ' K
_LETCHR$(76, "........" + ".X......" + ".X......" + ".X......" + ".X......" + ".X......" + ".XXXXXX." + "........" ) ' L
_LETCHR$(77, "........" + ".X....X." + ".XX..XX." + ".X.XX.X." + ".X....X." + ".X....X." + ".X....X." + "........" ) ' M
_LETCHR$(78, "........" + ".X....X." + ".XX...X." + ".X.X..X." + ".X..X.X." + ".X...XX." + ".X....X." + "........" ) ' N
_LETCHR$(79, "........" + "..XXXX.." + ".X....X." + ".X....X." + ".X....X." + ".X....X." + "..XXXX.." + "........" ) ' O
_LETCHR$(80, "........" + ".XXXXX.." + ".X....X." + ".X....X." + ".XXXXX.." + ".X......" + ".X......" + "........" ) ' P
_LETCHR$(81, "........" + "..XXXX.." + ".X....X." + ".X....X." + ".X.X..X." + ".X..X.X." + "..XXXX.." + "........" ) ' Q
_LETCHR$(82, "........" + ".XXXXX.." + ".X....X." + ".X....X." + ".XXXXX.." + ".X...X.." + ".X....X." + "........" ) ' R
_LETCHR$(83, "........" + "..XXXX.." + ".X......" + "..XXXX.." + "......X." + ".X....X." + "..XXXX.." + "........" ) ' S
_LETCHR$(84, "........" + "XXXXXXX." + "...X...." + "...X...." + "...X...." + "...X...." + "...X...." + "........" ) ' T
_LETCHR$(85, "........" + ".X....X." + ".X....X." + ".X....X." + ".X....X." + ".X....X." + "..XXXX.." + "........" ) ' U
_LETCHR$(86, "........" + ".X....X." + ".X....X." + ".X....X." + ".X....X." + "..X..X.." + "...XX..." + "........" ) ' V
_LETCHR$(87, "........" + ".X....X." + ".X....X." + ".X....X." + ".X....X." + ".X.XX.X." + "..X..X.." + "........" ) ' W
_LETCHR$(88, "........" + ".X....X." + "..X..X.." + "...XX..." + "...XX..." + "..X..X.." + ".X....X." + "........" ) ' X
_LETCHR$(89, "........" + "X.....X." + ".X...X.." + "..X.X..." + "...X...." + "...X...." + "...X...." + "........" ) ' Y
_LETCHR$(90, "........" + ".XXXXXX." + ".....X.." + "....X..." + "...X...." + "..X....." + ".XXXXXX." + "........" ) ' Z

'       BRACKET LEFT TO GRAVE

_LETCHR$(91, "........" + "....XXX." + "....X..." + "....X..." + "....X..." + "....X..." + "....XXX." + "........" ) ' BRACKET LEFT
_LETCHR$(92, "........" + "........" + ".X......" + "..X....." + "...X...." + "....X..." + ".....X.." + "........" ) ' BACK SLASH
_LETCHR$(93, "........" + ".XXX...." + "...X...." + "...X...." + "...X...." + "...X...." + ".XXX...." + "........" ) ' BRACKET RIGHT
_LETCHR$(94, "........" + "...X...." + "..XXX..." + ".X.X.X.." + "...X...." + "...X...." + "...X...." + "........" ) ' ASCII CIRCUM
_LETCHR$(95, "........" + "........" + "........" + "........" + "........" + "........" + "........" + "XXXXXXXX" ) ' UNDERSCORE
_LETCHR$(96, "........" + "...X...." + "....X..." + "........" + "........" + "........" + "........" + "........" ) ' GRAVE

'       LOWERCASE A to Z

_LETCHR$( 97, "........" + "........" + "..XXX..." + ".....X.." + "..XXXX.." + ".X...X.." + "..XXXX.." + "........" ) ' a
_LETCHR$( 98, "........" + "..X....." + "..X....." + "..XXXX.." + "..X...X." + "..X...X." + "..XXXX.." + "........" ) ' b
_LETCHR$( 99, "........" + "........" + "...XXX.." + "..X....." + "..X....." + "..X....." + "...XXX.." + "........" ) ' c
_LETCHR$(100, "........" + ".....X.." + ".....X.." + "..XXXX.." + ".X...X.." + ".X...X.." + "..XXXX.." + "........" ) ' d
_LETCHR$(101, "........" + "........" + "..XXX..." + ".X...X.." + ".XXXX..." + ".X......" + "..XXXX.." + "........" ) ' e
_LETCHR$(102, "........" + "....XX.." + "...X...." + "...XX..." + "...X...." + "...X...." + "...X...." + "........" ) ' f
_LETCHR$(103, "........" + "........" + "..XXXX.." + ".X...X.." + ".X...X.." + "..XXXX.." + ".....X.." + "..XXX..." ) ' g
_LETCHR$(104, "........" + ".X......" + ".X......" + ".XXXX..." + ".X...X.." + ".X...X.." + ".X...X.." + "........" ) ' h
_LETCHR$(105, "........" + "...X...." + "........" + "..XX...." + ".. X...." + ".. X...." + "..XXX..." + "........" ) ' i
_LETCHR$(106, "........" + ".....X.." + "........" + ".....X.." + ".....X.." + ".....X.." + "..X..X.." + "...XX..." ) ' j
_LETCHR$(107, "........" + "..X....." + "..X.X..." + "..XX...." + "..XX...." + "..X.X..." + "..X..X.." + "........" ) ' k
_LETCHR$(108, "........" + "...X...." + "...X...." + "...X...." + "...X...." + "...X...." + "....XX.." + "........" ) ' l
_LETCHR$(109, "........" + "........" + ".XX.X..." + ".X.X.X.." + ".X.X.X.." + ".X.X.X.." + ".X.X.X.." + "........" ) ' m
_LETCHR$(110, "........" + "........" + ".XXXX..." + ".X...X.." + ".X...X.." + ".X...X.." + ".X...X.." + "........" ) ' n
_LETCHR$(111, "........" + "........" + "..XXX..." + ".X...X.." + ".X...X.." + ".X...X.." + "..XXX..." + "........" ) ' o
_LETCHR$(112, "........" + "........" + ".XXXX..." + ".X...X.." + ".X...X.." + ".XXXX..." + ".X......" + ".X......" ) ' p
_LETCHR$(113, "........" + "........" + "..XXXX.." + ".X...X.." + ".X...X.." + "..XXXX.." + ".....X.." + ".....XX." ) ' q
_LETCHR$(114, "........" + "........" + "...XXX.." + "..X....." + "..X....." + "..X....." + "..X....." + "........" ) ' r
_LETCHR$(115, "........" + "........" + "..XXX..." + ".X......" + "..XXX..." + ".....X.." + ".XXXX..." + "........" ) ' s
_LETCHR$(116, "........" + "...X...." + "..XXX..." + "...X...." + "...X...." + "...X...." + "... XX.." + "........" ) ' t
_LETCHR$(117, "........" + "........" + ".X...X.." + ".X...X.." + ".X...X.." + ".X...X.." + "..XXX..." + "........" ) ' u
_LETCHR$(118, "........" + "........" + ".X...X.." + ".X...X.." + "..X.X..." + "..X.X..." + "...X...." + "........" ) ' v
_LETCHR$(119, "........" + "........" + ".X.X.X.." + ".X.X.X.." + ".X.X.X.." + ".X.X.X.." + "..X.X..." + "........" ) ' w
_LETCHR$(120, "........" + "........" + ".X...X.." + "..X.X..." + "...X...." + "..X.X..." + ".X...X.." + "........" ) ' X
_LETCHR$(121, "........" + "........" + ".X...X.." + ".X...X.." + ".X...X.." + "..XXXX.." + ".....X.." + "..XXX..." ) ' y
_LETCHR$(122, "........" + "........" + ".XXXXX.." + "....X..." + "...X...." + "..X....." + ".XXXXX.." + "........" ) ' z

'       BRACE LEFT TO TILDE

_LETCHR$(123, "........" + "....XXX." + "....X..." + "..XX...." + "....X..." + "....X..." + "....XXX." + "........" ) ' BRACE LEFT
_LETCHR$(124, "........" + "....X..." + "....X..." + "....X..." + "....X..." + "....X..." + "....X..." + "........" ) ' BAR
_LETCHR$(125, "........" + ".XXX...." + "...X...." + "....XX.." + "...X...." + "...X...." + ".XXX...." + "........" ) ' BRACE RIGHT
_LETCHR$(126, "........" + "...X.X.." + "..X.X..." + "........" + "........" + "........" + "........" + "........" ) ' ASCII TILDE

PRINT: FOR I = 65 TO 90: PRINT CHR$(I);: NEXT I

PRINT: FOR I = 97 TO 122: PRINT CHR$(I);: NEXT I

PRINT: FOR I = 32 TO 57: PRINT CHR$(I);: NEXT I

PRINT: FOR I = 58 TO 64: PRINT CHR$(I);: NEXT I

FOR I = 91 TO 96: PRINT CHR$(I);: NEXT I

FOR I = 123 TO 126: PRINT CHR$(I);: NEXT I

DO WHILE INKEY$<>CHR$(27)
	_DELAY 0.1
LOOP
May your journey be free of incident.  Live long and prosper.

ZXDunny

Just as an example, here's how SpecBAS looks with bilinear filtering to scale up:



And with nearest neighbour to the next integer scale and bilinear the rest of the way:



You can see that there is subtle shading of certain rows and columns of pixels to smooth out the badly aliased scaling. It's really quite nice.

But anyway, apologies for the de-rail here. Loving the BAM font talk :)

CharlieJV

I've had the alphabetic uppercase and lowercase, and numbers and a bit of punctuation done, and I'm now working on all of the other characters.

To compare:



johnno56

The alternate set looks pretty cool...
May your journey be free of incident.  Live long and prosper.

CharlieJV

Quote from: johnno56 on May 18, 2023, 08:25 AMThe alternate set looks pretty cool...

I don't think it will win any awards, but it is doing exactly what I need it to do: increase space between the characters to make it easier for me to distinguish them.


johnno56

May your journey be free of incident.  Live long and prosper.

CharlieJV

BAM already allows setting the font for each program (default being the wwwBASIC font, "wwwBASIC thin" being the only alternative) via the Program Execution Properties (the first menu item under the project menu.)

I'm setting up, under the Tools menu, a "New Program Defaults" feature to configure the default font for all new programs.  (screenshots below)

(Aside: Eventually, I'd like to setup a font-creation and editing tool under the tools menu.  Create a new font "file"  (i.e. a tiddler) as a copy of an existing one, and then edit it via some basic editor.)

You cannot view this attachment.
You cannot view this attachment. 




CharlieJV

Quote from: CharlieJV on May 18, 2023, 03:27 AMI've had the alphabetic uppercase and lowercase, and numbers and a bit of punctuation done, and I'm now working on all of the other characters.

To compare:




Whereas I was shrinking alphabetic/numeric/punctuation characters for more space between them, I'm now changing the graphics characters in the opposite direction to see how that looks (i.e. I'm making the graphics characters bulkier.

I've done up to and including character 183.  Link above updated if you want to see how things currently look.