8000 Fix text.dart height docs (#8079) · flutter/engine@2daebeb · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 2daebeb

Browse files
authored
Fix text.dart height docs (#8079)
1 parent 2e42703 commit 2daebeb

File tree

2 files changed

+34
-42
lines changed

2 files changed

+34
-42
lines changed

lib/stub_ui/text.dart

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ class TextStyle {
375375
/// * `letterSpacing`: The amount of space (in logical pixels) to add between each letter.
376376
/// * `wordSpacing`: The amount of space (in logical pixels) to add at each sequence of white-space (i.e. between each word).
377377
/// * `textBaseline`: The common baseline that should be aligned between this text span and its parent text span, or, for the root text spans, with the line box.
378-
/// * `height`: The height of this text span, as a multiple of the font size.
378+
/// * `height`: The height of this text span, as a multiplier of the font size.
379379
/// * `locale`: The locale used to select region-specific glyphs.
380380
/// * `background`: The paint drawn as a background for the text.
381381
/// * `foreground`: The paint used to draw the text. If this is specified, `color` must be null.
@@ -609,19 +609,15 @@ class ParagraphStyle {
609609
/// dropped. The width constraints are those set in the
610610
/// [ParagraphConstraints] object passed to the [Paragraph.layout] method.
611611
///
612-
/// * `fontFamily`: The name of the font to use when painting the text (e.g.,
613-
/// Roboto).
612+
/// * `fontFamily`: The fallback name of the font to use when painting the text
613+
/// (e.g., Roboto). This is used when there is no [TextStyle].
614614
///
615-
/// * `fontSize`: The size of glyphs (in logical pixels) to use when painting
616-
/// the text.
615+
/// * `fontSize`: The fallback size of glyphs (in logical pixels) to
616+
/// use when painting the text. This is used when there is no [TextStyle].
617617
///
618-
/// * `height`: The minimum height of the line boxes, as a multiple of the
619-
/// font size. The lines of the paragraph will be at least
620-
/// `(height + leading) * fontSize` tall when fontSize
621-
/// is not null. When fontSize is null, there is no minimum line height. Tall
622-
/// glyphs due to baseline alignment or large [TextStyle.fontSize] may cause
623-
/// the actual line height after layout to be taller than specified here.
624-
/// [fontSize] must be provided for this property to take effect.
618+
/// * `height`: The height of the spans as a multiplier of the font size. The
619+
/// fallback height to use when no height is provided in through
620+
/// [TextStyle.height].
625621
///
626622
/// * `fontWeight`: The typeface thickness to use when painting the text
627623
/// (e.g., bold).
@@ -807,13 +803,13 @@ class StrutStyle {
807803
/// * `fontSize`: The size of glyphs (in logical pixels) to use when painting
808804
/// the text.
809805
///
810-
/// * `lineHeight`: The minimum height of the line boxes, as a multiple of the
811-
/// font size. The lines of the paragraph will be at least
812-
/// `(lineHeight + leading) * fontSize` tall when fontSize
813-
/// is not null. When fontSize is null, there is no minimum line height. Tall
814-
/// glyphs due to baseline alignment or large [TextStyle.fontSize] may cause
815-
/// the actual line height after layout to be taller than specified here.
816-
/// [fontSize] must be provided for this property to take effect.
806+
/// * `height`: The minimum height of the line boxes, as a multiplier of the
807+
/// font size. The lines of the paragraph will be at least `(height + leading)
808+
/// * fontSize` tall when fontSize is not null. When fontSize is null, there
809+
/// is no minimum line height. Tall glyphs due to baseline alignment or large
810+
/// [TextStyle.fontSize] may cause the actual line height after layout to be
811+
/// taller than specified here. [fontSize] must be provided for this property
812+
/// to take effect.
817813
///
818814
/// * `leading`: The minimum amount of leading between lines as a multiple of
819815
/// the font size. [fontSize] must be provided for this property to take effect.
@@ -825,11 +821,11 @@ class StrutStyle {
825821
/// ital 10000 ics).
826822
///
827823
/// * `forceStrutHeight`: When true, the paragraph will force all lines to be exactly
828-
/// `(lineHeight + leading) * fontSize` tall from baseline to baseline.
824+
/// `(height + leading) * fontSize` tall from baseline to baseline.
829825
/// [TextStyle] is no longer able to influence the line height, and any tall
830826
/// glyphs may overlap with lines above. If a [fontFamily] is specified, the
831827
/// total ascent of the first line will be the min of the `Ascent + half-leading`
832-
/// of the [fontFamily] and `(lineHeight + leading) * fontSize`. Otherwise, it
828+
/// of the [fontFamily] and `(height + leading) * fontSize`. Otherwise, it
833829
/// will be determined by the Ascent + half-leading of the first text.
834830
StrutStyle({
835831
String fontFamily,

lib/ui/text.dart

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ class TextStyle {
375375
/// * `letterSpacing`: The amount of space (in logical pixels) to add between each letter.
376376
/// * `wordSpacing`: The amount of space (in logical pixels) to add at each sequence of white-space (i.e. between each word).
377377
/// * `textBaseline`: The common baseline that should be aligned between this text span and its parent text span, or, for the root text spans, with the line box.
378-
/// * `height`: The height of this text span, as a multiple of the font size.
378+
/// * `height`: The height of this text span, as a multiplier of the font size.
379379
/// * `locale`: The locale used to select region-specific glyphs.
380380
/// * `background`: The paint drawn as a background for the text.
381381
/// * `foreground`: The paint used to draw the text. If this is specified, `color` must be null.
@@ -610,19 +610,15 @@ class ParagraphStyle {
610610
/// dropped. The width constraints are those set in the
611611
/// [ParagraphConstraints] object passed to the [Paragraph.layout] method.
612612
///
613-
/// * `fontFamily`: The name of the font to use when painting the text (e.g.,
614-
/// Roboto).
613+
/// * `fontFamily`: The name of the font family to apply when painting the text,
614+
/// in the absence of a `textStyle` being attached to the span.
615615
///
616-
/// * `fontSize`: The size of glyphs (in logical pixels) to use when painting
617-
/// the text.
616+
/// * `fontSize`: The fallback size of glyphs (in logical pixels) to
617+
/// use when painting the text. This is used when there is no [TextStyle].
618618
///
619-
/// * `height`: The minimum height of the line boxes, as a multiple of the
620-
/// font size. The lines of the paragraph will be at least
621-
/// `(height + leading) * fontSize` tall when fontSize
622-
/// is not null. When fontSize is null, there is no minimum line height. Tall
623-
/// glyphs due to baseline alignment or large [TextStyle.fontSize] may cause
624-
/// the actual line height after layout to be taller than specified here.
625-
/// [fontSize] must be provided for this property to take effect.
619+
/// * `height`: The height of the spans as a multiplier of the font size. The
620+
/// fallback height to use when no height is provided in through
621+
/// [TextStyle.height].
626622
///
627623
/// * `fontWeight`: The typeface thickness to use when painting the text
628624
/// (e.g., bold).
@@ -808,13 +804,13 @@ class StrutStyle {
808804
/// * `fontSize`: The size of glyphs (in logical pixels) to use when painting
809805
/// the text.
810806
///
811-
/// * `lineHeight`: The minimum height of the line boxes, as a multiple of the
812-
/// font size. The lines of the paragraph will be at least
813-
/// `(lineHeight + leading) * fontSize` tall when fontSize
814-
/// is not null. When fontSize is null, there is no minimum line height. Tall
815-
/// glyphs due to baseline alignment or large [TextStyle.fontSize] may cause
816-
/// the actual line height after layout to be taller than specified here.
817-
/// [fontSize] must be provided for this property to take effect.
807+
/// * `height`: The minimum height of the line boxes, as a multiplier of the
808+
/// font size. The lines of the paragraph will be at least `(height + leading)
809+
/// * fontSize` tall when fontSize is not null. When fontSize is null, there
810+
/// is no minimum line height. Tall glyphs due to baseline alignment or large
811+
/// [TextStyle.fontSize] may cause the actual line height after layout to be
812+
/// taller than specified here. [fontSize] must be provided for this property
813+
/// to take effect.
818814
///
819815
/// * `leading`: The minimum amount of leading between lines as a multiple of
820816
/// the font size. [fontSize] must be provided for this property to take effect.
@@ -826,11 +822,11 @@ class StrutStyle {
826822
/// italics).
827823
///
828824
/// * `forceStrutHeight`: When true, the paragraph will force all lines to be exactly
829-
/// `(lineHeight + leading) * fontSize` tall from baseline to baseline.
825+
/// `(height + leading) * fontSize` tall from baseline to baseline.
830826
/// [TextStyle] is no longer able to influence the line height, and any tall
831827
/// glyphs may overlap with lines above. If a [fontFamily] is specified, the
832828
/// total ascent of the first line will be the min of the `Ascent + half-leading`
833-
/// of the [fontFamily] and `(lineHeight + leading) * fontSize`. Otherwise, it
829+
/// of the [fontFamily] and `(height + leading) * fontSize`. Otherwise, it
834830
/// will be determined by the Ascent + half-leading of the first text.
835831
StrutStyle({
836832
String fontFamily,

0 commit comments

Comments
 (0)
0