QL Tinkering

Helpful tips and guides, also new users can ask for help here.
qbits
Gold Card
Posts: 250
Joined: Sun Dec 11, 2016 3:32 pm

Re: QL Tinkering

Post by qbits »

True Font Style - Discussion
As Screen Resolution increased so has Typology advances replaced the humble ASCII Bitmap Fonts with Vector Drawn Glyphs. When opening a Glyphs Font File it will try to apply its built-in naming scheme and sync the metrics of composite glyphs with their base glyphs. Or in simple terms a Glyphs file provides the Vector points and how they are joined with lines or curves. The Glyphs file stores only the Font outline. Scaling involves the resizing in height and width and weight or thickness of the line the Font is drawn in. Added to this we have Spacing and Kerning (Proportional Spacing) between Glyphs.

QBITS QL True Fonts - Construction
Each Font might be separately drawn, or as mentioned, constructed as a composite from Base Glyphs. A review to construct a family of Base Glyphs might be a starting point. A Glyph is constructed with Horizontal, Vertical lines or in some cases Diagonal lines, and Curves. Which for simplicity the later can be drawn as the curves of the four quadrants. This would require just eight base glyphs.
Font02.jpg
Font02.jpg (3.42 KiB) Viewed 2313 times
QBITS True Fonts - Scaling
Scaling would be a variable controlling the LINE ARC offset calculations and to add weight or thickness will require a doubling of the vector points and maybe the time to consider breaking down the Font into base Glyphs and using a second variable for weight or thickness. As such a character can be constructed from a set of base Glyphs, but each set with its own x,y offset from CURSOR x,y screen Position.

For a simple set of base glyphs, each requires four vector points and instructions in the use of LINE or ARC. FILL is then used to give thickness to the Font drawn. The thickness can also be used to present Regular or BOLD Printouts.
Font01.jpg
A set of Italic Glyphs, would be slightly more complex for the angled ARC’s

QBITS QL True Font Style - Spacing and Kerning
A simple CURSOR Offset of Pixel columns between Glyphs could be used for Spacing and Kerning.

Other Possibilities!
Replace PRINT with CTYPE (Character Type) and used a True Font Set loaded with TYPE_USE as opposed to CHAR_USE. Create a Glyph Editor that uses a set of base Glyphs to construct a Glyph file of vector Fonts.

Or has this already been attempted by others in the past!

QBITS


User avatar
RalfR
QL Wafer Drive
Posts: 1171
Joined: Fri Jun 15, 2018 8:58 pm

Re: QL Tinkering

Post by RalfR »

Peter Graf had once programmed a different GUI with proportional fonts (just for testing). Perhaps he can clarify the way, he has realized that.


7000 4E75
stevepoole
Aurora
Posts: 885
Joined: Mon Nov 24, 2014 2:03 pm

Re: QL Tinkering

Post by stevepoole »

Hi Qbits & Tinkerers,

Is it really worth all the effort of defining every font using glyphs, when we can simply graphically scale up font bitmaps using dots and dashes ? Steve ?
Capture d’écran (647).png


Derek_Stewart
Font of All Knowledge
Posts: 4649
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: QL Tinkering

Post by Derek_Stewart »

Hi Qbits

I have been using most of software and like the documentation.

I have recently been looks at the FontEditSE programme which is great for designing new Fonts and modifying existing Fonts.

I sometime include a new font as data statements and load the data into a reserved section of memory, and use the CHAR_USE command to attach the font to the programme channel.

Is it possible to add an export function to save the font to data statements instead of a binary file.

Another idea is an Import function to import a font from another computer, for example the ZX Spectrum User Defined Graphics. These UDG are a 8x8 character, which could occupy CHR$(144) to CHR$(164) in the QL extend font.


Regards,

Derek
User avatar
bwinkel67
QL Wafer Drive
Posts: 1511
Joined: Thu Oct 03, 2019 2:09 am

Re: QL Tinkering

Post by bwinkel67 »

stevepoole wrote: Tue Nov 19, 2024 10:33 pm Hi Qbits & Tinkerers,

Is it really worth all the effort of defining every font using glyphs, when we can simply graphically scale up font bitmaps using dots and dashes ? Steve ?

Capture d’écran (647).png
If you want fonts to look nicer then yes. In your graphically scaled example the enlarged font is pretty jagged.


stevepoole
Aurora
Posts: 885
Joined: Mon Nov 24, 2014 2:03 pm

Re: QL Tinkering

Post by stevepoole »

Hi Bwinkel,

Yes, the enlarged (zoomed) screen characters have jaggedness, stemming from the fact that all sloping lines are themselves staggered... this is inevitable.

But without the forum's zooming of the captured screen, they seem acceptable enough ?

Will take a closer look though, to see if any improvements are possible.

Working on a user-friendly final version at present. Regards, Steve.


qbits
Gold Card
Posts: 250
Joined: Sun Dec 11, 2016 3:32 pm

Re: QL Tinkering

Post by qbits »

Hi All,
Steve with a QL Screen of 512x256 your program does a pretty good job and I agree in principle that creating Glyphs (vector graphics) may not be productive. However bwinkel67 and Steve I have been looking at the possibility of using the Font Bitmap to create a representative Glyph using LINE and ARC that can then be scaled up/down. Still investigating the algorithm that might be used.

Derick - an import function for QBITS FontEditSE. As Bitmap files even 8x8 Fonts/Sprites can have headers etc. to analyse an all singing and dancing import function could quickly become very complex. However, if we take for example basic ZXSpectrunm Font Files as 768 Bytes with 96 fonts of 8Bytes each and therefore an 8x8 bit matrix. Then these are relatively easy to convert and display. Working on it as an add on.

As to DATA statements if you are suggesting each font as DATA Byte1, Byte2, …. to Byte 8: this shouldn’t be to hard to achieve. If your think of something else please explain with an example and I’ll see what I can do.

Note: Andrew already supplied a large number of I belive converted ZX Fonts.
Update: Derick I successfully ported across a ZX Font called Sorcery and will add code to next update to FontEdit

QBITS
Attachments
Sorcery_fnt.zip
(687 Bytes) Downloaded 74 times
Soercery.jpg
Soercery.jpg (38.03 KiB) Viewed 1817 times


stevepoole
Aurora
Posts: 885
Joined: Mon Nov 24, 2014 2:03 pm

Re: QL Tinkering

Post by stevepoole »

Hi Qbits & Tinkerers,

I have minimised any jaggedness by carefully choosing appropriate scaling variables.
LEGO effects have gone, as dots are now squares, (no longer circles).
The demo randomly fills the dots and dashes, to better see them...

Change the demo text on line 400 as you wish. Remember to LRESPR chans_code !!
Adapting the 45-degree dashes so as to form arcs will be a challenge...
Could be adapted for different window sizes, ( ie: user-friendliness).

Tested ok on QPC2, SGC and QDOS, but slow on the latter. Regards, Steve.
dot_lookup_justify3.zip
(2.09 KiB) Downloaded 75 times
chans_code.zip
(358 Bytes) Downloaded 71 times


stevepoole
Aurora
Posts: 885
Joined: Mon Nov 24, 2014 2:03 pm

Re: QL Tinkering

Post by stevepoole »

Hi Folks,
Here is an unfilled screen shot. Steve.
Capture d’écran (648).png


stevepoole
Aurora
Posts: 885
Joined: Mon Nov 24, 2014 2:03 pm

Re: QL Tinkering

Post by stevepoole »

Hi Tinkerers,

This version scrolls any enlarged text, anywhere onto any window....

Final version soon ? Steve.
Capture d’écran (654).png


Post Reply