Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@GaryQian
Copy link
Contributor

@GaryQian GaryQian commented Mar 19, 2019

Part of a series of work to add text inline widgets, to fix flutter/flutter#2022.

This PR adds LibTxt and dart:ui support for embedding widgets inline into text.

Specifically, LibTxt's responsibility is to leave an open space where the widget will then be drawn into by the framework.

The API exposed for accomplishing this is:

  • ParagraphBuilder.AddWidget(width, height, baseline); adds a representation of a widget to the paragraph
  • Paragraph.GetBoxesForWidgets(); returns a list of rects/boxes that bound all widgets in the paragraph.

This PR should only make non-API-breaking additions and should be safe to land with no immediate framework changes.

@GaryQian GaryQian added the Work in progress (WIP) Not ready (yet) for review! label Mar 19, 2019
@GaryQian GaryQian changed the title Implement LibTxt inline text widget support Implement LibTxt/dart:ui inline text widget support Mar 20, 2019
@GaryQian GaryQian changed the title Implement LibTxt/dart:ui inline text widget support Implement LibTxt/dart:ui text inline widget support Mar 20, 2019
@GaryQian GaryQian removed the Work in progress (WIP) Not ready (yet) for review! label Mar 20, 2019
@GaryQian
Copy link
Contributor Author

GaryQian commented Apr 23, 2019

We now track and pass the indicies of the us-added placeholder U+FFFC so it is now safe to use U+FFFC in text and we do not need to do replacement anymore

@Hixie
Copy link
Contributor

Hixie commented Apr 23, 2019

Oh ok, cool.

/// * For a 30x50 placeholder that sits completely on top of the alphabetic baseline, use:
/// `addPlaceholder(30, 50, PlaceholderAlignment.aboveBaseline, baseline: TextBaseline.alphabetic)`.
/// * For a 30x50 placeholder with 40 pixels above and 10 pixels below the alphabetic baseline, use:
/// `addPlaceholder(30, 50, PlaceholderAlignment.baseline, baseline: TextBaseline.alphabetic, baselineOffset: 40)`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(for extra bonus points) I kinda wish these examples had little images embedded showcasing what all this would look like.

Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for the dart files in this PR modulo a handful of doc nits.

@GaryQian GaryQian merged commit a4abfb2 into flutter:master Jun 3, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 3, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 3, 2019
engine-flutter-autoroll added a commit to flutter/flutter that referenced this pull request Jun 3, 2019
flutter/engine@f9ce016...008090b

git log f9ce016..008090b --no-merges --oneline
008090b Extracted PlatformViewsChannel from PlatformViewsController. (flutter/engine#7847)
a4abfb2 Text inline widget LibTxt/dart:ui implementation (flutter/engine#8207)

The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff (cbracken@google.com), and stop
the roller if necessary.
huqiuser pushed a commit to huqiuser/engine that referenced this pull request Jun 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Text: support inline images

7 participants