Skip to content

Remove linking code between config.conf['documentFormatting']['reportFontAttributes'] and config.conf['documentFormatting']['fontAttributeReporting'] #16802

@SaschaCowley

Description

@SaschaCowley

Is your feature request related to a problem? Please describe.

#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 these two configuration keys are kept in sync.

Describe the solution you'd like

Remove this code in release 2025.1.

Describe alternatives you've considered

Leave the code there. It already does version checking, so won't run if the version is not 2024.x.

Additional context

The only places that should need changing are:

nvda/source/config/__init__.py

Lines 1287 to 1310 in 649c9e6

# Alias [documentFormatting][reportFontAttributes] for backwards compatibility.
# Todo: Remove in 2025.1.
if version_year < 2025and NVDAState._allowDeprecatedAPI():
self._link_reportFontAttributes_and_fontAttributeReporting(key, val)
def _link_reportFontAttributes_and_fontAttributeReporting(self, key, val):
if not (self.path == ("documentFormatting",)):
return
if key == "fontAttributeReporting":
key = "reportFontAttributes"
val = bool(val)
elif key == "reportFontAttributes":
log.warning(
"documentFormatting.reportFontAttributes is deprecated. Use documentFormatting.fontAttributeReporting instead.",
# Include stack info so testers can report warning to add-on author.
stack_info=True
)
key = "fontAttributeReporting"
val = OutputMode.SPEECH_AND_BRAILLE if val else OutputMode.OFF
else:
# We don't care about other keys.
return
self._getUpdateSection()[key] = val
self._cache[key] = val

# Deprecated in 2025.1
reportFontAttributes = boolean(default=false)

Metadata

Metadata

Assignees

Labels

api-breaking-changeaudience/nvda-devPR or issue is relevant to NVDA / Add-on developersdeprecated/2025.1enhancementgood first issuegithub features these at https://github.com/nvaccess/nvda/contributemaintenancep5https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priorityquick fixtriagedHas been triaged, issue is waiting for implementation.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions