Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/web_ui/lib/src/engine/text/layout_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ class TextLayoutService {
height += line.height;
if (alphabeticBaseline == -1.0) {
alphabeticBaseline = line.baseline;
ideographicBaseline = alphabeticBaseline * _baselineRatioHack;
}
if (longestLine < line.width) {
longestLine = line.width;
Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/test/engine/surface/scene_builder_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ void testMain() {
final bool useOffset = int.tryParse(char) == null;
final EnginePictureRecorder recorder = PictureRecorder();
final RecordingCanvas canvas = recorder.beginRecording(const Rect.fromLTRB(0, 0, 400, 400));
final Paragraph paragraph = (ParagraphBuilder(ParagraphStyle())..addText(char)).build();
final DomParagraph paragraph = (DomParagraphBuilder(ParagraphStyle())..addText(char)).build();
paragraph.layout(ParagraphConstraints(width: 1000));
canvas.drawParagraph(paragraph, Offset.zero);
final EngineLayer newLayer = useOffset
Expand Down
4 changes: 2 additions & 2 deletions lib/web_ui/test/text/font_loading_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ void testMain() async {

test('loading font should clear measurement caches', () async {
final ui.ParagraphStyle style = ui.ParagraphStyle();
final ui.ParagraphBuilder builder = ui.ParagraphBuilder(style);
final DomParagraphBuilder builder = DomParagraphBuilder(style);
final ui.ParagraphConstraints constraints =
ui.ParagraphConstraints(width: 30.0);
builder.addText('test');
final ui.Paragraph paragraph = builder.build();
final DomParagraph paragraph = builder.build();
// Triggers the measuring and verifies the result has been cached.
paragraph.layout(constraints);
expect(TextMeasurementService.rulerManager.rulers.length, 1);
Expand Down
24 changes: 12 additions & 12 deletions lib/web_ui/test/text_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void testMain() async {
});

test('lay out unattached paragraph', () {
final ParagraphBuilder builder = ParagraphBuilder(ParagraphStyle(
final DomParagraphBuilder builder = DomParagraphBuilder(ParagraphStyle(
fontFamily: 'sans-serif',
fontStyle: FontStyle.normal,
fontWeight: FontWeight.normal,
Expand Down Expand Up @@ -155,7 +155,7 @@ void testMain() async {
});

test('$ParagraphBuilder detects plain text', () {
ParagraphBuilder builder = ParagraphBuilder(ParagraphStyle(
DomParagraphBuilder builder = DomParagraphBuilder(ParagraphStyle(
fontFamily: 'sans-serif',
fontStyle: FontStyle.normal,
fontWeight: FontWeight.normal,
Expand All @@ -166,7 +166,7 @@ void testMain() async {
expect(paragraph.plainText, isNotNull);
expect(paragraph.geometricStyle.fontWeight, FontWeight.normal);

builder = ParagraphBuilder(ParagraphStyle(
builder = DomParagraphBuilder(ParagraphStyle(
fontFamily: 'sans-serif',
fontStyle: FontStyle.normal,
fontWeight: FontWeight.normal,
Expand All @@ -180,7 +180,7 @@ void testMain() async {
});

test('$ParagraphBuilder detects rich text', () {
final ParagraphBuilder builder = ParagraphBuilder(ParagraphStyle(
final DomParagraphBuilder builder = DomParagraphBuilder(ParagraphStyle(
fontFamily: 'sans-serif',
fontStyle: FontStyle.normal,
fontWeight: FontWeight.normal,
Expand All @@ -195,7 +195,7 @@ void testMain() async {
});

test('$ParagraphBuilder treats empty text as plain', () {
final ParagraphBuilder builder = ParagraphBuilder(ParagraphStyle(
final DomParagraphBuilder builder = DomParagraphBuilder(ParagraphStyle(
fontFamily: 'sans-serif',
fontStyle: FontStyle.normal,
fontWeight: FontWeight.normal,
Expand All @@ -209,7 +209,7 @@ void testMain() async {

// Regression test for https://github.com/flutter/flutter/issues/34931.
test('hit test on styled text returns correct span offset', () {
final ParagraphBuilder builder = ParagraphBuilder(ParagraphStyle(
final DomParagraphBuilder builder = DomParagraphBuilder(ParagraphStyle(
fontFamily: 'sans-serif',
fontStyle: FontStyle.normal,
fontWeight: FontWeight.normal,
Expand Down Expand Up @@ -239,7 +239,7 @@ void testMain() async {
const fontFamily = 'sans-serif';
const fontSize = 20.0;
final style = TextStyle(fontFamily: fontFamily, fontSize: fontSize);
final ParagraphBuilder builder = ParagraphBuilder(ParagraphStyle(
final DomParagraphBuilder builder = DomParagraphBuilder(ParagraphStyle(
fontFamily: fontFamily,
fontSize: fontSize,
));
Expand Down Expand Up @@ -326,7 +326,7 @@ void testMain() async {
'test te04 test050 '
*/

final Paragraph paragraph = builder.build();
final DomParagraph paragraph = builder.build();
paragraph.layout(ParagraphConstraints(width: 800));

// Reference the offsets with the output of `Display arrangement`.
Expand Down Expand Up @@ -358,7 +358,7 @@ void testMain() async {
test(
'should not set fontFamily to effectiveFontFamily for spans in rich text',
() {
final ParagraphBuilder builder = ParagraphBuilder(ParagraphStyle(
final DomParagraphBuilder builder = DomParagraphBuilder(ParagraphStyle(
fontFamily: 'Roboto',
fontStyle: FontStyle.normal,
fontWeight: FontWeight.normal,
Expand Down Expand Up @@ -389,7 +389,7 @@ void testMain() async {
// Set this to false so it doesn't default to 'Ahem' font.
debugEmulateFlutterTesterEnvironment = false;

final ParagraphBuilder builder = ParagraphBuilder(ParagraphStyle(
final DomParagraphBuilder builder = DomParagraphBuilder(ParagraphStyle(
fontFamily: 'SomeFont',
fontSize: 12.0,
));
Expand All @@ -411,7 +411,7 @@ void testMain() async {
// Set this to false so it doesn't default to 'Ahem' font.
debugEmulateFlutterTesterEnvironment = false;

final ParagraphBuilder builder = ParagraphBuilder(ParagraphStyle(
final DomParagraphBuilder builder = DomParagraphBuilder(ParagraphStyle(
fontFamily: 'serif',
fontSize: 12.0,
));
Expand All @@ -428,7 +428,7 @@ void testMain() async {
// Set this to false so it doesn't default to 'Ahem' font.
debugEmulateFlutterTesterEnvironment = false;

final ParagraphBuilder builder = ParagraphBuilder(ParagraphStyle(
final DomParagraphBuilder builder = DomParagraphBuilder(ParagraphStyle(
fontFamily: 'MyFont 2000',
fontSize: 12.0,
));
Expand Down