Skip to content

Don't send font attributes to liblouis when disabled in preferences#8655

Merged
michaelDCurran merged 4 commits into
nvaccess:masterfrom
dkager:i7615
Sep 25, 2018
Merged

Don't send font attributes to liblouis when disabled in preferences#8655
michaelDCurran merged 4 commits into
nvaccess:masterfrom
dkager:i7615

Conversation

@dkager

@dkager dkager commented Aug 20, 2018

Copy link
Copy Markdown
Contributor

Link to issue number:

Fixes #7615.

Summary of the issue:

In all cases except IA2, NVDA doesn't fetch font attributes when the corresponding document formatting setting is disabled. For IA2 this information is always fetched as it is part of the text attributes, which are fetched as a whole. Braille sent them straight to liblouis without checking if the user had disabled reporting of font attributes.

Description of how this pull request fixes the issue:

Only send liblouis translation flags for italic, underline and bold if reporting font attributes is enabled.

Testing performed:

Performed the STR outlined in the issue.

Known issues with pull request:

See #7615 (comment)

Change log entry:

Section: Bug fixes

  • Braille no longer shows font attributes when they were disabled in the Document Formatting settings.

…orting of font attributes is disabled in the document formatting preferences.
Comment thread source/braille.py Outdated
typeform |= louis.italic
if field.get("underline", False):
typeform |= louis.underline
if formatConfig["reportFontAttributes"]:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An early return might result in a much cleaner diff :) I think it also makes the code more readable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is true, unless we later want to add other typeforms, e.g. computer_braille or no_contract. Still, I was thinking about an early return and if you think this too I'll push an update.

LeonarddeR
LeonarddeR previously approved these changes Aug 21, 2018
@michaelDCurran michaelDCurran merged commit a04a4ce into nvaccess:master Sep 25, 2018
@nvaccessAuto nvaccessAuto added this to the 2018.4 milestone Sep 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document formatting preferences don't always apply to braille in browse mode

4 participants