!This file is part of VEL_demo, copyright David Keyes, 2007. ! !This source file 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 3 of the License, or !(at your option) any later version. ! !This code 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. ! !For terms of the GNU General Public license see . GLOBAL DRAWING MODULE dim_format( INT feet:=0; INT inches:=0; INT num:=0; INT den:=0; INT style:=1; VAR FLOAT t_wid; VAR FLOAT t_off; VAR FLOAT dim_off); STRING t_strg*132; FLOAT t_sizeA, t_sizeB, t_width, t_space, slash, dim_ext; INT scale, pen_col; BEGINMODULE IF den=0 THEN t_space:=0.3; ! kerning ELSE t_space:=0.7; ENDIF; part(#1, dim_vars(scale, pen_col, t_off, t_sizeA, t_sizeB, t_width, slash, dim_ext, dim_off)); set(TSIZE=t_sizeA, TWIDTH=t_width); IF feet <> 0 OR style =3 THEN t_strg:= (str(feet,1,0)) + "'-" + (str(inches,1,0)); ELIF feet = 0 AND inches <> 0 THEN t_strg:=str(inches,1,0); ELSE t_strg:=""; ENDIF; t_wid:=textl(t_strg) + (textl(" ")* t_space); IF den <> 0 THEN set(TSIZE=t_sizeB); t_wid:=t_wid + (textl(str(den,1,0))); ENDIF; ENDMODULE