home *** CD-ROM | disk | FTP | other *** search
- (*-------------------------------------------------------------------------*)
- (* GRAFWRIT.PAS *)
- (* Zeichenzellen-Ausgaberoutinen der Grafikserie *)
- (*-------------------------------------------------------------------------*)
- PROCEDURE InitGrafWrite (NameDesFont : TGrafStr);
-
- VAR f : FILE OF TFont;
-
- BEGIN (* Variablen inititalisieren *)
- BoldFont := FALSE; KursivFont := FALSE; SmallFont := FALSE;
- DoubleHighFont := FALSE; DoubleWideFont := FALSE;
- FontWriteMode := TransparentMode;
- IF Length(NameDesFont) = 0 THEN (* Font laden *)
- NameDesFont := DefaultFontName;
- Assign(f,NameDesFont);
- ReSet(f); Read(f,Font); Close(f);
- END;
- (*-------------------------------------------------------------------------*)
- PROCEDURE GrafWriteXY (x,y : REAL; Str : TGrafStr);
-
- VAR i, xpos, ypos : INTEGER; Cell11, Cell12, Cell21, Cell22 : TCell;
-
- (*-----------------------------------------------------------------------*)
- PROCEDURE WriteCellXY (x,y : INTEGER; Cell : TCell); (* 1 Zeichen ausgeb.*)
-
- VAR i, j : TCellElemIndex;
-
- PROCEDURE clip(x, y: INTEGER);
- BEGIN
- WITH window[Aktwin]^ DO
- IF (x>=Vxmin) AND (x<=Vxmax) AND (y>=Vymin) AND (y<=Vymax) THEN
- Point(x,y)
- END;
-
- BEGIN
- FOR i := 0 TO CellSize DO
- FOR j := 0 TO CellSize DO
- CASE FontWriteMode OF
- TransparentMode : IF Cell[i,j] THEN clip(xpos+j, ypos+i);
- ReplaceMode : IF Cell[i,j] THEN clip(xpos+j, ypos+i)
- ELSE
- BEGIN
- Set_Pen_Color(First_Color_Value);
- clip(xpos+j, ypos+i);
- Set_Pen_Color(Last_Color_Value)
- END
- END
- END;
- (*-----------------------------------------------------------------------*)
- BEGIN
- xpos := x_WinTrans(x); ypos := y_WinTrans(y);
- FOR i := 1 TO Length(Str) DO
- BEGIN
- Cell11 := Font[Ord(Str[i])];
- IF BoldFont THEN MakeBold(Cell11);
- IF SmallFont THEN MakeSmall(Cell11);
- IF KursivFont THEN MakeKursiv(Cell11);
- IF DoubleHighFont THEN MakeDoubleHigh(Cell11,Cell21);
- IF DoubleWideFont THEN
- BEGIN
- MakeDoubleWide(Cell11,Cell12);
- IF DoubleHighFont THEN MakeDoubleWide(Cell21,Cell22)
- END;
- WriteCellXY(xpos, ypos, Cell11);
- IF DoubleHighFont THEN
- BEGIN
- ypos := ypos + Succ(CellSize);
- WriteCellXY(xpos, ypos, Cell21);
- ypos := ypos - Succ(CellSize)
- END;
- xpos := xpos + Succ(CellSize);
- IF DoubleWideFont THEN
- BEGIN
- WriteCellXY(xpos, ypos, Cell12);
- IF DoubleHighFont THEN
- BEGIN
- ypos := ypos + Succ(CellSize);
- WriteCellXY(xpos, ypos, Cell22);
- ypos := ypos - Succ(CellSize)
- END;
- xpos := xpos + Succ(CellSize)
- END
- END
- END;
- (*-------------------------------------------------------------------------*)
- (* Ende von GRAFWRIT.PAS *)
-