pango bug+fix

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

pango bug+fix

Mark Plas

Hi,

 

I found some small bugs in the Pango library.

 

The first one is this:

 

Layout>>utf8Text

               

                | cPointer |

                cPointer := LibPango pango_layout_get_text: handle.

                ^cPointer copyCStringFromHeap changeClassTo: ByteArray

 

The #copyCStringFromHeap garbles the utf8 result because it decodes using a default decoder and later on in #text it gets decoded again using utf8.

 

I think it should be:

 

                utf8Text

               

                | cPointer |

                cPointer := LibPango pango_layout_get_text: handle.

                ^cPointer copyCStringFromHeap: #utf8

 

and then #text should just be:

 

text

 

                ^self utf8text

 

or you could get rid of utf8text alltogether…

 

The second one is this:

 

The method showOn: aCR startY: startY stopY: stopY

 

crashes because it sends #fromPangoScale to a Float which doesn't implement it. It happens on this line:

 

                                lineX := lineExtents x fromPangoScale.

 

I don't think it should send fromPangoScale because it has already been sent in #x.

 

Mark

 


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc