mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-10 01:50:22 -06:00
Character Styles: Style Options sets character color and OpenType features
Character Style Options and New Character Style get a Character Color section and an OpenType Features section. Character Color sets the fill and stroke (None or a document swatch; a global swatch or a tint of one stays linked, with a Tint from 0% to 100%), the stroke Weight, and Overprint Fill and Overprint Stroke. A gradient or pattern paint the style already has stays until another paint is chosen. OpenType Features sets Figure, Position, Standard and Discretionary Ligatures, Contextual, Stylistic and Titling Alternates, Swash, Ordinals, Fractions and Stylistic Sets 1 to 20. A changed control replaces only its own tags in the style's feature list, so other tags stay, and Default Figure and Default Position are stored as their features turned off, distinct from unset. Empty controls stay unset, and each section's Reset Panel clears only its own attributes. charStyle.new, charStyle.edit and charStyle.setAttrs check a changed fill, stroke, stroke weight or feature list: tints from 0 to 1, links to global swatches of the document (the color follows the swatch), weights from 0 to 4000000, and known feature tags, at most 256. Values the style or the text it is made from already has are kept. charStyle.duplicate keeps the copied style's values in the same way, so a style with a language tag that is not in the list can be duplicated. Editing a global swatch now also updates the fill and stroke stored in character styles, so their text no longer shows as overriding the style and text styled later takes the new color. swatch.unused counts a swatch a character style links to as used.
This commit is contained in:
+22
-2
@@ -5473,19 +5473,39 @@ attribute map in one undo step. `to` is trimmed and must be unique. The command
|
||||
while preserving local overrides; Undo/Redo restores the definition and its users. The `charStyleOptions`
|
||||
dialog exposes `name`, `font_family`, `font_style`, `size`, `leading`, `kerning`, `tracking`, `case`,
|
||||
`position`, `underline`, `strikethrough`, `charAlign`, `h_scale`, `v_scale`, `baseline_shift`, `rotation`,
|
||||
`language`, `section` (`general`, `basic` or `advanced`), and `preview`. An empty field leaves its
|
||||
`language`, `fill`, `fill_tint`, `stroke`, `stroke_tint`, `stroke_width`, `overprint_fill`, `overprint_stroke`,
|
||||
`ot_figure`, `ot_position`, `ot_liga`, `ot_calt`, `ot_dlig`, `ot_swsh`, `ot_salt`, `ot_titl`, `ot_ordn`, `ot_frac`,
|
||||
`ot_sets`, `section` (`general`, `basic`, `advanced`, `color` or `opentype`), and `preview`. An empty field leaves its
|
||||
attribute unset. `leading` and `kerning` also accept `Auto` to store an explicit automatic value.
|
||||
Advanced Character Formats holds `h_scale` and `v_scale` (percent, above 0 and at most 4000000),
|
||||
`baseline_shift` (points, -4000000 to 4000000), `rotation` (degrees, stored from -180 to 180) and `language` (a name or tag from Document
|
||||
Setup's languages; English: USA stores the explicit default `null`, and a tag not in the list that the style
|
||||
already has is kept). Language sets the language the characters are shaped in; it does not change hyphenation
|
||||
or spelling.
|
||||
Character Color holds `fill` and `stroke` (a paint: `{"type": "none"}` or a solid color; the menu lists None and
|
||||
the document's solid swatches, a global swatch or a tint of one as a paint linked to it), `fill_tint` and
|
||||
`stroke_tint` (percent, 0 to 100, for a paint linked to a global swatch), `stroke_width` (points, 0 to 4000000)
|
||||
and the `overprint_fill` and `overprint_stroke` checkboxes. A gradient or pattern paint the style already has is
|
||||
kept until another paint is chosen. A paint linked to a global swatch takes the swatch's color at its tint, and
|
||||
editing the swatch later updates the style and its text. `swatch.unused` counts a swatch a character style's fill or
|
||||
stroke links to as used, whether or not text uses the style.
|
||||
OpenType Features holds `ot_figure` (`default`, `tabularLining`, `proportionalLining`, `proportionalOldstyle` or
|
||||
`tabularOldstyle`), `ot_position` (`default`, `superscript`, `subscript`, `numerator` or `denominator`), the on,
|
||||
off or unset checkboxes `ot_liga`, `ot_calt`, `ot_dlig`, `ot_swsh`, `ot_salt`, `ot_titl`, `ot_ordn` and `ot_frac`,
|
||||
and `ot_sets` (a list of stylistic sets `ss01` to `ss20`, each on, or off with a leading `-`, as in
|
||||
`["ss02", "-ss05"]`; a set not listed is unset). They write the style's `features` list: a changed control
|
||||
replaces only its own tags, so tags the dialog does not show stay, and Default Figure or Default Position stores
|
||||
its features turned off, distinct from unset.
|
||||
`charStyle.new`, `charStyle.setAttrs` and `charStyle.edit` reject a tint outside 0 to 1, a link to a swatch that is
|
||||
not a global swatch of the document, a stroke weight outside 0 to 4000000, more than 256 feature tags and an
|
||||
OpenType feature tag the shaper does not know, unless the style or the text it is made from already has that value.
|
||||
The New Character Style dialog accepts the same character fields and starts with the selected text's
|
||||
captured attributes. Without selected text, it starts with the character defaults for the interface language
|
||||
(including `charAlign: "emBoxCenter"` in Japanese); changing a Basic field keeps other seeded attributes.
|
||||
Without selected text, the New Paragraph Style dialog sends no `attrs`, and the engine gives the new style the
|
||||
paragraph defaults for the interface language. Reset Panel in Basic Character
|
||||
Formats removes those fields from the definition, and Reset Panel in Advanced Character Formats removes its five.
|
||||
Formats removes those fields from the definition, Reset Panel in Advanced Character Formats removes its five, Reset
|
||||
Panel in Character Color removes its five attributes and Reset Panel in OpenType Features removes `features`.
|
||||
`ui.charStyleOptions.resetPanel {}` performs that reset for the section selected in either character-style
|
||||
dialog; it is disabled on General.
|
||||
|
||||
|
||||
@@ -505,6 +505,7 @@ since 2026-10-01.
|
||||
- **Character-style Auto leading:** capture and explicit style attributes retain Auto as a reset, distinct from omitted leading. Redefine and later numeric updates preserve local leading overrides; the Character Styles marker recognizes Auto correctly. Regression assertions cover partial definitions, Undo/Redo and native save/load serialization. Public references: [Character and paragraph styles](https://helpx.adobe.com/illustrator/using/character-paragraph-styles.html) and [Leading](https://helpx.adobe.com/illustrator/using/line-character-spacing.html).
|
||||
- **Character Style Options, General and Basic Character Formats:** the dialog edits a style's name and stored character formats together. Empty fields remain unset, checkboxes show an indeterminate unset state, Basic's Reset Panel clears its explicit settings, and Preview can be canceled without changing history. OK saves one undo step; New Character Style offers the same fields from captured text or the interface language's defaults without a selection. Public reference: [Character and paragraph styles](https://helpx.adobe.com/illustrator/using/character-paragraph-styles.html).
|
||||
- **Character Style Options, Advanced Character Formats:** Character Style Options and New Character Style set a style's Horizontal Scale and Vertical Scale (above 0% and at most 4,000,000%), Baseline Shift (-4,000,000 pt to 4,000,000 pt), Character Rotation (stored from -180° to 180°) and Language; text that uses the style takes them and keeps its local overrides. Empty fields remain unset, an explicit 100%, 0° or English: USA stays distinct from unset, and the section's Reset Panel clears only these five. Language sets the language the characters are shaped in, not hyphenation or spelling. Public reference: [Character and paragraph styles](https://helpx.adobe.com/illustrator/using/character-paragraph-styles.html) ("Adjust the Horizontal and Vertical Scale, Baseline Shift, Character Rotation, and Language options").
|
||||
- **Character Style Options, Character Color and OpenType Features:** Character Style Options and New Character Style set a style's fill and stroke (None or a document swatch; a global swatch stays linked, with a Tint from 0% to 100%), stroke Weight, Overprint Fill and Overprint Stroke, and its Figure, Position, Standard and Discretionary Ligatures, Contextual, Stylistic and Titling Alternates, Swash, Ordinals, Fractions and Stylistic Sets 1 to 20; text that uses the style takes them and keeps its local overrides, and editing a global swatch later updates the style and its text. Empty controls remain unset, an explicit None, off, Default Figure or Default Position stays distinct from unset, each stylistic set is on, off or unset, a gradient or pattern paint stays until another paint is chosen, a changed OpenType control keeps the style's other feature tags, and each section's Reset Panel clears only its own attributes. Public references: [Character and paragraph styles](https://helpx.adobe.com/illustrator/using/character-paragraph-styles.html) ("Change the Character Color, Tint, Weight, and Overprint Fill or Stroke options"; "Set the Figure, Position, Ligatures, Alternates, Ordinals, or Fractions options") and [Format text with OpenType features](https://helpx.adobe.com/illustrator/desktop/design-with-text/special-characters-glyphs/format-text-with-opentype-features.html) ("In the Character Styles or Paragraph Styles panel, select OpenType Features").
|
||||
- **Text styles redefined to the defaults:** New and Redefine Character Style and Paragraph Style capture every attribute of the selected text, including those at their defaults (Auto kerning, Roman baseline alignment, the default Hyphenation options, the Every-line Composer, no tab stops), and `charStyle.setAttrs` and `paraStyle.setAttrs` keep an attribute set to its default value. After a redefinition, text whose value still equals the old definition's takes the new value, a default included; local overrides stay, and text that still has the old value of an attribute the new definition leaves out goes back to the Normal style's value. The style panels show "+" only where the text differs from its style, including type with Auto alignment. Public reference: [Character and paragraph styles](https://web.archive.org/web/20260825113735/https://helpx.adobe.com/illustrator/using/character-paragraph-styles.html).
|
||||
- **Text styles dragged onto the panel's buttons:** a style dragged from the Character Styles or Paragraph Styles panel onto Create New Style is copied (`charStyle.duplicate`, `paraStyle.duplicate`, which name the copy `<name> copy`) and the copy is highlighted; dragged onto Delete it is deleted (`charStyle.delete`, `paraStyle.delete`); the Normal style is not deleted. Each drop is one undo step. Public reference: [Character and paragraph styles](https://web.archive.org/web/20261015081534/https://helpx.adobe.com/illustrator/using/character-paragraph-styles.html).
|
||||
- **Auto Leading outside the layout:** a paragraph's Justification… › Auto Leading (<https://helpx.adobe.com/illustrator/desktop/design-with-text/edit-format-text/adjust-word-and-letterspacing-in-justified-text.html>) also sets the Leading the Character panel shows for Auto type (blank where the selected paragraphs differ), the leading the Alt+↑/↓ nudge (`type.step`) steps from, each paragraph's own, and the lines Fill with Placeholder Text counts in area type. Evidence: `ParaStyle::effective_leading` (`crates/doc/src/text.rs` test `paragraph_effective_leading_follows_auto_leading`), `tests_prefs::auto_leading_steps_and_fills_from_the_paragraph_auto_leading`, `panels::character` test `leading_field_shows_the_paragraph_auto_leading`.
|
||||
|
||||
Reference in New Issue
Block a user