ch17ex05.pro

来自「prolog,人工智能推理程序,运行环境prolog」· PRO 代码 · 共 56 行

PRO
56
字号
/*
   Turbo Prolog 2.0 Chapter 17, Example Program 5
   
   Copyright (c) 1986, 88 by Borland International, Inc
   
*/
constants
% To access your BGI drivers and fonts bgi_path may need to equal "..\\BGI".
   bgi_path = ""

% To access the GRAPDECL.PRO file you may need to add a path: 
% include "..\\programs\\GRAPDECL.PRO" 
include "GRAPDECL.PRO" 

goal
   initgraph(detect,0,GraphDriver,GraphMode,bgi_path),
   Title = "Font Example",
   setTextJustify(center_Text,center_Text),
   setUserCharSize(1,1,1,1),
   setTextStyle(triplex_Font,horiz_Dir, user_Char_Size),
   textWidth(Title,Width), textHeight(Title,Hight),
   setUserCharSize(200,Width,100,Hight),
   setTextStyle(triplex_Font,horiz_Dir, user_Char_Size),
   rectangle(0,0,200,100),
   outtextxy(100,48,Title),

   setUserCharSize(300,Width,100,Hight),
   setTextStyle(gothic_Font,horiz_Dir, user_Char_Size),
   rectangle(220,0,520,100),
   outtextxy(370,48,Title),

   /*  Vertical Sans-Serif Font */
   setUserCharSize(200,Width,150,Hight),
   setTextStyle(sans_Serif_Font,vert_Dir, user_Char_Size),
   rectangle(100,110,240,300),
   outtextxy(150,200,Title),

   setTextJustify(left_Text,center_Text),
   setTextStyle(small_Font,horiz_Dir, 1),
   outtextxy(380,200,"Press Key to exit"),

   setTextJustify(right_Text,center_Text),
   setTextStyle(small_Font,horiz_Dir, 4),
   outtextxy(380,208,"Press Key to exit"),

   setTextJustify(left_Text,center_Text),
   setTextStyle(small_Font,horiz_Dir, 6),
   outtextxy(380,220,"Press Key to exit"),

   setTextJustify(center_Text,center_Text),
   setTextStyle(default_Font,horiz_Dir, 2),
   outtextxy(380,240,"Press Key to exit"),

   readchar(_),
   closegraph.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?