Skip to content

Commit 8012d63

Browse files
committed
mention line breaking
1 parent ded4931 commit 8012d63

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

font-metrics-api/README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ Font Metrics API
55

66
Box tree/view object stuff will be great as an underpinning for custom layout, particularly when it's extended to cover line boxes. But the proposals discussed so far lack some information that's needed for layout that depends on font metrics. It's not sufficient to know where the line box is being laid out. You also need to know where the glyphs inside that line box are being drawn.
77

8+
There are also some parts of layout that are typographically-intensive, like line breaking. Allowing script to substitute its own line breaking would be an excellent extensibility point that's often asked for.
9+
810
# Examples:
911

1012
The align-items:baseline feature in flex layout
@@ -19,7 +21,10 @@ Baseline grid
1921
Math layout
2022
* needs much much more than the above, including individual glyph advances and bounds.
2123

22-
# Font data versus layout results
24+
Line breaking
25+
* needs access to font data, all of the style inputs for text, and layout information (available line lengths, intrusions like floats, etc.)
26+
27+
# Font data versus typographic measurement
2328

2429
I (Alan) initially thought that exposing the actual font data could be a good first step, but conversations I've had have convinced me that there's a better stepping-stone to use. Given raw font metrics, one has to reverse-engineer how the browser will use those metrics in order to determine where baselines, etc. will actually be drawn. Direct access to all of the font information was not sufficient for dropcap.js, because browsers use the font information in slightly different ways - we still had to sample the rendered text in each browser to determine where glyphs were placed.
2530

0 commit comments

Comments
 (0)