Hallo @ all,
habs doch getan .... einen 3x5 Pixel-Font mit einer (vorerst) einfachen Ausgaberoutine gemacht.
Die Zeichen #00 - #31 sind nicht definiert. Keine Drehung. Oben links ist die Koordinatenangabe.
Noch schnell was zum Aufbau des Arrays: Der erste Wert der 3er-Gruppe ist im Zeichen links, der 2. Mitte, der 3. rechts. Verwendet wird vom Byte 2^0 - 2^4, wobei 2^0 im Zeichen oben ist.
Beispiel '2' = $19,$15,$12
..... Kopf nach rechts neigen und schauen
Gruss
Harry
Const
SF3x5 : Array[0..383] of Byte = ($00,$00,$00, $00,$00,$00, $00,$00,$00, $00,$00,$00, // 0
$00,$00,$00, $00,$00,$00, $00,$00,$00, $00,$00,$00, // 4
$00,$00,$00, $00,$00,$00, $00,$00,$00, $00,$00,$00, // 8
$00,$00,$00, $00,$00,$00, $00,$00,$00, $00,$00,$00, // 12
$00,$00,$00, $00,$00,$00, $00,$00,$00, $00,$00,$00, // 16
$00,$00,$00, $00,$00,$00, $00,$00,$00, $00,$00,$00, // 20
$00,$00,$00, $00,$00,$00, $00,$00,$00, $00,$00,$00, // 24
$00,$00,$00, $00,$00,$00, $00,$00,$00, $00,$00,$00, // 28
$00,$00,$00, $00,$17,$00, $03,$00,$03, $1F,$0A,$1F, // 32 Space ! " #
$16,$1F,$0D, $19,$04,$13, $0A,$15,$1A, $00,$03,$00, // 36 $ % & '
$00,$0E,$11, $11,$0E,$00, $0A,$04,$0A, $04,$0E,$04, // 40 ( ) * +
$10,$08,$00, $04,$04,$04, $00,$10,$00, $10,$0C,$03, // 44 , - . /
$1F,$11,$1F, $12,$1F,$10, $19,$15,$12, $15,$15,$0A, // 48 0 1 2 3
$07,$04,$1F, $17,$15,$09, $0E,$15,$09, $19,$05,$03, // 52 4 5 6 7
$1F,$15,$1F, $17,$15,$0F, $00,$0A,$00, $10,$0A,$00, // 56 8 9 : ;
$04,$0A,$11, $0A,$0A,$0A, $11,$0A,$04, $02,$19,$06, // 60 < = > ?
$0E,$15,$16, $1E,$05,$1E, $1F,$15,$0A, $0E,$11,$11, // 64 @ A B C
$1F,$11,$0E, $1F,$15,$11, $1F,$05,$01, $0E,$11,$1D, // 68 D E F G
$1F,$04,$1F, $00,$1F,$00, $10,$0F,$00, $1F,$04,$1B, // 72 H I J K
$1F,$10,$10, $1F,$06,$1F, $1F,$0E,$1F, $0E,$11,$0E, // 76 L M N O
$1F,$05,$02, $06,$09,$16, $1F,$05,$1A, $12,$15,$09, // 80 P Q R S
$01,$1F,$01, $0F,$10,$0F, $07,$18,$07, $1F,$0C,$1F, // 84 T U V W
$1B,$04,$1B, $03,$1C,$03, $19,$15,$13, $00,$1F,$11, // 88 X Y Z [
$03,$0C,$10, $11,$1F,$00, $02,$01,$02, $10,$10,$10, // 92 ] ^ _
$02,$05,$02, $0C,$12,$1C, $1F,$12,$0C, $0C,$12,$12, // 96 ° a b c
$0C,$12,$1F, $0C,$1A,$14, $04,$1F,$05, $14,$1A,$0C, // 100 d e f g
$1F,$02,$1C, $00,$1D,$00, $10,$0D,$00, $1F,$08,$14, // 104 h i j k
$00,$1F,$00, $1E,$06,$1E, $1C,$02,$1C, $0C,$12,$0C, // 108 l m n o
$1E,$0A,$04, $04,$0A,$1E, $1E,$04,$02, $14,$0A,$00, // 112 p q r s
$02,$1F,$02, $0E,$10,$0E, $06,$18,$06, $0E,$18,$0E, // 116 t u v w
$12,$0C,$12, $16,$08,$0E, $1A,$1E,$16, $04,$1F,$11, // 120 x y z {
$00,$1B,$00, $11,$1F,$04, $06,$02,$03, $1F,$1F,$1F); // 124 | } ~ Block
// Ausgabe Text als 3x5-Matrix; 0,0 ist immer oben, links
Procedure chDraw3x5(X,Y:Integer;Text:String[32]);
Var XC : Integer;
CC : Integer;
PC : Integer;
Begin
For XC:=1 to Length(Text) do
PC:=Integer(Ord(Text[XC]));
For CC:=0 to 2 do
gDrawLine(X+((XC-1)*4)+CC,Y,X+((XC-1)*4)+CC,Y+4,Mirror8(SF3x5[PC*3+CC]));
EndFor;
EndFor;
End chDraw3x5;
.
.
.
chDraw3x5(105,111,' !"#$%&'+#39+'()*+,-./0123456789:;<=>?');
chDraw3x5(105,117,'@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_');
chDraw3x5(105,123,#96+'abcdefghijklmnopqrstuvwxyz{|}~'+#127);
[Edit]Hab das 'r' geändert, es hat mir nicht gefallen. Rechts oberhalb ist jetzt noch ein Punkt dazu gekommen.
[Edit]"f" hatte einen Fehler
habs doch getan .... einen 3x5 Pixel-Font mit einer (vorerst) einfachen Ausgaberoutine gemacht.
Die Zeichen #00 - #31 sind nicht definiert. Keine Drehung. Oben links ist die Koordinatenangabe.
Noch schnell was zum Aufbau des Arrays: Der erste Wert der 3er-Gruppe ist im Zeichen links, der 2. Mitte, der 3. rechts. Verwendet wird vom Byte 2^0 - 2^4, wobei 2^0 im Zeichen oben ist.
Beispiel '2' = $19,$15,$12
Code
$19 = %xxx11001 = . . . x x x
$15 = %xxx10101 = . . . x x x
$12 = %xxx10010 = . . . x x
$15 = %xxx10101 = . . . x x x
$12 = %xxx10010 = . . . x x
..... Kopf nach rechts neigen und schauen
Gruss
Harry
Code
Const
SF3x5 : Array[0..383] of Byte = ($00,$00,$00, $00,$00,$00, $00,$00,$00, $00,$00,$00, // 0
$00,$00,$00, $00,$00,$00, $00,$00,$00, $00,$00,$00, // 4
$00,$00,$00, $00,$00,$00, $00,$00,$00, $00,$00,$00, // 8
$00,$00,$00, $00,$00,$00, $00,$00,$00, $00,$00,$00, // 12
$00,$00,$00, $00,$00,$00, $00,$00,$00, $00,$00,$00, // 16
$00,$00,$00, $00,$00,$00, $00,$00,$00, $00,$00,$00, // 20
$00,$00,$00, $00,$00,$00, $00,$00,$00, $00,$00,$00, // 24
$00,$00,$00, $00,$00,$00, $00,$00,$00, $00,$00,$00, // 28
$00,$00,$00, $00,$17,$00, $03,$00,$03, $1F,$0A,$1F, // 32 Space ! " #
$16,$1F,$0D, $19,$04,$13, $0A,$15,$1A, $00,$03,$00, // 36 $ % & '
$00,$0E,$11, $11,$0E,$00, $0A,$04,$0A, $04,$0E,$04, // 40 ( ) * +
$10,$08,$00, $04,$04,$04, $00,$10,$00, $10,$0C,$03, // 44 , - . /
$1F,$11,$1F, $12,$1F,$10, $19,$15,$12, $15,$15,$0A, // 48 0 1 2 3
$07,$04,$1F, $17,$15,$09, $0E,$15,$09, $19,$05,$03, // 52 4 5 6 7
$1F,$15,$1F, $17,$15,$0F, $00,$0A,$00, $10,$0A,$00, // 56 8 9 : ;
$04,$0A,$11, $0A,$0A,$0A, $11,$0A,$04, $02,$19,$06, // 60 < = > ?
$0E,$15,$16, $1E,$05,$1E, $1F,$15,$0A, $0E,$11,$11, // 64 @ A B C
$1F,$11,$0E, $1F,$15,$11, $1F,$05,$01, $0E,$11,$1D, // 68 D E F G
$1F,$04,$1F, $00,$1F,$00, $10,$0F,$00, $1F,$04,$1B, // 72 H I J K
$1F,$10,$10, $1F,$06,$1F, $1F,$0E,$1F, $0E,$11,$0E, // 76 L M N O
$1F,$05,$02, $06,$09,$16, $1F,$05,$1A, $12,$15,$09, // 80 P Q R S
$01,$1F,$01, $0F,$10,$0F, $07,$18,$07, $1F,$0C,$1F, // 84 T U V W
$1B,$04,$1B, $03,$1C,$03, $19,$15,$13, $00,$1F,$11, // 88 X Y Z [
$03,$0C,$10, $11,$1F,$00, $02,$01,$02, $10,$10,$10, // 92 ] ^ _
$02,$05,$02, $0C,$12,$1C, $1F,$12,$0C, $0C,$12,$12, // 96 ° a b c
$0C,$12,$1F, $0C,$1A,$14, $04,$1F,$05, $14,$1A,$0C, // 100 d e f g
$1F,$02,$1C, $00,$1D,$00, $10,$0D,$00, $1F,$08,$14, // 104 h i j k
$00,$1F,$00, $1E,$06,$1E, $1C,$02,$1C, $0C,$12,$0C, // 108 l m n o
$1E,$0A,$04, $04,$0A,$1E, $1E,$04,$02, $14,$0A,$00, // 112 p q r s
$02,$1F,$02, $0E,$10,$0E, $06,$18,$06, $0E,$18,$0E, // 116 t u v w
$12,$0C,$12, $16,$08,$0E, $1A,$1E,$16, $04,$1F,$11, // 120 x y z {
$00,$1B,$00, $11,$1F,$04, $06,$02,$03, $1F,$1F,$1F); // 124 | } ~ Block
// Ausgabe Text als 3x5-Matrix; 0,0 ist immer oben, links
Procedure chDraw3x5(X,Y:Integer;Text:String[32]);
Var XC : Integer;
CC : Integer;
PC : Integer;
Begin
For XC:=1 to Length(Text) do
PC:=Integer(Ord(Text[XC]));
For CC:=0 to 2 do
gDrawLine(X+((XC-1)*4)+CC,Y,X+((XC-1)*4)+CC,Y+4,Mirror8(SF3x5[PC*3+CC]));
EndFor;
EndFor;
End chDraw3x5;
.
.
.
chDraw3x5(105,111,' !"#$%&'+#39+'()*+,-./0123456789:;<=>?');
chDraw3x5(105,117,'@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_');
chDraw3x5(105,123,#96+'abcdefghijklmnopqrstuvwxyz{|}~'+#127);
[Edit]Hab das 'r' geändert, es hat mir nicht gefallen. Rechts oberhalb ist jetzt noch ein Punkt dazu gekommen.
[Edit]"f" hatte einen Fehler
You must be logged in or your permissions are to low to see this Attachment(s).