nvda
e1d0d9d6 - Separate font attribute reporting between speech and braille (#16748)

Commit
1 year ago
Separate font attribute reporting between speech and braille (#16748) Closes #16755 Summary of the issue: NVDA only allows showing font attributes in both speech and braille, or not at all. Some users want this information reported in only one modality. Description of user facing changes Font attribute reporting can now be set to off, speech, braille, or speech and braille. The document formatting settings panel has been updated to use a dropdown box rather than a checkbox for "Report font attributes". The toggle report font attributes gesture now cycles among the 4 available options. Description of development approach Added a new enum, OutputMode, to store the user's choice. An integer enum was chosen, as we want to enumerate the options. The values were chosen such that it is essentially a feature flag (i.e., SPEECH = 1 and BRAILLE = 2), so that we can test for the bit we're interested in. Added a new configuration key, documentFormatting.fontAttributeReporting, which uses this enum. Added a configuration migration that sets this new key to SPEECH_AND_BRAILLE if documentFormatting.reportFontAttributes is True and OFF if it's False, so that without configuration modification there is no change to NVDA's behaviour. To maintain backwards compatibility, added an alias between documentFormatting.reportFontAttributes and documentFormatting.fontAttributeReporting and vice-versa: documentFormatting.reportFormatting will be set to True if documentFormatting.fontAttributeReporting is set to SPEECH, BRAILLE, or SPEECH_AND_BRAILLE, and False if it is set to OFF. documentFormatting.fontAttributeReporting will be set to SPEECH_AND_BRAILLE if documentFormatting.reportFontAttributes is set to True, or OFF if it is set to False. Updated speech/speech.py and braille.py to check that the appropriate bit of reportFontAttributes is set before outputting font attributes to that modality. Updated script_toggleReportFontAttributes to cycle through the available modes, by incrementing the current value mod the number of possible values. Updated various places where documentFormatting.reportFontAttributes is used as a bool to use documentFormatting.fontAttributeReporting instead.
Author
Parents
Loading