Pango and units




Right now the situation with specifying distances in Pango
is rather chaotic - there are places where it uses 
points as doubles, places where it uses 64ths of a point,
etc.

I'd like to switch this over to something consistent:

 All units are in 1000ths of a point (Postscript point -- 
 1/72nd of an inch) and are represented as signed integers.
 This gives a range of .75km at a precision of 35 um, which
 should be sufficient for most purposes.

 (The followers of Cristo and IBM researchers shouldn't have
 trouble inserting the appropriate scale factors.)

 The reason for using signed integers is that the range is
 sufficiently large that way and it removes a lot of the
 traps of using signed integers for computations in C.

 The one exception to this is user-specified distances that
 are logically relative to font size, such as baseline offsets.
 These distances are given in 10,000ths of a em, where 
 an em is defined as being 12pt for a 12pt font, etc.
 
 (The reason for using 10,000ths here instead of 1000ths is
 to keep the range approximately the same for both units.)

GnomeText uses a scale factor of 50 in some places, but this seems
extraneous to me. It complicates things, and the range is 
large enough unscaled.

Please let me know if you see any problems with the above.

                                        Owen





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]