Перейти к содержимому
Топаз6.0 · До релиза
Загрузка →

Поиск в документации

Спецификация 6.0

Выберите результат стрелками и нажмите Enter, чтобы открыть его.

Введите имя API, номер диагностики, правило или тему проекта.

    Библиотека · std.typeset

    LatinSpacing.maxLetterSpacingEm

    The maximum extra spacing per Latin letter gap, relative to the font size.

    LatinSpacing.maxLetterSpacingEm: Length<Em>
    Модуль
    std.typeset →
    Получатель
    LatinSpacing
    Минимальное число аргументов
    0
    Максимальное число аргументов
    0

    Declaration and parameters

    Ссылка

    Доступность

    Включено по умолчанию · Не определено

    Import std.typeset in language mode 5.21.

    The current compiler selects std/typeset.tpz for this language mode. Availability in other released editions and inclusion in each installed distribution are Pending.

    Получатель

    LatinSpacing

    Ограничения параметров

    LatinSpacing stores minWordSpaceRatio and maxWordSpaceRatio as dimensionless float values, maxLetterSpacingEm as Length<Em>, and fontSizePt as Length<Pt>. There is no implicit scalar or cross-unit conversion.

    Record construction and field reads store and return the supplied values. They do not validate a paragraph policy or resolve the relative length. Field expressions follow ordinary source-order evaluation once.

    A paragraph validates every supplied LatinSpacing record before planning. This validation also applies in Unjustified mode and with the KnuthPlass cost model.

    minWordSpaceRatio must be finite and between 0.8 and 1.0 inclusive. maxWordSpaceRatio must be finite and between 1.0 and 1.33 inclusive. Invalid ratios return Err containing TypesetError.InvalidPolicy.

    maxLetterSpacingEm must be between 0em and 0.015em inclusive on the stored relative grid. The upper bound is 983 em ticks. A negative tick or 984 ticks returns Err containing TypesetError.InvalidPolicy.

    fontSizePt must have a strictly positive scaled-point count. A one-scaled-point font is valid even when the paragraph uses millipoints. Zero and negative fonts return Err containing TypesetError.InvalidPolicy, including when letter spacing is zero.

    InvalidPolicy carries explanatory text. Its exact message text and the order among independent invalid policy fields are not fixed by this contract.

    Resolve the stored maximum with maxLetterSpacingEm.resolve(fontSizePt). The stored relative count is multiplied by the physical font count and divided by 65,536 with one nearest-even rounding to scaled points. No ambient font is read.

    Convert the resolved result to the selected computation grid. ScaledPoint preserves its integer count. MilliPoint applies the shared nearest-even conversion. Every eligible gap receives this rounded bound before multiplication by the gap count.

    An eligible Latin letter gap lies between adjacent retained text units. Each unit must contain an alphabetic scalar and every scalar must be in U+0041 through U+024F, U+0300 through U+036F, or U+1E00 through U+1EFF. Paragraph trimming determines the retained units.

    The retained line uses this capacity path when it contains a CJK unit, or contains a Latin letter unit and no other alphabetic unit. A non-Latin unit containing an alphabetic scalar counts as another alphabetic unit. Paragraph classification determines CJK units.

    Let S be the sum of the grid widths of retained units whose text is U+0020. Word shrink capacity is floor(float(S) * (1.0 - minWordSpaceRatio)). Word stretch capacity is floor(float(S) * (maxWordSpaceRatio - 1.0)). Each expression keeps that binary64 evaluation order and its independent floor.

    The letter stretch contribution is the eligible gap count times the quantized relative limit. CJK capacity retains its separate floor rule. Combining these contributions does not repeat font resolution or round their total as one relative length.

    Unjustified mode does not apply spacing capacity. KnuthPlass obtains stretch and shrink from glue after the shared policy validation. FixedPoint uses the validated Latin spacing in its justification capacity and requires MilliPoint.

    Resolution, integer accumulation, and capacity arithmetic use their checked numeric contracts. Overflow stops with TPZ4004 and does not return InvalidPolicy. Validation and conversion perform no I/O and do not mutate the record.

    For 0.01em at 12pt, 655 relative ticks resolve to 7,860 scaled points and then 120 millipoints. For 0.0078125em at 24pt, each gap receives 188 millipoints. Two such gaps provide 376 millipoints.

    Результат

    The declared result type is Length<Em>.

    Эффекты

    Ошибки

    Result and effects

    Ссылка

    Select this field from a value of its named type without call parentheses.

    Store a relative length from 0em through 0.015em inclusive. Resolve it with fontSizePt before each gap receives the nearest-even grid bound. Invalid bounds return TypesetError.InvalidPolicy at paragraph admission.

    A font-relative distance uses the same Length type and explicit resolution as other relative lengths. A separate float multiplier would add a second unit-conversion rule for the same quantity.

    Related entries

    Ссылка

    std.typeset →

    Resolve relative letter spacing through Length

    Ссылка
    Правилоtopaz.stdlib.contract.latin-spacing-em.rule

    Resolve relative letter spacing through Length

    LatinSpacing stores minWordSpaceRatio and maxWordSpaceRatio as dimensionless float values, maxLetterSpacingEm as Length<Em>, and fontSizePt as Length<Pt>. There is no implicit scalar or cross-unit conversion.

    Record construction and field reads store and return the supplied values. They do not validate a paragraph policy or resolve the relative length. Field expressions follow ordinary source-order evaluation once.

    A paragraph validates every supplied LatinSpacing record before planning. This validation also applies in Unjustified mode and with the KnuthPlass cost model.

    minWordSpaceRatio must be finite and between 0.8 and 1.0 inclusive. maxWordSpaceRatio must be finite and between 1.0 and 1.33 inclusive. Invalid ratios return Err containing TypesetError.InvalidPolicy.

    maxLetterSpacingEm must be between 0em and 0.015em inclusive on the stored relative grid. The upper bound is 983 em ticks. A negative tick or 984 ticks returns Err containing TypesetError.InvalidPolicy.

    fontSizePt must have a strictly positive scaled-point count. A one-scaled-point font is valid even when the paragraph uses millipoints. Zero and negative fonts return Err containing TypesetError.InvalidPolicy, including when letter spacing is zero.

    InvalidPolicy carries explanatory text. Its exact message text and the order among independent invalid policy fields are not fixed by this contract.

    Resolve the stored maximum with maxLetterSpacingEm.resolve(fontSizePt). The stored relative count is multiplied by the physical font count and divided by 65,536 with one nearest-even rounding to scaled points. No ambient font is read.

    Convert the resolved result to the selected computation grid. ScaledPoint preserves its integer count. MilliPoint applies the shared nearest-even conversion. Every eligible gap receives this rounded bound before multiplication by the gap count.

    An eligible Latin letter gap lies between adjacent retained text units. Each unit must contain an alphabetic scalar and every scalar must be in U+0041 through U+024F, U+0300 through U+036F, or U+1E00 through U+1EFF. Paragraph trimming determines the retained units.

    The retained line uses this capacity path when it contains a CJK unit, or contains a Latin letter unit and no other alphabetic unit. A non-Latin unit containing an alphabetic scalar counts as another alphabetic unit. Paragraph classification determines CJK units.

    Let S be the sum of the grid widths of retained units whose text is U+0020. Word shrink capacity is floor(float(S) * (1.0 - minWordSpaceRatio)). Word stretch capacity is floor(float(S) * (maxWordSpaceRatio - 1.0)). Each expression keeps that binary64 evaluation order and its independent floor.

    The letter stretch contribution is the eligible gap count times the quantized relative limit. CJK capacity retains its separate floor rule. Combining these contributions does not repeat font resolution or round their total as one relative length.

    Unjustified mode does not apply spacing capacity. KnuthPlass obtains stretch and shrink from glue after the shared policy validation. FixedPoint uses the validated Latin spacing in its justification capacity and requires MilliPoint.

    Resolution, integer accumulation, and capacity arithmetic use their checked numeric contracts. Overflow stops with TPZ4004 and does not return InvalidPolicy. Validation and conversion perform no I/O and do not mutate the record.

    For 0.01em at 12pt, 655 relative ticks resolve to 7,860 scaled points and then 120 millipoints. For 0.0078125em at 24pt, each gap receives 188 millipoints. Two such gaps provide 376 millipoints.

    Причина

    One relative length model gives a letter-spacing limit an explicit font and unit. Validating the stored policy before planning separates field construction from recoverable policy errors. Per-gap quantization makes the permitted adjustment reproducible.

    Store a relative spacing length and an explicit point font size

    Ссылка
    main.tpzStore a relative spacing length and an explicit point font sizeОткрыть песочницу →
    1. import std.typeset as ts
    2. let value = ts.LatinSpacing {
    3. minWordSpaceRatio: 0.8,
    4. maxWordSpaceRatio: 1.33,
    5. maxLetterSpacingEm: 0.01em,
    6. fontSizePt: 12pt
    7. }
    8. let relative: Length<Em> = value.maxLetterSpacingEm
    9. let physical: Length<Pt> = relative.resolve(value.fontSizePt)
    Ожидаемый выводКод завершения 0
    Нет стандартного вывода.
    $ topaz check main.tpz --format json · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Проверка принимает программу. Код завершения 0.

    Resolve the stored spacing before converting to the computation grid

    Ссылка
    main.tpzResolve the stored spacing before converting to the computation gridОткрыть песочницу →
    1. import std.typeset as ts
    2. import std.io
    3. let spacing = ts.LatinSpacing {
    4. minWordSpaceRatio: 0.8,
    5. maxWordSpaceRatio: 1.33,
    6. maxLetterSpacingEm: 0.01em,
    7. fontSizePt: 12pt
    8. }
    9. let limit = spacing.maxLetterSpacingEm.resolve(spacing.fontSizePt)
    10. let exact = limit == ts.fromScaledPoints(7860)
    11. let millipoints = limit.toMilliPoints()
    12. io.writeLine("{exact}|{millipoints}")
    Ожидаемый выводКод завершения 0
    true|120
    
    $ topaz run main.tpz · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Выполнение завершается. Код завершения 0.

    Ожидаемый стандартный вывод
    1. true|120

    Apply nearest-even rounding at each typed value boundary

    Ссылка
    main.tpzApply nearest-even rounding at each typed value boundaryОткрыть песочницу →
    1. import std.typeset as ts
    2. import std.io
    3. let lowTie = (0.5em).resolve(ts.fromScaledPoints(3)) == ts.fromScaledPoints(2)
    4. let highTie = (0.5em).resolve(ts.fromScaledPoints(5)) == ts.fromScaledPoints(2)
    5. let literalGrid = (0.01em).resolve(12pt) == ts.fromScaledPoints(7860)
    6. let gridLow = (0.5em).resolve(0.125pt).toMilliPoints()
    7. let gridHigh = (0.5em).resolve(0.375pt).toMilliPoints()
    8. io.writeLine("{lowTie}|{highTie}|{literalGrid}|{gridLow}|{gridHigh}")
    Ожидаемый выводКод завершения 0
    true|true|true|62|188
    
    $ topaz run main.tpz · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Выполнение завершается. Код завершения 0.

    Ожидаемый стандартный вывод
    1. true|true|true|62|188

    Reject an untyped multiplier in the relative-length field

    Ссылка
    main.tpzReject an untyped multiplier in the relative-length fieldОткрыть песочницу →
    1. import std.typeset as ts
    2. let spacing = ts.LatinSpacing {
    3. minWordSpaceRatio: 0.8,
    4. maxWordSpaceRatio: 1.33,
    5. maxLetterSpacingEm: 0.01,
    6. fontSizePt: 12pt
    7. }
    Ожидаемый выводНенулевой код завершения
    Нет стандартного вывода.
    $ topaz check main.tpz --format json · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Этап отклонения check. Ненулевой код завершения.

    • TPZ5001 →

      stdlib-relative-distance-requires-em at main.tpz:5:23

    Reject a physical length where an em length is required

    Ссылка
    main.tpzReject a physical length where an em length is requiredОткрыть песочницу →
    1. import std.typeset as ts
    2. let spacing = ts.LatinSpacing {
    3. minWordSpaceRatio: 0.8,
    4. maxWordSpaceRatio: 1.33,
    5. maxLetterSpacingEm: 0.12pt,
    6. fontSizePt: 12pt
    7. }
    Ожидаемый выводНенулевой код завершения
    Нет стандартного вывода.
    $ topaz check main.tpz --format json · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Этап отклонения check. Ненулевой код завершения.

    • TPZ5001 →

      stdlib-relative-distance-requires-em at main.tpz:5:23

    Reject treating the stored relative length as a float

    Ссылка
    main.tpzReject treating the stored relative length as a floatОткрыть песочницу →
    1. import std.typeset as ts
    2. function multiplier(value: ts.LatinSpacing) -> float {
    3. value.maxLetterSpacingEm
    4. }
    Ожидаемый выводНенулевой код завершения
    Нет стандартного вывода.
    $ topaz check main.tpz --format json · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Этап отклонения check. Ненулевой код завершения.

    • TPZ5001 →

      stdlib-relative-distance-is-not-float at main.tpz:3:3

    Admit the inclusive ratio and font bounds

    Ссылка
    main.tpzAdmit the inclusive ratio and font boundsОткрыть песочницу →
    1. import std.typeset as ts
    2. import std.io
    3. function paragraph(grid: ts.DistanceGrid, spacing: Option<ts.LatinSpacing>) -> ts.Paragraph {
    4. ts.Paragraph {
    5. grid: grid,
    6. items: [
    7. ts.Item.BoxItem(ts.Box { unitIndex: 0, text: "abc", width: 10pt, trackingAfter: 0pt }),
    8. ts.Item.PenaltyItem(ts.Penalty {
    9. unitEnd: 1, width: 0pt, rule: ts.BreakRule.Forced(),
    10. kind: ts.BreakKind.ForcedEnd(), flagged: false
    11. })
    12. ],
    13. geometry: ts.LineGeometry {
    14. bodyTarget: 10pt, firstTarget: 10pt, dropCapSpan: 0, dropCapInset: 0pt
    15. },
    16. justification: ts.JustificationPolicy {
    17. mode: ts.JustificationMode.Unjustified(),
    18. minGapCount: 0, minLineWidthRatioM: 0, minFinalLineWidthRatioM: None(),
    19. maxAdjustment: 0pt, maxGapAdjustment: 0pt, maxGapRatioR: 0,
    20. latinSpacing: spacing, cjkStretchRatio: 0.0
    21. },
    22. costModel: ts.CostModel.FixedPoint(),
    23. knuthPlass: ts.KnuthPlassPolicy {
    24. toleranceR: 100000000, linePenalty: 10, fitnessDemerit: 0,
    25. flaggedDemerit: 0, finalFlaggedDemerit: 0
    26. }
    27. }
    28. }
    29. for value in ([ts.LatinSpacing { minWordSpaceRatio: 0.8, maxWordSpaceRatio: 1.0, maxLetterSpacingEm: 0em, fontSizePt: ts.fromScaledPoints(1) },
    30. ts.LatinSpacing { minWordSpaceRatio: 1.0, maxWordSpaceRatio: 1.33, maxLetterSpacingEm: 0.015em, fontSizePt: 12pt }]) {
    31. match (ts.breakParagraph(paragraph(ts.DistanceGrid.MilliPoint(), Some(value)))) {
    32. case Ok(_) => io.writeLine("valid policy")
    33. case Err(_) => io.writeLine("unexpected error")
    34. }
    35. }
    Ожидаемый выводКод завершения 0
    valid policy
    valid policy
    
    $ topaz run main.tpz · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Выполнение завершается. Код завершения 0.

    Ожидаемый стандартный вывод
    1. valid policy
    2. valid policy

    Reject ratios just outside every allowed endpoint

    Ссылка
    main.tpzReject ratios just outside every allowed endpointОткрыть песочницу →
    1. import std.typeset as ts
    2. import std.io
    3. function paragraph(grid: ts.DistanceGrid, spacing: Option<ts.LatinSpacing>) -> ts.Paragraph {
    4. ts.Paragraph {
    5. grid: grid,
    6. items: [
    7. ts.Item.BoxItem(ts.Box { unitIndex: 0, text: "abc", width: 10pt, trackingAfter: 0pt }),
    8. ts.Item.PenaltyItem(ts.Penalty {
    9. unitEnd: 1, width: 0pt, rule: ts.BreakRule.Forced(),
    10. kind: ts.BreakKind.ForcedEnd(), flagged: false
    11. })
    12. ],
    13. geometry: ts.LineGeometry {
    14. bodyTarget: 10pt, firstTarget: 10pt, dropCapSpan: 0, dropCapInset: 0pt
    15. },
    16. justification: ts.JustificationPolicy {
    17. mode: ts.JustificationMode.Unjustified(),
    18. minGapCount: 0, minLineWidthRatioM: 0, minFinalLineWidthRatioM: None(),
    19. maxAdjustment: 0pt, maxGapAdjustment: 0pt, maxGapRatioR: 0,
    20. latinSpacing: spacing, cjkStretchRatio: 0.0
    21. },
    22. costModel: ts.CostModel.FixedPoint(),
    23. knuthPlass: ts.KnuthPlassPolicy {
    24. toleranceR: 100000000, linePenalty: 10, fitnessDemerit: 0,
    25. flaggedDemerit: 0, finalFlaggedDemerit: 0
    26. }
    27. }
    28. }
    29. for value in ([ts.LatinSpacing { minWordSpaceRatio: 0.7999, maxWordSpaceRatio: 1.0, maxLetterSpacingEm: 0em, fontSizePt: 12pt },
    30. ts.LatinSpacing { minWordSpaceRatio: 1.0001, maxWordSpaceRatio: 1.0, maxLetterSpacingEm: 0em, fontSizePt: 12pt },
    31. ts.LatinSpacing { minWordSpaceRatio: 1.0, maxWordSpaceRatio: 0.9999, maxLetterSpacingEm: 0em, fontSizePt: 12pt },
    32. ts.LatinSpacing { minWordSpaceRatio: 1.0, maxWordSpaceRatio: 1.3301, maxLetterSpacingEm: 0em, fontSizePt: 12pt }]) {
    33. match (ts.breakParagraph(paragraph(ts.DistanceGrid.MilliPoint(), Some(value)))) {
    34. case Err(InvalidPolicy(_)) => io.writeLine("invalid ratio")
    35. case _ => io.writeLine("unexpected result")
    36. }
    37. }
    Ожидаемый выводКод завершения 0
    invalid ratio
    invalid ratio
    invalid ratio
    invalid ratio
    
    $ topaz run main.tpz · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Выполнение завершается. Код завершения 0.

    Ожидаемый стандартный вывод
    1. invalid ratio
    2. invalid ratio
    3. invalid ratio
    4. invalid ratio

    Reject negative spacing and nonpositive fonts

    Ссылка
    main.tpzReject negative spacing and nonpositive fontsОткрыть песочницу →
    1. import std.typeset as ts
    2. import std.io
    3. function paragraph(grid: ts.DistanceGrid, spacing: Option<ts.LatinSpacing>) -> ts.Paragraph {
    4. ts.Paragraph {
    5. grid: grid,
    6. items: [
    7. ts.Item.BoxItem(ts.Box { unitIndex: 0, text: "abc", width: 10pt, trackingAfter: 0pt }),
    8. ts.Item.PenaltyItem(ts.Penalty {
    9. unitEnd: 1, width: 0pt, rule: ts.BreakRule.Forced(),
    10. kind: ts.BreakKind.ForcedEnd(), flagged: false
    11. })
    12. ],
    13. geometry: ts.LineGeometry {
    14. bodyTarget: 10pt, firstTarget: 10pt, dropCapSpan: 0, dropCapInset: 0pt
    15. },
    16. justification: ts.JustificationPolicy {
    17. mode: ts.JustificationMode.Unjustified(),
    18. minGapCount: 0, minLineWidthRatioM: 0, minFinalLineWidthRatioM: None(),
    19. maxAdjustment: 0pt, maxGapAdjustment: 0pt, maxGapRatioR: 0,
    20. latinSpacing: spacing, cjkStretchRatio: 0.0
    21. },
    22. costModel: ts.CostModel.FixedPoint(),
    23. knuthPlass: ts.KnuthPlassPolicy {
    24. toleranceR: 100000000, linePenalty: 10, fitnessDemerit: 0,
    25. flaggedDemerit: 0, finalFlaggedDemerit: 0
    26. }
    27. }
    28. }
    29. for value in ([ts.LatinSpacing { minWordSpaceRatio: 1.0, maxWordSpaceRatio: 1.0, maxLetterSpacingEm: -0.0000152587890625em, fontSizePt: 12pt },
    30. ts.LatinSpacing { minWordSpaceRatio: 1.0, maxWordSpaceRatio: 1.0, maxLetterSpacingEm: 0.0150146484375em, fontSizePt: 12pt },
    31. ts.LatinSpacing { minWordSpaceRatio: 1.0, maxWordSpaceRatio: 1.0, maxLetterSpacingEm: 0em, fontSizePt: 0pt },
    32. ts.LatinSpacing { minWordSpaceRatio: 1.0, maxWordSpaceRatio: 1.0, maxLetterSpacingEm: 0em, fontSizePt: -12pt }]) {
    33. match (ts.breakParagraph(paragraph(ts.DistanceGrid.MilliPoint(), Some(value)))) {
    34. case Err(InvalidPolicy(_)) => io.writeLine("invalid length policy")
    35. case _ => io.writeLine("unexpected result")
    36. }
    37. }
    Ожидаемый выводКод завершения 0
    invalid length policy
    invalid length policy
    invalid length policy
    invalid length policy
    
    $ topaz run main.tpz · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Выполнение завершается. Код завершения 0.

    Ожидаемый стандартный вывод
    1. invalid length policy
    2. invalid length policy
    3. invalid length policy
    4. invalid length policy

    Read a stored policy before paragraph validation

    Ссылка
    main.tpzRead a stored policy before paragraph validationОткрыть песочницу →
    1. import std.typeset as ts
    2. import std.io
    3. let value = ts.LatinSpacing { minWordSpaceRatio: 0.0, maxWordSpaceRatio: 2.0, maxLetterSpacingEm: 1em, fontSizePt: 0pt }
    4. io.writeLine("{value.minWordSpaceRatio == 0.0}|{value.maxWordSpaceRatio == 2.0}|{value.maxLetterSpacingEm == 1em}|{value.fontSizePt == 0pt}")
    Ожидаемый выводКод завершения 0
    true|true|true|true
    
    $ topaz run main.tpz · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Выполнение завершается. Код завершения 0.

    Ожидаемый стандартный вывод
    1. true|true|true|true

    Fill a line using a rounded bound for every letter gap

    Ссылка
    main.tpzFill a line using a rounded bound for every letter gapОткрыть песочницу →
    1. import std.typeset as ts
    2. import std.io
    3. import std.test
    4. function paragraph(grid: ts.DistanceGrid, spacing: Option<ts.LatinSpacing>) -> ts.Paragraph {
    5. ts.Paragraph {
    6. grid: grid,
    7. items: [
    8. ts.Item.BoxItem(ts.Box { unitIndex: 0, text: "a", width: 1pt, trackingAfter: 0pt }),
    9. ts.Item.BoxItem(ts.Box { unitIndex: 1, text: "b", width: 1pt, trackingAfter: 0pt }),
    10. ts.Item.BoxItem(ts.Box { unitIndex: 2, text: "c", width: 1pt, trackingAfter: 0pt }),
    11. ts.Item.PenaltyItem(ts.Penalty {
    12. unitEnd: 3, width: 0pt, rule: ts.BreakRule.Forced(),
    13. kind: ts.BreakKind.LatinSpace(), flagged: false
    14. }),
    15. ts.Item.BoxItem(ts.Box { unitIndex: 3, text: "xyz", width: 3.376pt, trackingAfter: 0pt }),
    16. ts.Item.PenaltyItem(ts.Penalty {
    17. unitEnd: 4, width: 0pt, rule: ts.BreakRule.Forced(),
    18. kind: ts.BreakKind.ForcedEnd(), flagged: false
    19. })
    20. ],
    21. geometry: ts.LineGeometry {
    22. bodyTarget: 3.376pt, firstTarget: 3.376pt, dropCapSpan: 0, dropCapInset: 0pt
    23. },
    24. justification: ts.JustificationPolicy {
    25. mode: ts.JustificationMode.LatinWordSpace(),
    26. minGapCount: 0, minLineWidthRatioM: 0, minFinalLineWidthRatioM: None(),
    27. maxAdjustment: 0pt, maxGapAdjustment: 0pt, maxGapRatioR: 0,
    28. latinSpacing: spacing, cjkStretchRatio: 0.0
    29. },
    30. costModel: ts.CostModel.FixedPoint(),
    31. knuthPlass: ts.KnuthPlassPolicy {
    32. toleranceR: 100000000, linePenalty: 10, fitnessDemerit: 0,
    33. flaggedDemerit: 0, finalFlaggedDemerit: 0
    34. }
    35. }
    36. }
    37. let value = ts.LatinSpacing { minWordSpaceRatio: 1.0, maxWordSpaceRatio: 1.0, maxLetterSpacingEm: 0.0078125em, fontSizePt: 24pt }
    38. let result = test.assertOk(ts.breakParagraph(paragraph(ts.DistanceGrid.MilliPoint(), Some(value))))
    39. let filled = match (result.optimized.boundedFillFeasible) {
    40. case Some(value) => value
    41. case None() => false
    42. }
    43. io.writeLine("{filled}|{result.optimized.lines.length}|{result.optimized.lines[0].target == 3.376pt}")
    Ожидаемый выводКод завершения 0
    true|2|true
    
    $ topaz run main.tpz · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Выполнение завершается. Код завершения 0.

    Ожидаемый стандартный вывод
    1. true|2|true

    Diagnostics

    Ссылка

    TPZ5001 →

    Меню

    Загрузка →