forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Make
FontWeight
an enum, Remove unused text classes" (flutt…
…er#44987) Reverts flutter#44960 Failing on customer_testing: https://ci.chromium.org/ui/p/flutter/builders/try/Mac%20customer_testing/59576/overview
- Loading branch information
Showing
6 changed files
with
136 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef FLUTTER_LIB_UI_TEXT_LINE_METRICS_H_ | ||
#define FLUTTER_LIB_UI_TEXT_LINE_METRICS_H_ | ||
|
||
#include "third_party/dart/runtime/include/dart_api.h" | ||
#include "third_party/tonic/converter/dart_converter.h" | ||
|
||
namespace flutter { | ||
|
||
struct LineMetrics { | ||
const bool* hard_break; | ||
|
||
// The final computed ascent and descent for the line. This can be impacted by | ||
// the strut, height, scaling, as well as outlying runs that are very tall. | ||
// | ||
// The top edge is `baseline - ascent` and the bottom edge is `baseline + | ||
// descent`. Ascent and descent are provided as positive numbers. Raw numbers | ||
// for specific runs of text can be obtained in run_metrics_map. These values | ||
// are the cumulative metrics for the entire line. | ||
const double* ascent; | ||
const double* descent; | ||
const double* unscaled_ascent; | ||
// Height of the line. | ||
const double* height; | ||
// Width of the line. | ||
const double* width; | ||
// The left edge of the line. The right edge can be obtained with `left + | ||
// width` | ||
const double* left; | ||
// The y position of the baseline for this line from the top of the paragraph. | ||
const double* baseline; | ||
// Zero indexed line number. | ||
const size_t* line_number; | ||
|
||
LineMetrics(); | ||
|
||
LineMetrics(const bool* hard_break, | ||
const double* ascent, | ||
const double* descent, | ||
const double* unscaled_ascent, | ||
const double* height, | ||
const double* width, | ||
const double* left, | ||
const double* baseline, | ||
const size_t* line_number) | ||
: hard_break(hard_break), | ||
ascent(ascent), | ||
descent(descent), | ||
unscaled_ascent(unscaled_ascent), | ||
height(height), | ||
width(width), | ||
left(left), | ||
baseline(baseline), | ||
line_number(line_number) {} | ||
}; | ||
|
||
} // namespace flutter | ||
|
||
#endif // FLUTTER_LIB_UI_TEXT_LINE_METRICS_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef FLUTTER_LIB_UI_TEXT_TEXT_BOX_H_ | ||
#define FLUTTER_LIB_UI_TEXT_TEXT_BOX_H_ | ||
|
||
#include "third_party/dart/runtime/include/dart_api.h" | ||
#include "third_party/skia/include/core/SkRect.h" | ||
#include "third_party/tonic/converter/dart_converter.h" | ||
|
||
namespace flutter { | ||
|
||
enum class TextDirection { | ||
rtl, | ||
ltr, | ||
}; | ||
|
||
struct TextBox { | ||
SkRect rect; | ||
TextDirection direction; | ||
|
||
TextBox(SkRect r, TextDirection d) : rect(r), direction(d) {} | ||
}; | ||
|
||
} // namespace flutter | ||
|
||
#endif // FLUTTER_LIB_UI_TEXT_TEXT_BOX_H_ |