[Mono-dev] libgdiplus pango patch

Jonathan Anderson jonathan.l.anderson at gmail.com
Thu Feb 12 06:46:16 EST 2009


Sebastien,

Thanks for the reply.

Sebastien Pouliot wrote:
> Hello Jonathan,
> 
> On Tue, 2009-02-10 at 13:53 +0700, Jonathan Anderson wrote:
>> Hi all,
>>
>> I was wondering if anyone has had a chance to look at my patch submitted 
>> last week yet.  Any and all feedback is appreciated, and if I need to do 
>> some more work to get this accepted, I just need to know what to do. 
> 
> I only had a quick look last week, but will look at it more carefully
> soon.
> 
> A quick comment: it needs a ChangeLog ;-)

I should have done that.  Here's a list of what my changes do:

* improve accelerator handling
* improve end-of-line whitespace trimming (still needs some work, but it 
should be about the same as the cairo renderer now)
* vertical text support (needs more work)
* clipping more consistent with MS GDI+
* better bidi text support
* string trimming closer to MS GDI+
* tab stops (untested)
* better bounding boxes returned (taking into account ink and logical space)
* support for codepointsFitted in MeasureString
* better linesFilled support in MeasureString


>> Should I create a bug in the tracker to help track the work on complex 
>> script support?
> 
> Yes, that would be useful - which brings me to a "long term" comment:
> libgdiplus can't switch to pango output until it becomes a superset of
> the features that it currently (custom text renderer) support - i.e.
> complex script support is awesome but not enough as many people depends
> on other features not yet available in the pango renderer.


Yes, I understand that.  I mainly want to get some code out there for 
complex script support that works better than what's there now.  Of 
course I'd like it to be the default some day, but I know there needs to 
be more work and testing done before that can be the case.  Even if it 
doesn't get to be the default, having a good option for non-roman 
scripts when needed is great.

There are a couple of issues that I've fixed since the patch I submitted 
as well (fixed a problem with vertical text and another difference with 
how MS GDI+ handles the NoWrap flag).  Should I do another patch with 
everything again, or just a patch on the patched version for those?

Here's what I know isn't supported and/or needs more work:
* Need to test the tab stop support
* There are a few small differences with the MS GDI+ in string trimming 
and wrapping that will be hard to fix unless I use the lower-level pango 
API instead of the pango_layout calls.  The cairo renderer also has some 
differences in these areas as well.
* digit substitution is not implemented
* the DisplayFormatControl flag is not implemented
* MeasureString is significantly slower than the cairo renderer 
(DrawString is a little slower, but not that much)

I don't think the digit substitution or DisplayFormatControl flag are 
implemented in the cairo renderer either.  I've built myself a test app 
to help see differences between MS GDI+, the cairo renderer, and the 
pango renderer, so that's helping a lot in working things out.

 From a MWF perspective, the only control that I think needs a bit of 
work is the TextBox and derivatives.  To be able to support non-roman 
scripts, it needs to think of text in terms of paragraphs instead of 
lines.  I have some ideas that I'll be playing with to push down some 
more of the rendering/placement functionality into the 
TextBoxTextRenderer.  I should be able to take the existing code and 
abstract it in a way that would allow the TextBox to swap rendering 
back-ends using the current code, uniscribe, or pango.

Jonathan Anderson


More information about the Mono-devel-list mailing list