Skip to content

Text: support inline images #2022

Closed
flutter-team-archive/engine
#8207

Description

@Hixie

See #2021 for a use case we should convert to inline images.

Right now, the paragraph will wrap really weirdly if the device is too narrow.

Activity

  1. added
    c: new featureNothing broken; request for a new capability
    frameworkflutter/packages/flutter repository. See also f: labels.
    engineflutter/engine related. See also e: labels.
    customer: galleryRelating to flutter/gallery repository. Please transfer non-framework issues there.
    on Feb 19, 2016
  2. added this to the milestone on Feb 19, 2016
  3. HansMuller commented on Feb 19, 2016

    @HansMuller
    Contributor

    I think we'll want to support text that contains inline widgets. For example (from the Chips section of the MD spec):

    chips

  4. Hixie commented on Feb 19, 2016

    @Hixie
    ContributorAuthor

    Yeah, what we actually need to support is "just" a placeholder rectangle with a paint callback. Then you just hook the rendering boxes into it and can have whatever you want in there.

  5. namiwang commented on Jun 29, 2017

    @namiwang

    I believe flutter also should support inline Icon/ImageIcon in Text/TextSpan.

    I guess this doesn't worth another issue.

  6. Hixie commented on Jun 29, 2017

    @Hixie
    ContributorAuthor

    Yeah, once we support this you'll be able to put any RenderBox in there.

  7. pulyaevskiy commented on Jan 2, 2018

    @pulyaevskiy
    Contributor

    This would also be a desirable feature for (future) rich-text editors (I'm currently working on one).

  8. jay7n commented on Mar 21, 2018

    @jay7n

    Hi @pulyaevskiy , is there some progress on this issue ? I have encounterd this problem recenetly, and want to get this feature urgently ...

  9. pulyaevskiy commented on Mar 21, 2018

    @pulyaevskiy
    Contributor

    @jay7n in regards to this issue (inline images in TextSpan) I didn't have any plans to work on implementing this any time soon. If you're interested in rich-text editor, I've had good progress on it since. But it's just a part of a bigger project and I'm not working on the editor full time.

  10. jay7n commented on Mar 27, 2018

    @jay7n

    @pulyaevskiy thanks for your reply and sorry for the delay. I mocked up a quick workaround regarding this missing feature. The idea is simple: detect the images width and the total text size(multiply text count by single font size), and check if there's not enough space for the whole text, then split it to two text widgets, one following the images, the other lay down to next line. All widgets are wrapped in a Wrap widget. I'm not sure this is the right way to do it, but I think the workaround is workable

  11. exiic commented on Jun 8, 2018

    @exiic

    Hi @jay7n , can you provide some sample code? Thanks.

  12. jay7n commented on Jun 13, 2018

    @jay7n

    @exiic I was fixing this issue as a member of Xianyu Team. And as a team we’re currently working on a series of advanced flutter practices, one of which is this “inline-imgs” issue. We’re going to build a group on github and share some code which we think might be worth broadcasting. I’ll let you know once we’re ready~ thank you

  13. 21 remaining items

  14. GaryQian commented on Jun 4, 2019

    @GaryQian
    Contributor

    Landing process started. Reopening as the main PR has not landed yet.

  15. GaryQian commented on Jun 4, 2019

    @GaryQian
    Contributor

    Main PR has been moved to #33794 to fix versioning errors

  16. GaryQian commented on Jun 4, 2019

    @GaryQian
    Contributor

    The feature has landed, but I will keep this open for a little longer just in case it is rolled back since this does contain breaking changes.

  17. GaryQian commented on Jun 5, 2019

    @GaryQian
    Contributor

    Temporarily reverted due to performance benchmark regressions.

  18. GaryQian commented on Jun 5, 2019

    @GaryQian
    Contributor

    #33946 Reland PR

  19. GaryQian commented on Jun 6, 2019

    @GaryQian
    Contributor

    Status update, currently working on ensuring this change works nicely with the plugins system, and some other misc compatibility issues due to the breaking nature of this change. I will be sure to notify everyone when this feature is fully committed and unlikely to be rolled back, but as of now, it is still rolling in and out of the master branch as we observe the impact of the change.

  20. GaryQian commented on Jun 7, 2019

    @GaryQian
    Contributor

    if you want to experiment with the feature, feel free to work with a snapshot of flutter with the changes in. The feature itself is steady and should be functional.

  21. GaryQian commented on Jun 7, 2019

    @GaryQian
    Contributor

    #34051 This version contains backwards compatibility API to minimize impact of breaking changes.

  22. GaryQian commented on Jun 13, 2019

    @GaryQian
    Contributor

    This change should be (relatively stably) in master as of 938e4eb. The main chunk of changes can be found in c2eaf83. Expecting to roll to dev in a short time. I will close this for now. Please feel free to reopen or provide feedback!

  23. MstrZeroOne commented on Jan 4, 2021

    @MstrZeroOne

    @pulyaevskiy thanks for your reply and sorry for the delay. I mocked up a quick workaround regarding this missing feature. The idea is simple: detect the images width and the total text size(multiply text count by single font size), and check if there's not enough space for the whole text, then split it to two text widgets, one following the images, the other lay down to next line. All widgets are wrapped in a Wrap widget. I'm not sure this is the right way to do it, but I think the workaround is workable

    I published package drop_cap_text to achive DropCapText, you can also put an image as custom widget inside DropCap.

    image

    I'm using this plugin and I hove an issue: mtiziano/drop_cap_text#14

  24. github-actions commented on Aug 7, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  25. locked as resolved and limited conversation to collaborators on Aug 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

a: typographyText rendering, possibly libtxtc: new featureNothing broken; request for a new capabilitycustomer: galleryRelating to flutter/gallery repository. Please transfer non-framework issues there.engineflutter/engine related. See also e: labels.frameworkflutter/packages/flutter repository. See also f: labels.

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions