[ Pobierz całość w formacie PDF ]
.For example,VERSE {counter-increment: verse-num -1}Finally, the contentproperty can have more than one counter, and additionalcontent as well as counters.For instance, these rules number the verses in the form1.1, 1.2, 1.3,., 2.1, 2.2, 2.3,.where the first number indicates the stanza and thesecond the verse:VERSE {counter-increment: verse-num}STANZA {counter-reset: verse-num}STANZA {counter-increment: stanza-num}REFRAIN {counter-reset: verse-num}REFRAIN {counter-reset: stanza-num 0}VERSE:before {content:counter(stanza-num) . counter(verse-num) }You re not limited to European numerals either.You can pass a second argument tothe counter()function to specify a different number format.Available formatsinclude disc, circle, square, decimal, decimal-leading-zero, lower-roman,upper-roman, lower-greek, lower-alpha, lower-latin, upper-alpha, upper-latin, hebrew, armenian, georgian, cjk-ideographic, hiragana, katakana,hiragana-iroha, and katakana-iroha.For example, to number the verses usingJapanese numeral in hiragana, you might write:VERSE:before {content: counter(stanza-num, hiragana). counter(verse-num, hiragana) }Aural Style SheetsVisually impaired users already use special software to read Web pages.In thefuture, such use is likely to expand to sighted people browsing the Web whiletalking on cell phones, driving their cars, washing the dishes, and performing otheractivities in which the eyes and hands have to be directed elsewhere.CSS2supports new properties to describe how elements are read out loud as well as howthey re printed or shown on a screen.The new properties are discussed in thesections that follow.Listing 13-3 is an aural style sheet that identifies specific waysto speak information found in common play-related XML elements.Listing 13-3: An Aural style sheet for a play or sonnetTITLE, AUTHOR, ACT, SCENE {voice-family: narrator;stress: 20;Continued 3236-7 ch13.F.qc 6/29/99 1:08 PM Page 426Part III &' Style Languages426Listing 13-3 (continued)richness: 90;cue-before: url( ping.au )}.narrator { pause: 20ms;cue-before: url( pop.au );cue-after: url( pop.au );azimuth: 30deg;elevation: above }ACT { pause: 30ms 40ms } /* pause-before: 30ms;pause-after: 40ms */SCENE { pause-after: 10ms } /* pause-after: 10ms */SCENE { cue-before: url( bell.aiff );cue-after: url( dong.wav ) }MOOD.sad { play-during: url( violins.aiff ) }MOOD.funereal { play-during: url( harp.wav ) mix }MOOD.quiet { play-during: none }LINE.narrator { azimuth: behind } /* 180deg */LINE.part.romeo { voice-family: romeo, male }LINE.part.juliet { voice-family: juliet, female }LINE.part.hercules { azimuth: center-left }LINE.part.richard { azimuth: right }LINE.part.carmen { volume: x-soft }LINE.part.muse1 { elevation: 60deg }LINE.part.muse2 { elevation: 30deg }LINE.part.muse3 { elevation: level }Speak PropertyThe speakproperty determines whether text will be rendered aurally and if so,how.If speakhas the value normal, text is spoken using the best available speechsynthesis.If speakhas the value spell-out, the text is spelled out letter-by-letter,which might be useful for unusual or foreign words a speech synthesizer probablycan t handle.The default value is none(for example, just render the contentvisually and forget about speech synthesis).Volume PropertyThe volumeproperty controls the average volume of the speaking voice of thespeech synthesizer.This is the median value of the analog wave of the voice, but 3236-7 ch13.F.qc 6/29/99 1:08 PM Page 427Chapter 13 &' Cascading Style Sheets Level 2427it s only an average.A highly inflected voice at a volume of 50might peak at 75.Theminimum volume is 0.The maximum volume is 100.Percentage values can also beused, as can any of these six keywords:1.silent: no sound2.x-soft: 0, the minimum audible volume3.soft: about 254.medium: about 505.loud: about 756.x-loud: 100, the maximum comfortable hearing levelPause PropertiesPauses are the aural equivalent of a comma.They can be used to provide drama, orjust to help separate one speaker s voice from another s.They re set in CSS2 withthe pause, pause-before, and pause-afterproperties.The pause-beforeproperty specifies the length of time the speech synthesizershould pause before speaking an element s contents.The pause-afterpropertyspecifies the length of time the speech synthesizer should pause after speaking anelement s contents.These can be set as an absolute time or as a percentage of thespeech-rate property.The pauseproperty is shorthand for setting both pause-beforeand pause-after.When two values are supplied, the first is applied topause-beforeand the second is applied to pause-after.When only one value isgiven, it applies to both properties.For example:SCENE { pause-after: 10ms }/* pause-before: 20ms; pause-after: 20ms */.narrator { pause: 20ms }/* pause-before: 30ms; pause-after: 40ms */ACT { pause: 30ms 40ms }Cue PropertiesCues are audible clues that alert the listener to a specific event that is about tooccur, or has just occurred.Each cue property specifies a URL for a sound file thatwill be played before or after an element is spoken.The cue-beforeproperty playsa sound before an element is read.The cue-afterproperty plays a sound after anelement is read. 3236-7 ch13.F.qc 6/29/99 1:08 PM Page 428Part III &' Style Languages428The cueproperty is shorthand for setting both cue-beforeand cue-after.Whentwo values are supplied, the first is applied to cue-beforeand the second isapplied to cue-after.When only one value is given, it applies to both properties.For example:ACT, SCENE { cue-before: url( ping.au ) }.narrator { cue: url( pop.au ) }SCENE { cue-before: url( bell.aiff );cue-after: url( dong.wav ) }Play-During PropertyThe play-duringproperty specifies a sound to be played in the background whilean element s content is spoken.The value of the property is URL to the sound file.You can also add one or both of the keywords mixand repeatto the value.Mixtells the speech synthesizer to mix in the parent s play-duringsound [ Pobierz całość w formacie PDF ]

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • czarkowski.pev.pl
  •