View Issue Details

IDProjectCategoryView StatusLast Update
0031674LazarusWidgetsetpublic2017-04-19 21:50
ReporterAnton Kavalenka Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformi386OSLinux 
Product Version1.7 (SVN) 
Summary0031674: gtk2: DrawText implementation DT_NOPREFIX faulty handling
DescriptionTLabel with ShowAccelChar=true always cause GTK2 to complain in console:

project1:11848): Pango-WARNING **: Invalid UTF-8 string passed to pango_layout_set_text()

This happens only with cyrillic text prefixed with ampersand &
Steps To ReproduceRun the attached project. GTK2 complains only on '&Привет' caption but not on '&__Привет'
TagsNo tags attached.
Fixed in Revisionr54633
LazTarget-
WidgetsetGTK 2
Attached Files

Relationships

related to 0031677 closedZeljan Rikalo gtk3: Can not link GTK3 application, non-existent symbol imported 

Activities

Anton Kavalenka

2017-04-17 21:46

reporter  

laztest102.zip (128,866 bytes)

Anton Kavalenka

2017-04-17 22:12

reporter   ~0099649

Seems like gtk2winapi.inc:2661

Calculating the underscore line length

GetTextExtentPoint(DC, @aStr[pIndex], 1, Points[1]);
      Points[1].cX := Points[0].cX + Points[1].cX;
      Points[1].cY := Points[0].cY;

Cyrillic symbol at position 1 is obviously not 1-byte in size. It is definitely wrong UTF8.

CudaText man

2017-04-18 08:22

reporter   ~0099660

I replaced this ln to
      GetTextExtentPoint(DC, @aStr[pIndex], UTF8CharacterLength(@aStr[pIndex]), Points[1]);
and error gone..

Juha Manninen

2017-04-18 13:59

developer   ~0099667

Is the problem only with GTK2?

Anton Kavalenka

2017-04-18 18:09

reporter  

Anton Kavalenka

2017-04-18 18:11

reporter   ~0099672

Last edited: 2017-04-18 18:25

View 3 revisions

Same problem in GTK3

gtk3winapi.inc:921
GetTextExtentPoint(DC, @aStr[pIndex], 1, Points[1]);


Btw GTK3 WS can not be linked. There is no such symbol gdk_pixbuf_gettext in libgdk_pixbuf-2.0.so.0

Reported in 0031677

Juha Manninen

2017-04-18 20:12

developer   ~0099673

Fixed both GTK2 and GTK3, please test.

Issue History

Date Modified Username Field Change
2017-04-17 21:46 Anton Kavalenka New Issue
2017-04-17 21:46 Anton Kavalenka File Added: laztest102.zip
2017-04-17 22:12 Anton Kavalenka Note Added: 0099649
2017-04-18 08:22 CudaText man Note Added: 0099660
2017-04-18 13:58 Juha Manninen Assigned To => Juha Manninen
2017-04-18 13:58 Juha Manninen Status new => assigned
2017-04-18 13:59 Juha Manninen Note Added: 0099667
2017-04-18 18:09 Anton Kavalenka File Added: Здымак экрана, 2017-04-18 19-10-08.png
2017-04-18 18:11 Anton Kavalenka Note Added: 0099672
2017-04-18 18:19 Anton Kavalenka Note Edited: 0099672 View Revisions
2017-04-18 18:25 Anton Kavalenka Note Edited: 0099672 View Revisions
2017-04-18 19:15 Juha Manninen Relationship added related to 0031677
2017-04-18 20:12 Juha Manninen Fixed in Revision => r54633
2017-04-18 20:12 Juha Manninen LazTarget => -
2017-04-18 20:12 Juha Manninen Note Added: 0099673
2017-04-18 20:12 Juha Manninen Status assigned => resolved
2017-04-18 20:12 Juha Manninen Resolution open => fixed
2017-04-19 21:50 Anton Kavalenka Status resolved => closed