RE: font system: millipoints or floats?

2005-09-08 Thread Victor Mote
Jeremias Maerki wrote:

> I don't see a big problem if you switch to points and double 
> for the font library. These values can always be converted 
> back to millipoints as needed. It's a relatively isolated 
> area. After all, we already convert from and to millipoints 
> back and forth. Doing the same for the font library is not a 
> big deal I think. Unless I'm missing something, of course.

The only issue I can think of would be the cumulative effect of the
performance hit, and I'm not smart enough to predict whether that is
significant or not (there are some operations that would be saved internally
that might help pay for the expense of a client application converting). I
think I will do some experimentation before I go any further with that. Some
other day. Thanks for the feedback.

Victor Mote



Re: font system: millipoints or floats?

2005-09-08 Thread Jeremias Maerki
I agree with Vincent that there is no big motivation to change from ints
to doubles for FOP as a whole. After all, millipoints provide a
resolution of 72'000 dpi which should be enough for most applications.

I don't see a big problem if you switch to points and double for the
font library. These values can always be converted back to millipoints
as needed. It's a relatively isolated area. After all, we already
convert from and to millipoints back and forth. Doing the same for the
font library is not a big deal I think. Unless I'm missing something, of
course.

Anyway, switching FOP's internal coordinate system would be a huge task
and frankly, I like the integers for their readability while developing.
I'm almost thinking in millipoints by now. :-) You'd lose that with
points and double. But it's probably a matter of habit.

The rounding errors we're seeing in FOP occasionally are mostly there
because of an inconsistent development style. I don't think this has to
do with the resolution of FOP's internal coordinate system.

On 08.09.2005 00:10:08 Victor Mote wrote:
> I hope this doesn't open up another can of worms, but ...
> 
> One of aXSL's other potential client applications has suggested that points
> (represented by floats) be used instead of millipoints for parameters and
> return values in the font system. I thought I had seen something on fop-dev
> recently that made me think that a similar move was being considered for
> other parts of FOP, but I may have dreamed it.
> 
> I have never felt strongly about the matter either way. aXSL is till
> malleable enough to bend to such a change, and FOray will go along. If such
> a move is a benefit to FOP, all other known interested parties will be OK
> with it also, and I will handle the work on the aXSL and FOray sides. If it
> is *not* a benefit to FOP, IMO that kills the matter and aXSL will continue
> to use millipoints and other parties can convert as needed. I mention the
> whole thing only as an opportunity.
> 
> The task of converting FOP may be non-trivial, so I wouldn't assume that
> Vincent has signed up for that as part of his current work.
> 
> Victor Mote



Jeremias Maerki



Re: font system: millipoints or floats?

2005-09-08 Thread Vincent Hennebert

Hi Victor,


One of aXSL's other potential client applications has suggested that points
(represented by floats) be used instead of millipoints for parameters and
return values in the font system. I thought I had seen something on fop-dev
recently that made me think that a similar move was being considered for
other parts of FOP, but I may have dreamed it.


Related issues have been raised here:
http://marc.theaimsgroup.com/?l=fop-dev&m=112538394431613&w=2


I have never felt strongly about the matter either way. aXSL is till
malleable enough to bend to such a change, and FOray will go along. If such
a move is a benefit to FOP, all other known interested parties will be OK
with it also, and I will handle the work on the aXSL and FOray sides. If it
is *not* a benefit to FOP, IMO that kills the matter and aXSL will continue
to use millipoints and other parties can convert as needed. I mention the
whole thing only as an opportunity.

The task of converting FOP may be non-trivial, so I wouldn't assume that
Vincent has signed up for that as part of his current work.


I'm personally in favor of the best technical solution. In a first look I would 
tend to think that floats are better suited as they are potentially more precise 
than integers representing millipoints. In millipoints usual values will be 
comprised between 0 and 5,000,000 (2m paper sheet), that is only a part of the 
integer range. With integers it isn't possible to represent values inferior to 1 
millipoint, whereas it is possible with floats. That could result in less 
rounding errors.


That said, millipoint already is a very small length unit. Rounding errors at 
the millipoint level may not be perceptible. Let's imagine we cumulate an error 
as much as 0.5 mpt on a 2m paper sheet, we end up with a less than 3 pt error.

Of course if we multiply rounded values the error might grow up.

To conclude, I'm not sure if it will be a great benefit to switch to float 
values. I don't know how the values are manipulated and which are the 
requirements of the renderers. I'm asking for others' opinions.


Of course the switching won't simplify my work, but I'm not obliged to do it 
right now. I'm working on snapshots of aXSL and FOray and I'm not required to 
update them. I could to the conversion after a primary version is integrated 
into the trunk.


Vincent