At 06:02 PM 5/24/00 +0200, Fr�d�ric Gobry wrote:
>My problem is to find a good heuristic for the margin lengths... Would it be
>possible to give the size in some sort of font-related unit, like em and ex
>in LaTeX ? 

Currently, all dimensions are specified in absolute lengths using the 
following units:

  in, cm, pt, pi

As you can probably tell from looking at Shaw's ultra-cool paragraph dialog, 
this corresponds *very* well to the capacity set offered by modern word 
processors.  ;-)

The relevant code for handling these units is here:

  abi/src/af/util/xp/ut_units.cpp

As you can see from the existing APIs, we're currently not passing enough 
information to allow relative units such as the following from the CSS2 spec:

  em: the 'font-size' of the relevant font 
  ex: the 'x-height' of the relevant font 
  px: pixels, relative to the viewing device 

To add support for these units, you'd need to widen the XP methods for font 
manipulation to expose additional information about font dimensions.  

More to the point, I'm not sure what the formatting algorithm would be to 
allow us to choose *which* font to measure when calculating paragraph 
margins, since the font can vary on a per-character basis inside the 
paragraph.  

>Or do you know another method to achieve the same effect ?

When in doubt, punt.  :-)

For now, why not export each entry using the same paragraph-level style?  
For a hint on how to do this, see the following document:

  abi/test/wp/Styles.abw

The plumbing is already in place to honor any named styles found at the 
beginning of the document, and this way, you can easily change the margins 
for all entries by just (manually) updating the properties on that style 
definition. 

Of course, this would be a lot more useful once we add GUI support for 
editing styles.  Sigh. 

Paul 




Reply via email to