-
-
Notifications
You must be signed in to change notification settings - Fork 716
Separate font attribute reporting between speech and braille #16748
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Separate font attribute reporting between speech and braille #16748
Conversation
…speech, braille, and speech and braille. source/config/configSpec.py: Updated the configuration specification to use OutputMode as the type for documentFormatting.reportFontAttributes. Incremented schema version. source/config/profileUpgradeSteps.py: Added a profile upgrade step from 11 to 12. source/gui/settingsDialogs.py: Updated the settings GUI to reflect the change in config spec.
…speech, braille, and speech and braille. source/config/configSpec.py: Updated the configuration specification to use OutputMode as the type for documentFormatting.reportFontAttributes. Incremented schema version. source/config/profileUpgradeSteps.py: Added a profile upgrade step from 11 to 12. source/gui/settingsDialogs.py: Updated the settings GUI to reflect the change in config spec.
…om/SaschaCowley/nvda into formattingSeparateSpeechAndBraille
…as the value of reportFontAttributes. Implemented a test case for same.
…des that are now available
Thanks very much sascha for this nice work. |
See test results for failed build of commit eeecc628bd |
I know the PR is still in draft state. Though, I mention to get it known early: Moreover, in the case of document formatting config, there seems to be a quite strong link between NVDA's config ( |
This work is the first part of our push to improve font attribute support in braille. Since not all of the options in document formatting are supported in braille, not all of them are going to be converted just yet. We are working on supporting more attributes in braille, and the corresponding options will be updated when support is added. |
…d updated configUpgradeSteps accordingly.
…ntFormatting.fontAttributeReporting and back
…ocumentFormatting.reportFontAttributes
Thanks for this feedback. I've updated the PR to have a separate configuration key for this new type, which is transparently aliased to the old one.
These functions use |
See test results for failed build of commit 9738079287 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
User guide changes look good. Great work.
Co-authored-by: Sean Budd <[email protected]>
…ed them instead of bitwise ands in speech and braille code" This reverts commit 7c5c398.
This reverts commit e357b23.
…ot removed, in 2025.1
… `fontAttributeReporting` (#17035) Partial fix for #16802 Summary of the issue: #16748 introduced new behaviour whereby NVDA can be configured to report font attributes in speech, braille, both or not at all. This required the implementation of a new configuration key, documentFormatting.fontAttributeReporting. To avoid a breaking change to the API, aliasing code was introduced to ensure that the new key and its deprecated counterpart were kept in sync. When the API version is updated, these tests will fail as this code will no-longer run. Therefore, these tests need to be removed. Description of user facing changes None. Description of development approach Deleted tests.unit.test_config.Config_getitem_alias.
Link to issue number:
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 andBRAILLE
= 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 toSPEECH_AND_BRAILLE
ifdocumentFormatting.reportFontAttributes
isTrue
andOFF
if it'sFalse
, so that without configuration modification there is no change to NVDA's behaviour.To maintain backwards compatibility, added an alias between
documentFormatting.reportFontAttributes
anddocumentFormatting.fontAttributeReporting
and vice-versa:documentFormatting.reportFormatting
will be set toTrue
ifdocumentFormatting.fontAttributeReporting
is set toSPEECH
,BRAILLE
, orSPEECH_AND_BRAILLE
, andFalse
if it is set toOFF
.documentFormatting.fontAttributeReporting
will be set toSPEECH_AND_BRAILLE
ifdocumentFormatting.reportFontAttributes
is set toTrue
, orOFF
if it is set toFalse
.Updated
speech/speech.py
andbraille.py
to check that the appropriate bit ofreportFontAttributes
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 usedocumentFormatting.fontAttributeReporting
instead.Testing strategy:
Implemented unit tests for the configuration migration and the aliasing. Manually tested speech and braille output by testing bolded, italicised and underlined text in Word.
Known issues with pull request:
None
Code Review Checklist: