CPCWiki forum

General Category => Programming => Topic started by: belzebu on 15:30, 25 March 11

Title: Modify the font appearance
Post by: belzebu on 15:30, 25 March 11
Hi guys
How i can change the appearance for the font ?!
Long time ago when I was a kid i do it with symbol command from the Basic.
Exist a most powerfull and easy method to do this !?

Another question, anyone remember a little program in to the CPC 464/6128 manual for enter a word and display it with enlarge "font" in graphic mode !?

Thanks to all and excuse me for my newbie question... But i m a donkey in the fog :)

Bye
Belzy
Title: Re: Modify the font appearance
Post by: arnoldemu on 15:48, 25 March 11
Quote from: belzebu on 15:30, 25 March 11
Hi guys
How i can change the appearance for the font ?!
Long time ago when I was a kid i do it with symbol command from the Basic.
Exist a most powerfull and easy method to do this !?

Another question, anyone remember a little program in to the CPC 464/6128 manual for enter a word and display it with enlarge "font" in graphic mode !?

Thanks to all and excuse me for my newbie question... But i m a donkey in the fog :)

Bye
Belzy
First you need to tell BASIC which symbols you want to define with:

SYMBOL AFTER <number>

e.g.

SYMBOL AFTER 128

this will tell it to reserve some ram for the pixel data for the symbols.

then you can enter in basic the symbol command

SYMBOL <number>,<line1>,<line2>,<line3>,<line4>,<line5>,<line6>,<line7>,<line8>

and do this for each symbol you want to define.
<number> is the number of the symbol.
<line1> etc is a number, decimal, hex or binary to define the pixels of each line of the char.

OR another way.

If you have the font data stored as a binary file you can do this:

SYMBOL AFTER <number>
LOAD"<font>",HIMEM-((256-number)* 8)

and that should load the data without needing to define the symbols.

But how to get the binary file?

You can define the font the old way and save it.

SAVE"<font>",b,HIMEM-((256-number)* 8) , (256-number)*8

or perhaps you can take a font that is already made.

There may also be tools to make fonts this way, but I don't know of these. (I hope somebody else can help me).


EDIT: Please also read the BASIC tips forum post, this may help you ;)
http://cpcwiki.eu/forum/index.php/topic,203.0.html
Title: Re: Modify the font appearance
Post by: EgoTrip on 15:57, 25 March 11
Not sure if this is what you mean but try these for different fonts:


Prog 1:


1 REM Taken from Amstrad Action
10 SYMBOL AFTER 1: FOR t=HIMEM TO HIMEM+(8*255)
20 POKE t,peek(t) XOR 255:NEXT


Change the formula in line 20 for different effects, such as XOR 254, XOR 15


You can do stuff like this too on line 20:


20 FOR s=t TO t+3:POKE s,PEEK(s) XOR 255:NEXT s,t


So just experiment for different effects. If you get a garbled font to reset it just type SYMBOL AFTER 1


Another font program:


10 SYMBOL AFTER 32:FOR a=HIMEM to HIMEM+767 STEP 8
20 FOR b=1 to 4:a$=BIN$(PEEK(a+b),8)
30 POKE a+b,val("&X"+a$)/2:NEXT b,a


As for the large text, one technique is by drawing a character out of sight (best done by setting all the inks to the same colour) then TEST'ing it and then printing blocks or PLOT'ing dots where you want, although this method can be slow. I dont have an example immediately to hand but I can dig one out.
Title: Re: Modify the font appearance
Post by: Gryzor on 18:58, 25 March 11
A more interesting question, since this one is well documented: how do you change the font in the ROM, like Flynn (WinCPC) has done?
Title: Re: Modify the font appearance
Post by: Devilmarkus on 19:32, 25 March 11
Simple. Just store your new font as binary (above himem) and then exchange it to rom's binary. (I actually forgot where its located but the font in rom is the last bytes... 256*8 length? I really forgot)

I did the same with my "C64-ROMs" ;)
I just also changed the palette and the BASIC rom (Ready to READY). That's it.

Make sure you use an "Amstrad" CPC 6128 (No Schneider, Awa or whatever)
Title: Re: Modify the font appearance
Post by: AMSDOS on 23:47, 25 March 11
Can't say I remember the program from the Manual which enlarged a word, though AA had a number of them, some in BASIC, one I recall being done in Assembly (BIGPRINT - AA57), you should check out "Fast Basic Double-Height (http://www.cpcwiki.eu/index.php/Amstrad_Action_Christmas_1986_Type-Ins)" from AA16 which is pretty impressive if you want Double-Height Text as it's quite fast (pretty much straight out of the blocks). ACU I think had a few 10-Liners of that nature too (Height - Nov '90 being one which will be on ACU90B.ZIP file), from memory I think it was a pretty standard program.
Title: Re: Modify the font appearance
Post by: belzebu on 13:01, 26 March 11
WOW! Thanks for all suggestions! Really Really interesting!!!
Thanks to all, thankyou CP/M User i  found what I was looking!!!
Not easy to implement but i m happy :) :) :)


Title: Re: Modify the font appearance
Post by: milamber on 15:58, 30 April 11
Play around with these two POKEs.

a=201

poke &b72f, a ( for different effects change the value of `a` )
poke &b730, a ( changes the paper and can make the text hard to read )


Powered by SMFPacks Menu Editor Mod