Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!uwm.edu!rpi!zaphod.mps.ohio-state.edu!usc!cs.utexas.edu!chinacat!woody From: woody@chinacat.Unicom.COM (Woody Baker @ Eagle Signal) Newsgroups: comp.lang.postscript Subject: Re: Character side bearings Summary: Sidebearings. Message-ID: <1405@chinacat.Unicom.COM> Date: 18 Jul 90 02:14:28 GMT References: <2259@dino.cs.iastate.edu> Distribution: usa Organization: a guest of Unicom Systems Development, Austin Lines: 41 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 > > 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? Well, it turns out that the lower left x coordinate IS the left sidebearing. Since bounding box just encloses the character, if the character is offset from the current position (i.e. the leftmost point of the character) either positive or negative, it will show up as a positive or negative number, which is the sidebearing. After struggling for better than 9 months, and after not getting replies to several inquires, I am now prepared to state that the RED book appears to be FLAT WRONG when it says that the metrics entry can be an array, that includes the left sidebearing and the width. The width part works, but regardless of what you put in the other element, it does not work. Adobe has a major gap between documentation and implemtation. IF some one can prove me wrong on this, I'll gladly retract this statement. To do so, send me or post a fragment of code that clearly demonstrates teh altering of the sidebearing. Print some letters in say Times Roman, especially 'j' and 'l' and 'W', then alter the the width, and print them again, then alter the sidebearing and the width and print them again. The application is monospacing the proportional fonts. By measuring the width of say a "W", and taking that to be the cell width, computing the bounding box for a character, subtracting it from the cell width, dividing the result by 2, one can get an offset that you need to shift the left sidebearing by inorder to make the character sit squarely in the "cell" width. In addition, you have to set the character width to the value computed from "W". If you just change the character widths to the value obtained by "W", and then print the text, it becomes very obvious that while the "escapement" of the characters has been changed, the characters are NOT centered in the cell. Computing the diffrence, and altering the sidebearing should fix the problem. I have not gotten it to work, inspite of many hours (so far over 20) of hacking at it, and working on it. Cheers Woody