home *** CD-ROM | disk | FTP | other *** search
- /* Text2Block 1.03 (19.04.95) by NDY's */
- OPTIONS RESULTS
- /* Decimal point */
- GetDocItemPrefs "DECIMAL"
- deci=RESULT
- DocItemPrefs "DECIMAL PERIOD"
- /* For cursor movement */
- ShiftUp
- AltUp
- CtrlUp
- /* Selected text or current paragraph? */
- Status "PARAPOS"
- pos=RESULT
- lf="0A"x
- IF Words(pos)=4 THEN
- DO
- Extract
- len=Length(RESULT)
- IF Right(RESULT,1)=lf THEN len=len-1
- MoveToPara Word(pos,1) Word(pos,2)
- END
- ELSE
- DO
- Status "PARACHARS"
- len=RESULT
- MoveToPara Word(pos,1) 0
- END
- /* Get page # */
- Status 'PAGE "INSERT"'
- page=RESULT
- /* Process chars */
- old=gettexttypespecs()
- text=""
- w=0
- h=0
- nr=0
- x=""
- DO i=0 TO len
- specs=gettexttypespecs()
- IF specs=old & x~=lf THEN
- text=text||x
- ELSE
- DO
- CALL draw
- GetObjectCoords
- IF x=lf THEN
- DO
- w=0
- h=h+Word(RESULT,5)
- text=""
- END
- ELSE
- DO
- w=w+Word(RESULT,4)
- text=x
- END
- old=specs
- END
- Extract
- x=RESULT
- Cursor "RIGHT"
- END
- IF text~="" THEN
- DO
- old=specs
- CALL draw
- END
- /* Group */
- SelectObject
- DO i=1 TO nr
- SelectObject obj.i "MULTIPLE"
- END
- Group
- Redraw
- DocItemPrefs "DECIMAL" deci
- EXIT
-
- PROC draw:
- TextBlockTypePrefs old
- DrawTextBlock page 1+w 2+h '"'||text||'"'
- nr=nr+1
- obj.nr=RESULT
- Redraw
- RETURN
- PROC gettexttypespecs: PROCEDURE /* specs=gettexttypespecs() */
- Status "FONTSIZE"
- p="SIZE" RESULT
- Status "FONTLEADING"
- p=p "LEADING" RESULT
- Status "FONTWIDTH"
- p=p "WIDTH" RESULT
- Status "FONTOBLIQUE"
- p=p "OBLIQUE" RESULT
- Status "FONTCOLOR"
- p=p "COLOR" RESULT
- Status "FONTNAME"
- f=RESULT
- IF Left(f,1)~=" " THEN f=" "||f /* Incase a newer FW doesn't return the leading space (" Fontname") anymore */
- p=p "FONT"||f
- RETURN p
-
-