Re: XML file format - Linux vs Windows



Le Tue, Jun 18, 2002, à 01:37:13PM -0500, Lars Clausen a écrit:


It's not a question of saving the bounding boxes.  The problem is that the
size of the text determines the size of the surrounding box.  If the text
doesn't scale linearly, the size of the box is indeterminate.


By the way, I think I've got a (slow ?) idea on how to perform scaling:

        * compute the text extents at scale 100%
        * if scale != 100%:
                font_scale = scale.
                while (1):
                        compute the text extents for font size (size * font_scale).
                        if (computed extents < (scale * 100%_extents)):
                                break
                        else:
                                font_scale *= 0.95
This way, in the worst case, we would display slightly smaller text than
what the scaling factor requires; however, we'd still use a bounding box
linear to the 100% bounding box (thinking about it, with the hinting and all
that stuff, I see no way for text to scale linearly under a certain size).

That might require a little surgery in the Renderers (basically, instead of
calling renderer->set_font(renderer,font,height), we'd call
        renderer->set_font(renderer,font,nominal_height,scaling_factor);

Same for renderer->get_text_width(), of course.

Does that sound good or rubbish ?

        -- Cyrille

-- 
Grumpf.




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