
(********************************************************************)
(*                                                                  *)
(*  testfont.sd7  Program to demonstrate bitmap fonts.              *)
(*  Copyright (C) 2010, 2012  Thomas Mertes                         *)
(*                                                                  *)
(*  This program is free software; you can redistribute it and/or   *)
(*  modify it under the terms of the GNU General Public License as  *)
(*  published by the Free Software Foundation; either version 2 of  *)
(*  the License, or (at your option) any later version.             *)
(*                                                                  *)
(*  This program is distributed in the hope that it will be useful, *)
(*  but WITHOUT ANY WARRANTY; without even the implied warranty of  *)
(*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   *)
(*  GNU General Public License for more details.                    *)
(*                                                                  *)
(*  You should have received a copy of the GNU General Public       *)
(*  License along with this program; if not, write to the           *)
(*  Free Software Foundation, Inc., 51 Franklin Street,             *)
(*  Fifth Floor, Boston, MA  02110-1301, USA.                       *)
(*                                                                  *)
(********************************************************************)


$ include "seed7_05.s7i";
  include "float.s7i";
  include "draw.s7i";
  include "keybd.s7i";
  include "text.s7i";
  include "stdfont10.s7i";
  include "stdfont12.s7i";
  include "stdfont14.s7i";
  include "stdfont16.s7i";
  include "stdfont18.s7i";
  include "stdfont20.s7i";
  include "stdfont24.s7i";
  include "vecfont10.s7i";
  include "vecfont18.s7i";
  include "cronos16.s7i";
  include "cronos27.s7i";
  include "pixmap_file.s7i";

var text: screen is text.value;

const array font: fontList is [] (
    stdFont10, stdFont12, stdFont14, stdFont16,
    stdFont18, stdFont20, stdFont24, cronos27);


const proc: main is func
  local
    var integer: yPos is 0;
    var integer: index is 0;
  begin
    screen(1024, 768);
    clear(curr_win, white);
    KEYBOARD := GRAPH_KEYBOARD;
    screen := openPixmapFontFile(curr_win);
    color(screen, black, white);
    for yPos key index range [] (38, 76, 108, 138, 163, 186, 205, 222) do
      setFont(screen, fontList[length(fontList) - index + 1]);
      setPosXY(screen, 6, yPos);
      write(screen, " !\"#$%&'()*+,-./0123456789:;<=>?");
    end for;
    for yPos key index range [] (58, 76, 98, 122, 151, 182, 219, 260) do
      setFont(screen, fontList[index]);
      setPosXY(screen, 1018 -
          width(fontList[index], "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"), yPos);
      write(screen, "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_");
    end for;
    for yPos key index range [] (306, 344, 376, 406, 431, 454, 473, 490) do
      setFont(screen, fontList[length(fontList) - index + 1]);
      setPosXY(screen, 6, yPos);
      write(screen, "`abcdefghijklmnopqrstuvwxyz{|}~");
    end for;
    for yPos key index range [] (284, 302, 324, 348, 377, 408, 445, 486) do
      setFont(screen, fontList[index]);
      setPosXY(screen, 1018 -
          width(fontList[index], "\160;¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿"), yPos);
      write(screen, "\160;¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿");
    end for;
    for yPos key index range [] (532, 570, 602, 632, 657, 680, 699, 716) do
      setFont(screen, fontList[length(fontList) - index + 1]);
      setPosXY(screen, 6, yPos);
      write(screen, "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß");
    end for;
    for yPos key index range [] (554, 572, 594, 618, 647, 678, 715, 756) do
      setFont(screen, fontList[index]);
      setPosXY(screen, 1018 -
          width(fontList[index], "àáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ€"), yPos);
      write(screen, "àáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ€");
    end for;
    readln(KEYBOARD);
  end func;
