mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-18 19:40:21 +00:00
Type: Area Type Options First Baseline offers Em Box Height
First Baseline gains Em Box Height (`text.areaOptions {firstBaseline:
"emBoxHeight"}`, and the Area Type Options dropdown). The top of the
first line's ideographic em box, the largest on a line of several sizes,
touches the top of the type area inside the inset, in each row/column
cell and in vertical type. It is the em box that Top-to-Top leading
uses. Min is the least distance, as with the other kinds.
Native files save it as `emBoxHeight`. The .ai reader reads editing-data
kind 5 as Em Box Height and the writer writes it back; Legacy (6) and
unknown kinds keep today's fallback.
The dropdown's Ascent and x Height labels, and Fixed in Gujarati, get
the catalog rows nine languages were missing, beside the new label in
every catalog.
Help page: https://helpx.adobe.com/illustrator/desktop/design-with-text/add-manage-text/add-margins-to-text-and-adjust-the-first-baseline.html
This commit is contained in:
+17
@@ -9365,6 +9365,23 @@ Native files save it only when it is `rows`, so files from before it open by col
|
||||
{"name":"run_command","arguments":{"command":"text.areaOptions","params":{"rows":2,"columns":3,"flow":"rows"}}}
|
||||
```
|
||||
|
||||
### First baseline
|
||||
|
||||
`text.areaOptions {firstBaseline: ascent|capHeight|xHeight|leading|emBoxHeight|fixed, firstBaselineMin?: pt}` (Area
|
||||
Type Options › First Baseline and Min) sets how far below the top of the type area, inside the inset, the first line
|
||||
of each row/column cell sits. `emBoxHeight` (Em Box Height) puts the top of the line's ideographic em box at that
|
||||
top; on a line of several sizes the largest em box is used, and vertical type measures it from the frame's right
|
||||
edge. The em box is the one leading measured from em box top to top uses: an ideograph's cell in the font's
|
||||
vertical metrics, or 0.88 em above the baseline when the font has none (VectorCraft's own rule). With every kind but
|
||||
`fixed`, `firstBaselineMin` is the least distance from the top to the first baseline; with `fixed` it is the
|
||||
distance. Each threaded frame keeps its own setting. Native files and `.ai` files save `emBoxHeight` and open it again; other values are refused. The help
|
||||
page describes the option:
|
||||
https://helpx.adobe.com/illustrator/desktop/design-with-text/add-manage-text/add-margins-to-text-and-adjust-the-first-baseline.html
|
||||
|
||||
```json
|
||||
{"name":"run_command","arguments":{"command":"text.areaOptions","params":{"firstBaseline":"emBoxHeight","firstBaselineMin":6}}}
|
||||
```
|
||||
|
||||
## Fitting area type: Auto Size, Shrink Text to Fit, overflow
|
||||
|
||||
`text.areaOptions` (and `text.create`'s `area`, `text.createInPath` in area mode) take a `fit`:
|
||||
|
||||
@@ -1468,6 +1468,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
For Auto Size area type in columns, the bisection for the frame's height runs on the lines of the one-column layout, and its result is checked with at most two layouts of the columns. When the text wraps around objects or does not fit the one-column layout, or when the check fails, the columns are laid out at every step of the bisection, as before. Typing at the start of a story of 50,000 characters in 2 columns took 1,670 ms a keystroke and now takes 292 ms (release build, `auto_height_in_columns_typing_timing`).
|
||||
Exports to PDF, EPS, SVG, EMF, WMF and the raster formats warn about the area type and type on a path that they draw without the text that doesn't fit, and give their ids, as Print and Print Preview do.
|
||||
On a shaped area type frame, Inset Spacing keeps text that far from the frame's edge, holes included, measured from the edge itself rather than along the line; the archived help treats the inset as the space an area type object leaves between its text and the path that bounds it (<https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf#page=317>, <https://web.archive.org/web/20220911143322/https://helpx.adobe.com/pdf/cs6/illustrator_reference.pdf#page=325>). A rectangular frame keeps its inset from each side as before, and a column's inner edges keep it once. An edge that two contours of the frame share lies inside the frame, so text runs across it with no inset on either side, and a negative text wrap offset does not shrink a wrap object beside such an edge. Tests: `layout::region::inset_on_a_shaped_frame_is_measured_from_its_sloped_edge`, `inset_keeps_text_clear_of_a_hole_s_sloped_edges`, `inset_applies_once_at_a_column_s_edge_and_at_the_frame_s_edge`, `inset_is_not_kept_beside_an_edge_two_contours_share`, `negative_wrap_offset_does_not_shrink_beside_an_edge_two_contours_share`.
|
||||
Area Type Options › First Baseline offers Em Box Height (`text.areaOptions {firstBaseline: "emBoxHeight"}`), which the help page describes as using the font's em box height (<https://helpx.adobe.com/illustrator/desktop/design-with-text/add-manage-text/add-margins-to-text-and-adjust-the-first-baseline.html>): the top of the first line's ideographic em box, the largest on a line of several sizes, touches the top of the type area inside the inset, in each row/column cell and in vertical type from the frame's right edge. The em box is the one Top-to-Top leading uses (VectorCraft's own measure: an ideograph's cell in the font's vertical metrics, else 0.88 em above the baseline), and Min is the least distance, as with the other kinds. Native files and `.ai` files save and open it; a `.ai` First Baseline kind VectorCraft does not read keeps today's fallback. Tests: `em_box_height_puts_the_first_lines_em_box_top_at_the_type_area_top`, `em_box_height_sets_a_vertical_frames_first_column_at_its_em_box`, `area_options_set_the_em_box_height_first_baseline`, `every_first_baseline_kind_comes_back_with_its_minimum`.
|
||||
An edit copies a thread's story only when it changes one of the thread's frames: with a story of 50,000 characters threaded through 8 frames with a style change at every word, moving another object took 7.8 ms and now takes 0.013 ms, and a frame of a drag took 7.2 ms and now takes 0.012 ms (release build, `threaded_story_edit_timing`).
|
||||
When a story flows through threaded area type, each frame is measured with the whole paragraphs of the story that it needs and a few more, not with the whole rest of the story, and it keeps the same text as before. A story of 1,500 one-line paragraphs (55,892 bytes) through 40 frames was laid out over 2,126,762 bytes of text while the frames were measured, and is now laid out over 21,035 (`thread::tests::many_frames_measure_about_the_text_they_take`). Area type with its lines aligned to the center, the bottom or justified vertically, and type on a path whose first paragraph is aligned Left, Justify Left, Justify All or Auto, are measured the same way: the same story through 40 area frames aligned to the center was laid out over 2,126,762 bytes and is now laid out over 21,035, through 40 paths aligned Left over 2,135,202 bytes and now over 20,583, and through 40 paths aligned Justify All over 2,135,202 bytes and now over 20,583 (same test). Shrink Text to Fit, Dynamic Text, Optical Margin Alignment and Roman Hanging Punctuation on a path, a path aligned to the center or the right, horizontal type on a path whose first paragraph is set right to left or with right-to-left text in the rest of the story, and a frame whose share ends in the story's last paragraph are still measured with the whole rest.
|
||||
A paragraph that continues from one threaded frame into the next has its first-line indent and bullet or number in the frame where it starts; in the next frame its first line starts where its wrapped lines start. In frames that are no longer threaded, copies of a frame and point type converted from one, the first paragraph has its indent and bullet or number again.
|
||||
|
||||
Reference in New Issue
Block a user