Plan Line. cost Text Width: Length<Pt>- Module
- std.
typeset - Receiver
- Plan
Line - Minimum arity
- 0
- Maximum arity
- 0
Declaration and parameters
LinkAvailability
Included by default: Pending
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.
Source evidence
- compiler/crates/topaz_resolve/src/std/typeset/model.tpz at
b48527d0a174· 58 - compiler/crates/topaz_resolve/src/stdlib.rs at
b48527d0a174· 40
Receiver
PlanLine
Parameter constraints
Public measurement fields use Length<Pt>. Widths, advances, tracking, stretch, shrink, physical targets, insets, font sizes, and optional width limits keep that type across input and output records. Explicit Length conversion functions remain the integer interchange boundary.
Box., Box., Glue., Glue., Glue., Glue., and Penalty. have type Length<Pt>.
Break, Break, Break, and Break have type Length<Pt>.
Latin, Justification, and Justification have type Length<Pt>.
Line, Line, and Line have type Length<Pt>.
Plan, Plan, Plan, Plan, and Plan have type Length<Pt>. Plan has type Option<Length<Pt>>.
An int, a float, or a Length with another unit marker is not an implicit point-length argument. Convert physical units explicitly with toPt() before constructing a typesetting record.
Indices, counts, penalties, costs, and dimensionless ratios retain their declared types. LatinSpacing.maxLetterSpacingEm is a relative Length<Em>. Resolve it to Length<Pt> with fontSizePt before selecting the computation grid.
Paragraph. selects quantization at the computation boundary. ScaledPoint uses the exact scaled-point integer. MilliPoint uses the existing nearest-even conversion to millipoints. The selected grid never changes the physical interpretation of a public Length<Pt> value.
Returned distances are converted from the computation grid into Length<Pt> at the output boundary. Paragraph reports the computation policy and is not needed to interpret its distances.
The public type change preserves the selected cost model. FixedPoint retains its MilliPoint computation requirement. Word-space and CJK ratio calculations keep their independent floor rules. The relative letter-spacing distance is resolved and quantized through the shared Length conversions before it contributes to capacity.
The public line-badness entry point also receives width, target, and hyphen advance as Length<Pt>. It converts those distances to millipoints at entry and preserves its existing integer cost calculation.
ParagraphPlan.lines contains line records in source order. Each nonempty line consumes the half-open unit interval from start through endExclusive. The first line starts at zero, adjacent lines share an endpoint, and the last line ends at the unit count. These are BoxItem and GlueItem indices rather than item array offsets, scalar offsets, or byte offsets.
trimmedEndExclusive removes trailing units whose complete text is an ASCII space or a no-break space. It stays between start and endExclusive. displayTextScalarLength counts Unicode scalars in the consumed text after trailing ASCII spaces and no-break spaces are removed. It excludes the selected penalty insertion and retains leading text.
A unit width includes its following tracking contribution. rawTextWidth is the sum of consumed unit widths minus the last consumed unit trackingAfter. trimmedTextWidth applies the same formula to the trimmed unit interval. An empty trimmed interval has zero width. Reading a plan does not reshape text or modify source measurements.
kind reports the selected penalty kind. selectedPenaltyWidth reports that selected penalty width after conversion to the computation grid for every kind and cost model. The insertion contributes at the selected boundary and leaves the stored text, source indices, and displayTextScalarLength unchanged.
FixedPoint costTextWidth is the raw width, capped at the target minus selectedPenaltyWidth on a nonfinal line with bounded spacing capacity. KnuthPlass costTextWidth excludes leading GlueItem units and excludes trailing GlueItem units for an ordinary break. A Forced KnuthPlass break retains its trailing glue and associated capacity.
FixedPoint postValidationWidthLimit is Some(limit) with the effective target, nonfinal shrink allowance, and one grid unit of rounding allowance. It reports the optimized admission threshold. Single-unit lines and greedy choices can exceed it. KnuthPlass reports None() because its admission is expressed by glue capacity and adjustment ratios.
cost is the selected line contribution under the paragraph cost model, including applicable penalty and transition demerits. adjustmentRatioR is zero for FixedPoint. For KnuthPlass it is the signed ratio to the selected stretch or shrink capacity, scaled by 100000000 and rounded to nearest with ties to even.
ParagraphPlan.totalCost is the sum of its line costs in line order. Scores can be negative when an Allowed penalty rewards a break. A score is interpreted with its CostModel and policies. ParagraphPlan.grid reports the computation grid, while all reported distances retain Length<Pt>.
For an applicable FixedPoint bounded fill search, optimized.boundedFillFeasible is Some(true) when that search succeeds and Some(false) when the second search supplies the plan. In other cases it is None(). The greedy plan always reports None(). This field records feasibility within the configured bounded search.
ParagraphResult.optimized and greedy contain the two plans from the same validated input. breakOpportunityCount counts all eligible penalty entries before planning, including equal-boundary duplicates and the supplied terminal candidate. It is independent of the number of output lines.
Related rule: Read plan boundaries, measurements, and scores separatelyResult
The declared result type is Length<Pt>.
Effects
Failures
Result and effects
LinkSelect this field from a value of its named type without call parentheses.
FixedPoint can cap a nonfinal width by bounded spacing capacity. KnuthPlass discards leading glue and ordinary trailing glue before costing. This distance excludes the selected penalty insertion.
Why
LinkA renderer needs source consumption, display trimming, width admission, and scoring as separate measurements. Explicit indices and optional feasibility results let the renderer inspect source consumption and width fit for every selected line.
Related entries
LinkGive public typesetting distances a point-length type
LinkGive public typesetting distances a point-length type
Public measurement fields use Length<Pt>. Widths, advances, tracking, stretch, shrink, physical targets, insets, font sizes, and optional width limits keep that type across input and output records. Explicit Length conversion functions remain the integer interchange boundary.
Box., Box., Glue., Glue., Glue., Glue., and Penalty. have type Length<Pt>.
Break, Break, Break, and Break have type Length<Pt>.
Latin, Justification, and Justification have type Length<Pt>.
Line, Line, and Line have type Length<Pt>.
Plan, Plan, Plan, Plan, and Plan have type Length<Pt>. Plan has type Option<Length<Pt>>.
An int, a float, or a Length with another unit marker is not an implicit point-length argument. Convert physical units explicitly with toPt() before constructing a typesetting record.
Indices, counts, penalties, costs, and dimensionless ratios retain their declared types. LatinSpacing.maxLetterSpacingEm is a relative Length<Em>. Resolve it to Length<Pt> with fontSizePt before selecting the computation grid.
Paragraph. selects quantization at the computation boundary. ScaledPoint uses the exact scaled-point integer. MilliPoint uses the existing nearest-even conversion to millipoints. The selected grid never changes the physical interpretation of a public Length<Pt> value.
Returned distances are converted from the computation grid into Length<Pt> at the output boundary. Paragraph reports the computation policy and is not needed to interpret its distances.
The public type change preserves the selected cost model. FixedPoint retains its MilliPoint computation requirement. Word-space and CJK ratio calculations keep their independent floor rules. The relative letter-spacing distance is resolved and quantized through the shared Length conversions before it contributes to capacity.
The public line-badness entry point also receives width, target, and hyphen advance as Length<Pt>. It converts those distances to millipoints at entry and preserves its existing integer cost calculation.
Why
A physical distance carries the same Length<Pt> type in application geometry and paragraph planning. The type prevents a grid selector or an unlabelled scalar from silently changing the distance.
Source evidence
- compiler/crates/topaz_resolve/src/std/typeset/model.tpz at
271329b482bc· 16 - compiler/crates/topaz_resolve/src/std/typeset/admission.tpz at
271329b482bc· 1 - compiler/crates/topaz_resolve/src/std/typeset/spacing.tpz at
271329b482bc· 38 - compiler/crates/topaz_resolve/src/std/typeset/paragraph.tpz at
271329b482bc· 90 - compiler/crates/topaz_syntax/src/length.rs at
271329b482bc· 293 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1846 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1976 - compiler/crates/topaz_resolve/src/std/typeset/cost.tpz at
271329b482bc· 1 - compiler/crates/topaz_self_frontend/topaz/checker/members_capabilities.tpz at
f3807a34248e· 691-713 - compiler/crates/topaz_self_frontend/topaz/checker/call_complete.tpz at
f3807a34248e· 1319-1340 -
topaz.stdlib.contract.typeset-length-ptatworking-tree - topaz.decision.typeset-length-pt.1 at
topaz.decisi
Use point lengths in Box
Linkimport std.typeset as tslet value: ts.Box = ts.Box {unitIndex: 0,text: "A",width: 12pt,trackingAfter: 0pt}let distance: Length<Pt> = value.width
No stdout.
Expected result
Expected result
Checking accepts the program. Exit code 0.
Source evidence
- compiler/crates/topaz_resolve/src/std/typeset/model.tpz at
271329b482bc· 16 - compiler/crates/topaz_resolve/src/std/typeset/admission.tpz at
271329b482bc· 1 - compiler/crates/topaz_resolve/src/std/typeset/spacing.tpz at
271329b482bc· 38 - compiler/crates/topaz_resolve/src/std/typeset/paragraph.tpz at
271329b482bc· 90 - compiler/crates/topaz_syntax/src/length.rs at
271329b482bc· 293 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1846 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1976 - compiler/crates/topaz_resolve/src/std/typeset/cost.tpz at
271329b482bc· 1 - compiler/crates/topaz_self_frontend/topaz/checker/members_capabilities.tpz at
f3807a34248e· 691-713 - compiler/crates/topaz_self_frontend/topaz/checker/call_complete.tpz at
f3807a34248e· 1319-1340 -
topaz.stdlib.contract.typeset-length-ptatworking-tree - topaz.decision.typeset-length-pt.1 at
topaz.decisi
Reject untyped physical distances in Box
Linkimport std.typeset as tslet value: ts.Box = ts.Box {unitIndex: 0,text: "A",width: 12,trackingAfter: 0}
No stdout.
Expected result
Expected result
Rejection during check. Nonzero exit.
TPZ5001stdlib-physical-distance-requires-points atmain.tpz:5:10
Source evidence
- compiler/crates/topaz_resolve/src/std/typeset/model.tpz at
271329b482bc· 16 - compiler/crates/topaz_resolve/src/std/typeset/admission.tpz at
271329b482bc· 1 - compiler/crates/topaz_resolve/src/std/typeset/spacing.tpz at
271329b482bc· 38 - compiler/crates/topaz_resolve/src/std/typeset/paragraph.tpz at
271329b482bc· 90 - compiler/crates/topaz_syntax/src/length.rs at
271329b482bc· 293 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1846 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1976 - compiler/crates/topaz_resolve/src/std/typeset/cost.tpz at
271329b482bc· 1 - compiler/crates/topaz_self_frontend/topaz/checker/members_capabilities.tpz at
f3807a34248e· 691-713 - compiler/crates/topaz_self_frontend/topaz/checker/call_complete.tpz at
f3807a34248e· 1319-1340 -
topaz.stdlib.contract.typeset-length-ptatworking-tree - topaz.decision.typeset-length-pt.1 at
topaz.decisi
Use point lengths in Glue
Linkimport std.typeset as tslet value: ts.Glue = ts.Glue {unitIndex: 1,text: " ",width: 3pt,trackingAfter: 0pt,stretch: 1pt,shrink: 1pt}let distance: Length<Pt> = value.width
No stdout.
Expected result
Expected result
Checking accepts the program. Exit code 0.
Source evidence
- compiler/crates/topaz_resolve/src/std/typeset/model.tpz at
271329b482bc· 16 - compiler/crates/topaz_resolve/src/std/typeset/admission.tpz at
271329b482bc· 1 - compiler/crates/topaz_resolve/src/std/typeset/spacing.tpz at
271329b482bc· 38 - compiler/crates/topaz_resolve/src/std/typeset/paragraph.tpz at
271329b482bc· 90 - compiler/crates/topaz_syntax/src/length.rs at
271329b482bc· 293 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1846 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1976 - compiler/crates/topaz_resolve/src/std/typeset/cost.tpz at
271329b482bc· 1 - compiler/crates/topaz_self_frontend/topaz/checker/members_capabilities.tpz at
f3807a34248e· 691-713 - compiler/crates/topaz_self_frontend/topaz/checker/call_complete.tpz at
f3807a34248e· 1319-1340 -
topaz.stdlib.contract.typeset-length-ptatworking-tree - topaz.decision.typeset-length-pt.1 at
topaz.decisi
Reject untyped physical distances in Glue
Linkimport std.typeset as tslet value: ts.Glue = ts.Glue {unitIndex: 1,text: " ",width: 3,trackingAfter: 0,stretch: 1,shrink: 1}
No stdout.
Expected result
Expected result
Rejection during check. Nonzero exit.
TPZ5001stdlib-physical-distance-requires-points atmain.tpz:5:10
Source evidence
- compiler/crates/topaz_resolve/src/std/typeset/model.tpz at
271329b482bc· 16 - compiler/crates/topaz_resolve/src/std/typeset/admission.tpz at
271329b482bc· 1 - compiler/crates/topaz_resolve/src/std/typeset/spacing.tpz at
271329b482bc· 38 - compiler/crates/topaz_resolve/src/std/typeset/paragraph.tpz at
271329b482bc· 90 - compiler/crates/topaz_syntax/src/length.rs at
271329b482bc· 293 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1846 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1976 - compiler/crates/topaz_resolve/src/std/typeset/cost.tpz at
271329b482bc· 1 - compiler/crates/topaz_self_frontend/topaz/checker/members_capabilities.tpz at
f3807a34248e· 691-713 - compiler/crates/topaz_self_frontend/topaz/checker/call_complete.tpz at
f3807a34248e· 1319-1340 -
topaz.stdlib.contract.typeset-length-ptatworking-tree - topaz.decision.typeset-length-pt.1 at
topaz.decisi
Use point lengths in Penalty
Linkimport std.typeset as tslet value: ts.Penalty = ts.Penalty {unitEnd: 1,width: 0pt,rule: ts.BreakRule.Forced(),kind: ts.BreakKind.ForcedEnd(),flagged: false}let distance: Length<Pt> = value.width
No stdout.
Expected result
Expected result
Checking accepts the program. Exit code 0.
Source evidence
- compiler/crates/topaz_resolve/src/std/typeset/model.tpz at
271329b482bc· 16 - compiler/crates/topaz_resolve/src/std/typeset/admission.tpz at
271329b482bc· 1 - compiler/crates/topaz_resolve/src/std/typeset/spacing.tpz at
271329b482bc· 38 - compiler/crates/topaz_resolve/src/std/typeset/paragraph.tpz at
271329b482bc· 90 - compiler/crates/topaz_syntax/src/length.rs at
271329b482bc· 293 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1846 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1976 - compiler/crates/topaz_resolve/src/std/typeset/cost.tpz at
271329b482bc· 1 - compiler/crates/topaz_self_frontend/topaz/checker/members_capabilities.tpz at
f3807a34248e· 691-713 - compiler/crates/topaz_self_frontend/topaz/checker/call_complete.tpz at
f3807a34248e· 1319-1340 -
topaz.stdlib.contract.typeset-length-ptatworking-tree - topaz.decision.typeset-length-pt.1 at
topaz.decisi
Reject untyped physical distances in Penalty
Linkimport std.typeset as tslet value: ts.Penalty = ts.Penalty {unitEnd: 1,width: 0,rule: ts.BreakRule.Forced(),kind: ts.BreakKind.ForcedEnd(),flagged: false}
No stdout.
Expected result
Expected result
Rejection during check. Nonzero exit.
TPZ5001stdlib-physical-distance-requires-points atmain.tpz:4:10
Source evidence
- compiler/crates/topaz_resolve/src/std/typeset/model.tpz at
271329b482bc· 16 - compiler/crates/topaz_resolve/src/std/typeset/admission.tpz at
271329b482bc· 1 - compiler/crates/topaz_resolve/src/std/typeset/spacing.tpz at
271329b482bc· 38 - compiler/crates/topaz_resolve/src/std/typeset/paragraph.tpz at
271329b482bc· 90 - compiler/crates/topaz_syntax/src/length.rs at
271329b482bc· 293 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1846 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1976 - compiler/crates/topaz_resolve/src/std/typeset/cost.tpz at
271329b482bc· 1 - compiler/crates/topaz_self_frontend/topaz/checker/members_capabilities.tpz at
f3807a34248e· 691-713 - compiler/crates/topaz_self_frontend/topaz/checker/call_complete.tpz at
f3807a34248e· 1319-1340 -
topaz.stdlib.contract.typeset-length-ptatworking-tree - topaz.decision.typeset-length-pt.1 at
topaz.decisi
Use point lengths in BreakPolicy
Linkimport std.typeset as tslet value: ts.BreakPolicy = ts.BreakPolicy {mode: ts.BreakMode.Character(),rules: ts.KinsokuRules.Unicode16Ja(),forbidBefore: [],forbidAfter: [],boundaryAllowed: [true],generatedHyphenEnds: [],protectFittingLatin: true,preserveShortWords: true,narrowestWordTarget: 12pt,bodyWordTarget: 24pt}let distance: Length<Pt> = value.narrowestWordTarget
No stdout.
Expected result
Expected result
Checking accepts the program. Exit code 0.
Source evidence
- compiler/crates/topaz_resolve/src/std/typeset/model.tpz at
271329b482bc· 16 - compiler/crates/topaz_resolve/src/std/typeset/admission.tpz at
271329b482bc· 1 - compiler/crates/topaz_resolve/src/std/typeset/spacing.tpz at
271329b482bc· 38 - compiler/crates/topaz_resolve/src/std/typeset/paragraph.tpz at
271329b482bc· 90 - compiler/crates/topaz_syntax/src/length.rs at
271329b482bc· 293 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1846 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1976 - compiler/crates/topaz_resolve/src/std/typeset/cost.tpz at
271329b482bc· 1 - compiler/crates/topaz_self_frontend/topaz/checker/members_capabilities.tpz at
f3807a34248e· 691-713 - compiler/crates/topaz_self_frontend/topaz/checker/call_complete.tpz at
f3807a34248e· 1319-1340 -
topaz.stdlib.contract.typeset-length-ptatworking-tree - topaz.decision.typeset-length-pt.1 at
topaz.decisi
Reject untyped physical distances in BreakPolicy
Linkimport std.typeset as tslet value: ts.BreakPolicy = ts.BreakPolicy {mode: ts.BreakMode.Character(),rules: ts.KinsokuRules.Unicode16Ja(),forbidBefore: [],forbidAfter: [],boundaryAllowed: [true],generatedHyphenEnds: [],protectFittingLatin: true,preserveShortWords: true,narrowestWordTarget: 12,bodyWordTarget: 24}
No stdout.
Expected result
Expected result
Rejection during check. Nonzero exit.
TPZ5001stdlib-physical-distance-requires-points atmain.tpz:11:24
Source evidence
- compiler/crates/topaz_resolve/src/std/typeset/model.tpz at
271329b482bc· 16 - compiler/crates/topaz_resolve/src/std/typeset/admission.tpz at
271329b482bc· 1 - compiler/crates/topaz_resolve/src/std/typeset/spacing.tpz at
271329b482bc· 38 - compiler/crates/topaz_resolve/src/std/typeset/paragraph.tpz at
271329b482bc· 90 - compiler/crates/topaz_syntax/src/length.rs at
271329b482bc· 293 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1846 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1976 - compiler/crates/topaz_resolve/src/std/typeset/cost.tpz at
271329b482bc· 1 - compiler/crates/topaz_self_frontend/topaz/checker/members_capabilities.tpz at
f3807a34248e· 691-713 - compiler/crates/topaz_self_frontend/topaz/checker/call_complete.tpz at
f3807a34248e· 1319-1340 -
topaz.stdlib.contract.typeset-length-ptatworking-tree - topaz.decision.typeset-length-pt.1 at
topaz.decisi
Use point lengths in BreakCluster
Linkimport std.typeset as tslet value: ts.BreakCluster = ts.BreakCluster {text: "A",advance: 12pt,trackingAfter: 0pt}let distance: Length<Pt> = value.advance
No stdout.
Expected result
Expected result
Checking accepts the program. Exit code 0.
Source evidence
- compiler/crates/topaz_resolve/src/std/typeset/model.tpz at
271329b482bc· 16 - compiler/crates/topaz_resolve/src/std/typeset/admission.tpz at
271329b482bc· 1 - compiler/crates/topaz_resolve/src/std/typeset/spacing.tpz at
271329b482bc· 38 - compiler/crates/topaz_resolve/src/std/typeset/paragraph.tpz at
271329b482bc· 90 - compiler/crates/topaz_syntax/src/length.rs at
271329b482bc· 293 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1846 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1976 - compiler/crates/topaz_resolve/src/std/typeset/cost.tpz at
271329b482bc· 1 - compiler/crates/topaz_self_frontend/topaz/checker/members_capabilities.tpz at
f3807a34248e· 691-713 - compiler/crates/topaz_self_frontend/topaz/checker/call_complete.tpz at
f3807a34248e· 1319-1340 -
topaz.stdlib.contract.typeset-length-ptatworking-tree - topaz.decision.typeset-length-pt.1 at
topaz.decisi
Reject untyped physical distances in BreakCluster
Linkimport std.typeset as tslet value: ts.BreakCluster = ts.BreakCluster {text: "A",advance: 12,trackingAfter: 0}
No stdout.
Expected result
Expected result
Rejection during check. Nonzero exit.
TPZ5001stdlib-physical-distance-requires-points atmain.tpz:4:12
Source evidence
- compiler/crates/topaz_resolve/src/std/typeset/model.tpz at
271329b482bc· 16 - compiler/crates/topaz_resolve/src/std/typeset/admission.tpz at
271329b482bc· 1 - compiler/crates/topaz_resolve/src/std/typeset/spacing.tpz at
271329b482bc· 38 - compiler/crates/topaz_resolve/src/std/typeset/paragraph.tpz at
271329b482bc· 90 - compiler/crates/topaz_syntax/src/length.rs at
271329b482bc· 293 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1846 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1976 - compiler/crates/topaz_resolve/src/std/typeset/cost.tpz at
271329b482bc· 1 - compiler/crates/topaz_self_frontend/topaz/checker/members_capabilities.tpz at
f3807a34248e· 691-713 - compiler/crates/topaz_self_frontend/topaz/checker/call_complete.tpz at
f3807a34248e· 1319-1340 -
topaz.stdlib.contract.typeset-length-ptatworking-tree - topaz.decision.typeset-length-pt.1 at
topaz.decisi
Use point lengths in LatinSpacing
Linkimport std.typeset as tslet value: ts.LatinSpacing = ts.LatinSpacing {minWordSpaceRatio: 0.8,maxWordSpaceRatio: 1.33,maxLetterSpacingEm: 0.01em,fontSizePt: 12pt}let distance: Length<Pt> = value.fontSizePt
No stdout.
Expected result
Expected result
Checking accepts the program. Exit code 0.
Source evidence
- compiler/crates/topaz_resolve/src/std/typeset/model.tpz at
271329b482bc· 16 - compiler/crates/topaz_resolve/src/std/typeset/admission.tpz at
271329b482bc· 1 - compiler/crates/topaz_resolve/src/std/typeset/spacing.tpz at
271329b482bc· 38 - compiler/crates/topaz_resolve/src/std/typeset/paragraph.tpz at
271329b482bc· 90 - compiler/crates/topaz_syntax/src/length.rs at
271329b482bc· 293 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1846 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1976 - compiler/crates/topaz_resolve/src/std/typeset/cost.tpz at
271329b482bc· 1 - compiler/crates/topaz_self_frontend/topaz/checker/members_capabilities.tpz at
f3807a34248e· 691-713 - compiler/crates/topaz_self_frontend/topaz/checker/call_complete.tpz at
f3807a34248e· 1319-1340 -
topaz.stdlib.contract.typeset-length-ptatworking-tree - topaz.decision.typeset-length-pt.1 at
topaz.decisi
Reject untyped physical distances in LatinSpacing
Linkimport std.typeset as tslet value: ts.LatinSpacing = ts.LatinSpacing {minWordSpaceRatio: 0.8,maxWordSpaceRatio: 1.33,maxLetterSpacingEm: 0.01em,fontSizePt: 12.0}
No stdout.
Expected result
Expected result
Rejection during check. Nonzero exit.
TPZ5001stdlib-physical-distance-requires-points atmain.tpz:6:15
Source evidence
- compiler/crates/topaz_resolve/src/std/typeset/model.tpz at
271329b482bc· 16 - compiler/crates/topaz_resolve/src/std/typeset/admission.tpz at
271329b482bc· 1 - compiler/crates/topaz_resolve/src/std/typeset/spacing.tpz at
271329b482bc· 38 - compiler/crates/topaz_resolve/src/std/typeset/paragraph.tpz at
271329b482bc· 90 - compiler/crates/topaz_syntax/src/length.rs at
271329b482bc· 293 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1846 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1976 - compiler/crates/topaz_resolve/src/std/typeset/cost.tpz at
271329b482bc· 1 - compiler/crates/topaz_self_frontend/topaz/checker/members_capabilities.tpz at
f3807a34248e· 691-713 - compiler/crates/topaz_self_frontend/topaz/checker/call_complete.tpz at
f3807a34248e· 1319-1340 -
topaz.stdlib.contract.typeset-length-ptatworking-tree - topaz.decision.typeset-length-pt.1 at
topaz.decisi
Use point lengths in JustificationPolicy
Linkimport std.typeset as tslet value: ts.JustificationPolicy = ts.JustificationPolicy {mode: ts.JustificationMode.Unjustified(),minGapCount: 0,minLineWidthRatioM: 0,minFinalLineWidthRatioM: None(),maxAdjustment: 12pt,maxGapAdjustment: 3pt,maxGapRatioR: 0,latinSpacing: None(),cjkStretchRatio: 0.0}let distance: Length<Pt> = value.maxAdjustment
No stdout.
Expected result
Expected result
Checking accepts the program. Exit code 0.
Source evidence
- compiler/crates/topaz_resolve/src/std/typeset/model.tpz at
271329b482bc· 16 - compiler/crates/topaz_resolve/src/std/typeset/admission.tpz at
271329b482bc· 1 - compiler/crates/topaz_resolve/src/std/typeset/spacing.tpz at
271329b482bc· 38 - compiler/crates/topaz_resolve/src/std/typeset/paragraph.tpz at
271329b482bc· 90 - compiler/crates/topaz_syntax/src/length.rs at
271329b482bc· 293 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1846 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1976 - compiler/crates/topaz_resolve/src/std/typeset/cost.tpz at
271329b482bc· 1 - compiler/crates/topaz_self_frontend/topaz/checker/members_capabilities.tpz at
f3807a34248e· 691-713 - compiler/crates/topaz_self_frontend/topaz/checker/call_complete.tpz at
f3807a34248e· 1319-1340 -
topaz.stdlib.contract.typeset-length-ptatworking-tree - topaz.decision.typeset-length-pt.1 at
topaz.decisi
Reject untyped physical distances in JustificationPolicy
Linkimport std.typeset as tslet value: ts.JustificationPolicy = ts.JustificationPolicy {mode: ts.JustificationMode.Unjustified(),minGapCount: 0,minLineWidthRatioM: 0,minFinalLineWidthRatioM: None(),maxAdjustment: 12,maxGapAdjustment: 3,maxGapRatioR: 0,latinSpacing: None(),cjkStretchRatio: 0.0}
No stdout.
Expected result
Expected result
Rejection during check. Nonzero exit.
TPZ5001stdlib-physical-distance-requires-points atmain.tpz:7:18
Source evidence
- compiler/crates/topaz_resolve/src/std/typeset/model.tpz at
271329b482bc· 16 - compiler/crates/topaz_resolve/src/std/typeset/admission.tpz at
271329b482bc· 1 - compiler/crates/topaz_resolve/src/std/typeset/spacing.tpz at
271329b482bc· 38 - compiler/crates/topaz_resolve/src/std/typeset/paragraph.tpz at
271329b482bc· 90 - compiler/crates/topaz_syntax/src/length.rs at
271329b482bc· 293 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1846 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1976 - compiler/crates/topaz_resolve/src/std/typeset/cost.tpz at
271329b482bc· 1 - compiler/crates/topaz_self_frontend/topaz/checker/members_capabilities.tpz at
f3807a34248e· 691-713 - compiler/crates/topaz_self_frontend/topaz/checker/call_complete.tpz at
f3807a34248e· 1319-1340 -
topaz.stdlib.contract.typeset-length-ptatworking-tree - topaz.decision.typeset-length-pt.1 at
topaz.decisi
Use point lengths in LineGeometry
Linkimport std.typeset as tslet value: ts.LineGeometry = ts.LineGeometry {bodyTarget: 24pt,firstTarget: 20pt,dropCapSpan: 0,dropCapInset: 0pt}let distance: Length<Pt> = value.bodyTarget
No stdout.
Expected result
Expected result
Checking accepts the program. Exit code 0.
Source evidence
- compiler/crates/topaz_resolve/src/std/typeset/model.tpz at
271329b482bc· 16 - compiler/crates/topaz_resolve/src/std/typeset/admission.tpz at
271329b482bc· 1 - compiler/crates/topaz_resolve/src/std/typeset/spacing.tpz at
271329b482bc· 38 - compiler/crates/topaz_resolve/src/std/typeset/paragraph.tpz at
271329b482bc· 90 - compiler/crates/topaz_syntax/src/length.rs at
271329b482bc· 293 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1846 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1976 - compiler/crates/topaz_resolve/src/std/typeset/cost.tpz at
271329b482bc· 1 - compiler/crates/topaz_self_frontend/topaz/checker/members_capabilities.tpz at
f3807a34248e· 691-713 - compiler/crates/topaz_self_frontend/topaz/checker/call_complete.tpz at
f3807a34248e· 1319-1340 -
topaz.stdlib.contract.typeset-length-ptatworking-tree - topaz.decision.typeset-length-pt.1 at
topaz.decisi
Reject untyped physical distances in LineGeometry
Linkimport std.typeset as tslet value: ts.LineGeometry = ts.LineGeometry {bodyTarget: 24,firstTarget: 20,dropCapSpan: 0,dropCapInset: 0}
No stdout.
Expected result
Expected result
Rejection during check. Nonzero exit.
TPZ5001stdlib-physical-distance-requires-points atmain.tpz:3:15
Source evidence
- compiler/crates/topaz_resolve/src/std/typeset/model.tpz at
271329b482bc· 16 - compiler/crates/topaz_resolve/src/std/typeset/admission.tpz at
271329b482bc· 1 - compiler/crates/topaz_resolve/src/std/typeset/spacing.tpz at
271329b482bc· 38 - compiler/crates/topaz_resolve/src/std/typeset/paragraph.tpz at
271329b482bc· 90 - compiler/crates/topaz_syntax/src/length.rs at
271329b482bc· 293 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1846 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1976 - compiler/crates/topaz_resolve/src/std/typeset/cost.tpz at
271329b482bc· 1 - compiler/crates/topaz_self_frontend/topaz/checker/members_capabilities.tpz at
f3807a34248e· 691-713 - compiler/crates/topaz_self_frontend/topaz/checker/call_complete.tpz at
f3807a34248e· 1319-1340 -
topaz.stdlib.contract.typeset-length-ptatworking-tree - topaz.decision.typeset-length-pt.1 at
topaz.decisi
Use point lengths in PlanLine
Linkimport std.typeset as tslet value: ts.PlanLine = ts.PlanLine {start: 0,endExclusive: 1,trimmedEndExclusive: 1,displayTextScalarLength: 1,kind: ts.BreakKind.ForcedEnd(),target: 12pt,rawTextWidth: 10pt,trimmedTextWidth: 10pt,costTextWidth: 10pt,selectedPenaltyWidth: 0pt,postValidationWidthLimit: Some(13pt),cost: 0,adjustmentRatioR: 0}let distance: Length<Pt> = value.targetlet limit: Option<Length<Pt>> = value.postValidationWidthLimit
No stdout.
Expected result
Expected result
Checking accepts the program. Exit code 0.
Source evidence
- compiler/crates/topaz_resolve/src/std/typeset/model.tpz at
271329b482bc· 16 - compiler/crates/topaz_resolve/src/std/typeset/admission.tpz at
271329b482bc· 1 - compiler/crates/topaz_resolve/src/std/typeset/spacing.tpz at
271329b482bc· 38 - compiler/crates/topaz_resolve/src/std/typeset/paragraph.tpz at
271329b482bc· 90 - compiler/crates/topaz_syntax/src/length.rs at
271329b482bc· 293 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1846 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1976 - compiler/crates/topaz_resolve/src/std/typeset/cost.tpz at
271329b482bc· 1 - compiler/crates/topaz_self_frontend/topaz/checker/members_capabilities.tpz at
f3807a34248e· 691-713 - compiler/crates/topaz_self_frontend/topaz/checker/call_complete.tpz at
f3807a34248e· 1319-1340 -
topaz.stdlib.contract.typeset-length-ptatworking-tree - topaz.decision.typeset-length-pt.1 at
topaz.decisi
Reject untyped physical distances in PlanLine
Linkimport std.typeset as tslet value: ts.PlanLine = ts.PlanLine {start: 0,endExclusive: 1,trimmedEndExclusive: 1,displayTextScalarLength: 1,kind: ts.BreakKind.ForcedEnd(),target: 12,rawTextWidth: 10,trimmedTextWidth: 10,costTextWidth: 10,selectedPenaltyWidth: 0,postValidationWidthLimit: Some(13),cost: 0,adjustmentRatioR: 0}
No stdout.
Expected result
Expected result
Rejection during check. Nonzero exit.
TPZ5001stdlib-physical-distance-requires-points atmain.tpz:8:11
Source evidence
- compiler/crates/topaz_resolve/src/std/typeset/model.tpz at
271329b482bc· 16 - compiler/crates/topaz_resolve/src/std/typeset/admission.tpz at
271329b482bc· 1 - compiler/crates/topaz_resolve/src/std/typeset/spacing.tpz at
271329b482bc· 38 - compiler/crates/topaz_resolve/src/std/typeset/paragraph.tpz at
271329b482bc· 90 - compiler/crates/topaz_syntax/src/length.rs at
271329b482bc· 293 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1846 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1976 - compiler/crates/topaz_resolve/src/std/typeset/cost.tpz at
271329b482bc· 1 - compiler/crates/topaz_self_frontend/topaz/checker/members_capabilities.tpz at
f3807a34248e· 691-713 - compiler/crates/topaz_self_frontend/topaz/checker/call_complete.tpz at
f3807a34248e· 1319-1340 -
topaz.stdlib.contract.typeset-length-ptatworking-tree - topaz.decision.typeset-length-pt.1 at
topaz.decisi
Pass typed distances to the line-cost function
Linkimport std.typeset as tslet value = ts.lineBadness(20pt, 20pt, 4, 1, ts.BreakKind.ForcedEnd(), false, 0, 0pt)
No stdout.
Expected result
Expected result
Checking accepts the program. Exit code 0.
Source evidence
- compiler/crates/topaz_resolve/src/std/typeset/model.tpz at
271329b482bc· 16 - compiler/crates/topaz_resolve/src/std/typeset/admission.tpz at
271329b482bc· 1 - compiler/crates/topaz_resolve/src/std/typeset/spacing.tpz at
271329b482bc· 38 - compiler/crates/topaz_resolve/src/std/typeset/paragraph.tpz at
271329b482bc· 90 - compiler/crates/topaz_syntax/src/length.rs at
271329b482bc· 293 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1846 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1976 - compiler/crates/topaz_resolve/src/std/typeset/cost.tpz at
271329b482bc· 1 - compiler/crates/topaz_self_frontend/topaz/checker/members_capabilities.tpz at
f3807a34248e· 691-713 - compiler/crates/topaz_self_frontend/topaz/checker/call_complete.tpz at
f3807a34248e· 1319-1340 -
topaz.stdlib.contract.typeset-length-ptatworking-tree - topaz.decision.typeset-length-pt.1 at
topaz.decisi
Reject raw distances at the line-cost boundary
Linkimport std.typeset as tslet value = ts.lineBadness(20, 20, 4, 1, ts.BreakKind.ForcedEnd(), false, 0, 0)
No stdout.
Expected result
Expected result
Rejection during check. Nonzero exit.
TPZ5001stdlib-physical-distance-requires-points atmain.tpz:2:28
Source evidence
- compiler/crates/topaz_resolve/src/std/typeset/model.tpz at
271329b482bc· 16 - compiler/crates/topaz_resolve/src/std/typeset/admission.tpz at
271329b482bc· 1 - compiler/crates/topaz_resolve/src/std/typeset/spacing.tpz at
271329b482bc· 38 - compiler/crates/topaz_resolve/src/std/typeset/paragraph.tpz at
271329b482bc· 90 - compiler/crates/topaz_syntax/src/length.rs at
271329b482bc· 293 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1846 - compiler/crates/topaz_self_frontend/topaz/checker/expression_core.tpz at
271329b482bc· 1976 - compiler/crates/topaz_resolve/src/std/typeset/cost.tpz at
271329b482bc· 1 - compiler/crates/topaz_self_frontend/topaz/checker/members_capabilities.tpz at
f3807a34248e· 691-713 - compiler/crates/topaz_self_frontend/topaz/checker/call_complete.tpz at
f3807a34248e· 1319-1340 -
topaz.stdlib.contract.typeset-length-ptatworking-tree - topaz.decision.typeset-length-pt.1 at
topaz.decisi
Diagnostics
LinkRead plan boundaries, measurements, and scores separately
LinkRead plan boundaries, measurements, and scores separately
ParagraphPlan.lines contains line records in source order. Each nonempty line consumes the half-open unit interval from start through endExclusive. The first line starts at zero, adjacent lines share an endpoint, and the last line ends at the unit count. These are BoxItem and GlueItem indices rather than item array offsets, scalar offsets, or byte offsets.
trimmedEndExclusive removes trailing units whose complete text is an ASCII space or a no-break space. It stays between start and endExclusive. displayTextScalarLength counts Unicode scalars in the consumed text after trailing ASCII spaces and no-break spaces are removed. It excludes the selected penalty insertion and retains leading text.
A unit width includes its following tracking contribution. rawTextWidth is the sum of consumed unit widths minus the last consumed unit trackingAfter. trimmedTextWidth applies the same formula to the trimmed unit interval. An empty trimmed interval has zero width. Reading a plan does not reshape text or modify source measurements.
kind reports the selected penalty kind. selectedPenaltyWidth reports that selected penalty width after conversion to the computation grid for every kind and cost model. The insertion contributes at the selected boundary and leaves the stored text, source indices, and displayTextScalarLength unchanged.
FixedPoint costTextWidth is the raw width, capped at the target minus selectedPenaltyWidth on a nonfinal line with bounded spacing capacity. KnuthPlass costTextWidth excludes leading GlueItem units and excludes trailing GlueItem units for an ordinary break. A Forced KnuthPlass break retains its trailing glue and associated capacity.
FixedPoint postValidationWidthLimit is Some(limit) with the effective target, nonfinal shrink allowance, and one grid unit of rounding allowance. It reports the optimized admission threshold. Single-unit lines and greedy choices can exceed it. KnuthPlass reports None() because its admission is expressed by glue capacity and adjustment ratios.
cost is the selected line contribution under the paragraph cost model, including applicable penalty and transition demerits. adjustmentRatioR is zero for FixedPoint. For KnuthPlass it is the signed ratio to the selected stretch or shrink capacity, scaled by 100000000 and rounded to nearest with ties to even.
ParagraphPlan.totalCost is the sum of its line costs in line order. Scores can be negative when an Allowed penalty rewards a break. A score is interpreted with its CostModel and policies. ParagraphPlan.grid reports the computation grid, while all reported distances retain Length<Pt>.
For an applicable FixedPoint bounded fill search, optimized.boundedFillFeasible is Some(true) when that search succeeds and Some(false) when the second search supplies the plan. In other cases it is None(). The greedy plan always reports None(). This field records feasibility within the configured bounded search.
ParagraphResult.optimized and greedy contain the two plans from the same validated input. breakOpportunityCount counts all eligible penalty entries before planning, including equal-boundary duplicates and the supplied terminal candidate. It is independent of the number of output lines.
Why
A renderer needs source consumption, display trimming, width admission, and scoring as separate measurements. Explicit indices and optional feasibility results let the renderer inspect source consumption and width fit for every selected line.
Source evidence
- compiler/crates/topaz_resolve/src/std/typeset/model.tpz at
f3807a34248e· 55-67 - compiler/crates/topaz_resolve/src/std/typeset/measure.tpz at
f3807a34248e· 7-25 - compiler/crates/topaz_resolve/src/std/typeset/measure.tpz at
f3807a34248e· 52-80 - compiler/crates/topaz_resolve/src/std/typeset/line.tpz at
f3807a34248e· 1-27 - compiler/crates/topaz_resolve/src/std/typeset/knuth_plass.tpz at
f3807a34248e· 1-46 - compiler/crates/topaz_resolve/src/std/typeset/paragraph.tpz at
f3807a34248e· 78-105 - compiler/crates/topaz_resolve/src/std/typeset/greedy.tpz at
f3807a34248e· 28-36 -
topaz.stdlib.contract.typeset-plan-reportingatworking-tree
Keep consumed units distinct from displayed trailing space
Linkimport std.typeset as tsimport std.iolet items: Array<ts.Item> = [ts.Item.BoxItem(ts.Box { unitIndex: 0, text: "a", width: 3pt, trackingAfter: 0pt }),ts.Item.GlueItem(ts.Glue { unitIndex: 1, text: " ", width: 1pt, trackingAfter: 0pt, stretch: 0pt, shrink: 0pt }),ts.Item.PenaltyItem(ts.Penalty { unitEnd: 2, width: 0pt, rule: ts.BreakRule.Forced(), kind: ts.BreakKind.ForcedEnd(), flagged: false })]let input = ts.Paragraph {grid: ts.DistanceGrid.MilliPoint(),items: items,geometry: ts.LineGeometry { bodyTarget: 4pt, firstTarget: 4pt, dropCapSpan: 0, dropCapInset: 0pt },justification: ts.JustificationPolicy {mode: ts.JustificationMode.Unjustified(), minGapCount: 0,minLineWidthRatioM: 0, minFinalLineWidthRatioM: None(),maxAdjustment: 0pt, maxGapAdjustment: 0pt, maxGapRatioR: 0,latinSpacing: None(), cjkStretchRatio: 0.0},costModel: ts.CostModel.FixedPoint(),knuthPlass: ts.KnuthPlassPolicy { toleranceR: 100000000, linePenalty: 10, fitnessDemerit: 0, flaggedDemerit: 0, finalFlaggedDemerit: 0 }}match (ts.breakParagraph(input)) {case Ok(result) => {let plan = result.optimizedlet line = plan.lines[0]io.writeLine("{line.start} {line.endExclusive} {line.trimmedEndExclusive} {line.displayTextScalarLength}")io.writeLine("{line.rawTextWidth == 4pt} {line.trimmedTextWidth == 3pt} {line.costTextWidth == 4pt}")io.writeLine("{line.selectedPenaltyWidth == 0pt} {line.adjustmentRatioR}")match (line.postValidationWidthLimit) {case Some(limit) => io.writeLine("{limit == 4.001pt}")case None() => io.writeLine("missing limit")}match (plan.boundedFillFeasible) {case None() => io.writeLine("no fill search")case Some(_) => io.writeLine("unexpected fill search")}}case Err(_) => io.writeLine("unexpected error")}
0 2 1 1 true true true true 0 true no fill search
Expected result
Expected result
Execution completes. Exit code 0.
0 2 1 1true true truetrue 0trueno fill search
Source evidence
- compiler/crates/topaz_resolve/src/std/typeset/model.tpz at
f3807a34248e· 55-67 - compiler/crates/topaz_resolve/src/std/typeset/measure.tpz at
f3807a34248e· 7-25 - compiler/crates/topaz_resolve/src/std/typeset/measure.tpz at
f3807a34248e· 52-80 - compiler/crates/topaz_resolve/src/std/typeset/line.tpz at
f3807a34248e· 1-27 - compiler/crates/topaz_resolve/src/std/typeset/knuth_plass.tpz at
f3807a34248e· 1-46 - compiler/crates/topaz_resolve/src/std/typeset/paragraph.tpz at
f3807a34248e· 78-105 - compiler/crates/topaz_resolve/src/std/typeset/greedy.tpz at
f3807a34248e· 28-36 -
topaz.stdlib.contract.typeset-plan-reportingatworking-tree
Report an indivisible unit wider than its target
Linkimport std.typeset as tsimport std.iolet items: Array<ts.Item> = [ts.Item.BoxItem(ts.Box { unitIndex: 0, text: "a", width: 5pt, trackingAfter: 0pt }),ts.Item.PenaltyItem(ts.Penalty { unitEnd: 1, width: 0pt, rule: ts.BreakRule.Forced(), kind: ts.BreakKind.ForcedEnd(), flagged: false })]let input = ts.Paragraph {grid: ts.DistanceGrid.MilliPoint(),items: items,geometry: ts.LineGeometry { bodyTarget: 1pt, firstTarget: 1pt, dropCapSpan: 0, dropCapInset: 0pt },justification: ts.JustificationPolicy {mode: ts.JustificationMode.Unjustified(), minGapCount: 0,minLineWidthRatioM: 0, minFinalLineWidthRatioM: None(),maxAdjustment: 0pt, maxGapAdjustment: 0pt, maxGapRatioR: 0,latinSpacing: None(), cjkStretchRatio: 0.0},costModel: ts.CostModel.FixedPoint(),knuthPlass: ts.KnuthPlassPolicy { toleranceR: 100000000, linePenalty: 10, fitnessDemerit: 0, flaggedDemerit: 0, finalFlaggedDemerit: 0 }}match (ts.breakParagraph(input)) {case Ok(result) => {let line = result.optimized.lines[0]io.writeLine("{line.start} {line.endExclusive} {line.trimmedTextWidth == 5pt} {line.target == 1pt}")}case Err(_) => io.writeLine("unexpected error")}
0 1 true true
Expected result
Expected result
Execution completes. Exit code 0.
0 1 true true
Source evidence
- compiler/crates/topaz_resolve/src/std/typeset/model.tpz at
f3807a34248e· 55-67 - compiler/crates/topaz_resolve/src/std/typeset/measure.tpz at
f3807a34248e· 7-25 - compiler/crates/topaz_resolve/src/std/typeset/measure.tpz at
f3807a34248e· 52-80 - compiler/crates/topaz_resolve/src/std/typeset/line.tpz at
f3807a34248e· 1-27 - compiler/crates/topaz_resolve/src/std/typeset/knuth_plass.tpz at
f3807a34248e· 1-46 - compiler/crates/topaz_resolve/src/std/typeset/paragraph.tpz at
f3807a34248e· 78-105 - compiler/crates/topaz_resolve/src/std/typeset/greedy.tpz at
f3807a34248e· 28-36 -
topaz.stdlib.contract.typeset-plan-reportingatworking-tree