drop_cap_text icon indicating copy to clipboard operation
drop_cap_text copied to clipboard

First line is duplicated if there are multiple lines with image.

Open azhar294 opened this issue 5 years ago • 10 comments

First line is duplicated ( means repeating ) if there are multiple lines of text with image. I checked this in version 1.0.1 it's working fine. From 1.0.2 this issue is happening.

azhar294 avatar Feb 04 '20 09:02 azhar294

thanks @azhar294 can you please paste code example?

mtiziano avatar Feb 04 '20 11:02 mtiziano

@azhar294 ?

mtiziano avatar Feb 13 '20 21:02 mtiziano

child: new DropCapText(
  'Long Text',
  dropCap: DropCap(
    width: 20,
    height: 10,
    child: Image.asset(
      'assets/verified_drop_cap.png'),
  dropCapPadding: new EdgeInsets.only(top: 5.0),
  style: new TextStyle(
    fontWeight: FontWeight.bold,
    fontSize: 14.0,height: 1.2),
    maxLines: 3,
  overflow: TextOverflow.ellipsis,
),

azhar294 avatar Feb 14 '20 06:02 azhar294

I have the same problem. If some of the text next to the picture is cut off at the end of the picture, the line that was cut is duplicated on the first line immediately after the picture. You can test this by changing your device or by changing the height of TextStyle on the same device.

  • The image is used for the drop cap and below is my code. DropCapText(pickedContent, dropCapPadding: EdgeInsets.only(right: 5, bottom: 0,), style: TextStyle( height: 1.15, fontSize: mediaQuery.size.width * 0.04 > 25 ? 25 : mediaQuery.size.width * 0.04, ), dropCap: DropCap( width: xxx, height: xxx, child: GestureDetector( onTap: () { xxx }, child: ImageContent(pickedImage)), ))

*** This bug was tested on a real device. (Test device: Galaxy Note 4, Galaxy S8)


*** Changed : The problem does not occur now. I will report again if that happens again.

exptk3 avatar Feb 25 '20 08:02 exptk3

Tested @azhar294 and @exptk3 code with 1.0.7 and everything works fine. Please be more accurate, attach screen + lib version

mtiziano avatar Feb 26 '20 22:02 mtiziano

Tested @azhar294 and @exptk3 code with 1.0.7 and everything works fine. Please be more accurate, attach screen + lib version

At the time of writing the issue report, there was a problem that the text at the end of the picture was duplicated. But, At present, the problem does not occur. In the meantime, I've upgraded Android Studio, flutter sdk, and so on, but it's not clear exactly why that bug was resolved. Anyway if I find the same problem again, I will report more detailed information. Thank you.

exptk3 avatar Mar 08 '20 09:03 exptk3

The problem mentioned above occurred again and this time I figured out how to reproduce it.

  • bug description : When the text was displayed with the picture --> the text at the end of the picture was cut off or duplicated.
  • Reproducing method  - This problem was independent of device type and was reproduced in a virtual emulator (of android studio).
  • This bug seems to be related to the type of language or font height.  - If you test while changing the language type, font type, font style height, etc., you may see duplicates (Korean image1 : '트 합니다.' , image2 : '그림이 있는') or some characters cut off (Arabic) as shown in the attached image.

DropCapText(pickedContent, dropCapPadding: EdgeInsets.only(right: 5, bottom: 0,), style: TextStyle( height: 1.15, --> change from 1.0 to 1.5 --> maybe bug appear

 - If you test it in Korean, Arabic, etc. rather than in a low-height language like English, you will be able to reproduce it immediately.  - Please refer to the attached picture.

200317_dropcaptext_bug 200317_02_dropcaptext_bug2

exptk3 avatar Mar 17 '20 05:03 exptk3

I have same problem:

DropCapText( 'long text', dropCapPosition: DropCapPosition.end, textAlign: TextAlign.justify, style: TextStyle(fontSize: 24), dropCap: DropCap( width: 478 * 0.4, height: 640 * 0.4, child: Padding( padding: EdgeInsets.only(left: 20, bottom: 20), child: Image.asset( "assets/cabinet1.jpg", ))), ); DropCapText

teshlya avatar Mar 29 '20 13:03 teshlya

I have same problem:

DropCapText( 'long text', dropCapPosition: DropCapPosition.end, textAlign: TextAlign.justify, style: TextStyle(fontSize: 24), dropCap: DropCap( width: 478 * 0.4, height: 640 * 0.4, child: Padding( padding: EdgeInsets.only(left: 20, bottom: 20), child: Image.asset( "assets/cabinet1.jpg", ))), ); DropCapText

I'm use Flutter Web. This not work in PC Chrome but on emulator is fine. TextPainter.getPositionForOffset() method return not correct value. DropCapText package everythink fine.

teshlya avatar Mar 29 '20 17:03 teshlya

i've tested your code but have no problems. Additional info?

mtiziano avatar Mar 29 '21 15:03 mtiziano