home *** CD-ROM | disk | FTP | other *** search
- From: arb@comp.lancs.ac.uk (Andrew Brooks)
- Subject: Re: kerning in Draw text areas
- Date: Fri, 26 Nov 1993 19:11:01 GMT
-
- >Can some kind soul with the (RISCOS3) PRMs tell me the layout of data for
- >the new (RISCOS3) text areas - the ones which can have a bit set to allow
- >kerning?
-
- The objects are type 12 instead of type 1 and are identical with the
- addition of a 28 byte header: 6 words for a transformation matrix and
- a word for the flags. Bit 0 of the flags is for kerning and bit 1 is
- for reversed direction.
-
- Below is an example program which can convert text objects in draw files
- into kerned text objects. I believe someone sells a similar program (with
- a wimp interface) for 10 pounds.
-
- Andrew.
-
- REM > DrawText
- REM ARB 12/11/93
- REM Modify text objects in draw file to be kerned
-
- FileIn$="$.Drawfile"
- FileOut$="$.Output"
-
- F%=OPENIN(FileIn$)
- IF F%=0 ERROR 0,"Cannot open file "+FileIn$
- FileSize%=EXT#F%
- CLOSE#F%
-
- F%=OPENOUT(FileOut$)
- IF F%=0 ERROR 0,"Cannot create file "+FileOut$
-
- DIM block% FileSize% : REM loaded file
- DIM header% 28 : REM fake transformed text header
-
- header%!0 = &10000
- header%!4 = 0
- header%!8 = 0
- header%!12 = &10000
- header%!16 = 0
- header%!20 = 0
- header%!24 = 1 : REM flags = kerned
-
- OSCLI"Load "+FileIn$+" "+STR$~block%
-
- REM skip file header
- offset% = 0
- PROCout(F%,block%,40)
- offset% = 40
-
- WHILE offset% < FileSize%
- ptr% = block%+offset%
- type% = !ptr%
- size% = ptr%!4
- IF type%=1 THEN
- !ptr% = 12
- ptr%!4 = ptr%!4 + 28
- PROCout(F%,ptr%,24) : REM updated object header
- PROCout(F%,header%,28) : REM transformed text header
- PROCout(F%,ptr%+24,size%-24) : REM rest of object
- ELSE
- IF type%=12 THEN ptr%!48 = ptr%!48 OR 1
- PROCout(F%,ptr%,size%)
- ENDIF
- offset% += size%
- ENDWHILE
-
- CLOSE#F%
- OSCLI"SetType "+FileOut$+" Drawfile"
- END
-
- DEF PROCout(fd%,addr%,len%)
- SYS "OS_GBPB",2,fd%,addr%,len%
- ENDPROC
-
-
-