Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!psuvax1!uwm.edu!wuarchive!uunet!wang!tegra!phillips From: phillips@tegra.COM (Steve Phillips) Newsgroups: comp.lang.postscript Subject: Re: Character side bearings Message-ID: <1143@io.tegra.COM> Date: 23 Jul 90 17:02:06 GMT References: <2259@dino.cs.iastate.edu> Reply-To: phillips@io.UUCP (Steve Phillips) Distribution: usa Organization: Tegra-Varityper, Inc. Billerica, MA Lines: 34 In article <2259@dino.cs.iastate.edu> hascall@cs.iastate.edu (John Hascall) writes: > How does one determine the left side bearing of a character (in a >particular font)? I am looking at section 5.5, "Font Metric Information", >of the Red Book, (pp 95-96), which says: "The sequence > > charpath flattenpath pathbbox > >may be used to determine character bounding boxes and side bearings." > > Well, I can see how it gives you the bounding box, but how do you >get the (left) side bearing? > Render the character at 1000 points starting at (0,0): /FontName findfont 1000 scalefont setfont 0 0 moveto (A) charpatah flattenpath pathbbox Now the X coordinate of the left edge of the path bounding box will be the left sidebearing in 1000th's of an em. What you're doing is positioning the em-square at the origin, so the pathbbox will give you the relative position of the character outline within the em-square. Hope this helps... - Steve -- ============================================================================ Steve Phillips Tegra-Varityper, Inc. tegra!phillips@uunet.com Billerica, MA ============================================================================