### 3.1.1 Accidental

Accidental objects are created by: Accidental_engraver.

Standard settings:

> `alteration` (number):

>   `accidental-interface::calc-alteration`

>   Alteration numbers for accidental.

> `avoid-slur` (symbol):

>   `'inside`

>   Method of handling slur collisions. Choices are `inside`, `outside`, `around`, and `ignore`. `inside` adjusts the slur if needed to keep the grob inside the slur. `outside` moves the grob vertically to the outside of the slur. `around` moves the grob vertically to the outside of the slur only if there is a collision. `ignore` does not move either. In grobs whose notational significance depends on vertical position (such as accidentals, clefs, etc.), `outside` and `around` behave like `ignore`.

> `glyph-name` (string):

>   `accidental-interface::glyph-name`

>   The glyph name within the font.

>   In the context of (span) bar lines, glyph-name represents a processed form of `glyph`, where decisions about line breaking etc. are already taken.

> `glyph-name-alist` (list):

>   `'((0 . accidentals.natural) (-1/2 . accidentals.flat) (1/2 . accidentals.sharp) (1 . accidentals.doublesharp) (-1 . accidentals.flatflat) (3/4 . accidentals.sharp.slashslash.stemstemstem) (1/4 . accidentals.sharp.slashslash.stem) (-1/4 . accidentals.mirroredflat) (-3/4 . accidentals.mirroredflat.flat))`

>   An alist of key-string pairs.

> `horizontal-skylines` (pair of skylines):

>   `#<unpure-pure-container #<primitive-procedure ly:accidental-interface::horizontal-skylines> >`

>   Two skylines, one to the left and one to the right of this grob.

> `stencil` (stencil):

>   `ly:accidental-interface::print`

>   The symbol to print.

> `vertical-skylines` (pair of skylines):

>   `#<unpure-pure-container #<primitive-procedure ly:grob::vertical-skylines-from-stencil> #<primitive-procedure ly:grob::pure-simple-vertical-skylines-from-extents> >`

>   Two skylines, one above and one below this grob.

> `X-extent` (pair of numbers):

>   `ly:accidental-interface::width`

>   Extent (size) in the X direction, measured in staff-space units, relative to object’s reference point.

> `Y-extent` (pair of numbers):

>   `#<unpure-pure-container #<primitive-procedure ly:accidental-interface::height> #<primitive-procedure ly:accidental-interface::pure-height> >`

>   Extent (size) in the Y direction, measured in staff-space units, relative to object’s reference point.

This object supports the following interface(s): accidental-interface, font-interface, grob-interface, inline-accidental-interface and item-interface.

#### Internals Reference v2.18.2 (稳定分支).