/* :ts=3 ** italicises a complete font ** ** written & © by Ralph Reuchlein 1998 ** ** Read TS_Stylist.Readme for more information. ** */ DEBUG = 1 CALL PRAGMA("PRIORITY",3) /* without it its not possible (we need tan() and atan()) */ IF ~SHOW('L','rexxmathlib.library') THEN DO CALL ADDLIB('rexxmathlib.library',0,-30) END ADDRESS 'TYPESMITH' OPTIONS RESULTS VERSION; ver=RESULT/100.0 IF ver<2.0 THEN DO SAY "You need TypeSmithV2.0 or higher!" EXIT 0 END /* parse scale value */ PARSE ARG degree startchar endchar oups IF degree="DEFAULT" THEN DO degree=10 END IF ~DATATYPE(degree,"WHOLE") THEN DO CALL Usage END IF (degree<=-15 | degree>=15) THEN DO SAY "degree value out of range." EXIT 0 END IF ~DATATYPE(startchar,"WHOLE") THEN DO IF LENGTH(startchar)=1 THEN DO startchar=C2D(startchar) END END IF ~DATATYPE(endchar,"WHOLE") THEN DO IF LENGTH(endchar)=1 THEN DO endchar=C2D(endchar) END END IF DATATYPE(startchar,WHOLE) & DATATYPE(endchar,WHOLE) THEN DO IF (startchar<0 | endchar>255 | startchar>endchar) THEN DO SAY " must be less or same as and both values must be in 0<=x<=255!" CALL Usage END END ELSE DO IF startchar="" & endchar="" THEN DO startchar=0; endchar=255; END ELSE DO Call Usage END END SET_SCALE 2 /* 1:2 scale = 50% */ /*SHOW_FILLED 1*/ DO char=startchar TO endchar SAY "Italicising char" char "by" degree"° ..." GOTO_CHAR char GET_NUMPATHS; paths=RESULT IF paths>0 THEN DO /* correct slant position */ CALL CorrectSlant paths degree /* skew character */ SELECT_ALL SKEW degree END END SET_WEIGHT "Italic" SET_NOTICE "Automatically italicized by AMIGA TypeSmith® using rr_SlantFont ARexx script (© by Ralph Reuchlein 1998)" EXIT 0 /*------------------------------------------------------------------*/ Usage: PROCEDURE SAY "rr_SlantFont [ ]" SAY " [Use string DEFAULT for for standard slant value]" EXIT 0 RETURN CorrectSlant: PROCEDURE PARSE ARG paths degree /* scan for most bottom point */ min=999999 FIRST_PATH DO path=1 TO paths GET_NUMPOINTS; points=RESULT; DO point=1 TO points GET_POINTY; y=RESULT IF y