[Oberon] FPGA - Fun with Fonts

Tomas Kral thomas.kral at email.cz
Tue Aug 28 10:12:56 CEST 2018


Hi,

Just toying with fonts. Does not take much of coding, passing TextFrame
as VAR may just add a few lines of code. That's what
TextFrame.DisplayLine() does.

PROCEDURE Font*;
  CONST STR = "hello";
  VAR ch: CHAR; s: ARRAY 6 OF CHAR;
    i, x, y, X, Y, dx, w, h, patadr: INTEGER;
    fnt: Fonts.Font;
BEGIN s := STR; X := 50; Y := 20;
  fnt := Fonts.This("Oberon10.Scn.Fnt");
  FOR i := 0 TO LEN(s)-1 DO ch := s[i];
    Fonts.GetPat(fnt, ch, dx, x, y, w, h, patadr);
    Display.CopyPattern(Display.white, patadr, x+X, y+Y, Display.paint);
    INC(X, dx)
  END ;
END Font;

-- 
Tomas Kral <thomas.kral at email.cz>


More information about the Oberon mailing list