V0.5.1
The build now includes headers for C and C++
New Features:
- German braille code based on LaTeX
- ASCIIMath braille code
Unlike other braille codes, these two braille codes generate ASCII chars. This was done in consultation with German braille code developers so that both 6-dot and 8-dot German braille are supported, along with the possibility that other countries braille codes can be used. This requires that braille output table be set accordingly.
Interface Changes
Adds
const char *GetNavigationBraille()
This returns the braille associated with the current navigation focus. The returned braille ignores the context in which it lives (i.e., it is brailled as if the current navigation focus is the entire expression).
Note: the existing GetBraille(nav_node_id)
returns the braille for entire expression with the braille indicated by nav_node_id
highlighted as per the BrailleNavHighlight
preference.
Copy As...
The addition of LaTeX and ASCIIMath braille codes allows for the implementation of a "Copy As" MathML/LaTeX/ASCIIMath feature. To help support this, MathCAT has a new CopyAs
preference
This is part of the NVDA Addon. The implementation is in the addon file MathCAT.py, not MathCAT. For reference, the python code used in NVDA for it is:
copy_as = "mathml" # value used even if "CopyAs" pref is invalid
text_to_copy = ""
try:
copy_as = libmathcat.GetPreference("CopyAs").lower()
except Exception as e:
log.error(f"Not able to get 'CopyAs' preference: {e}")
if copy_as == "asciimath" or copy_as == "latex":
# save the old braille code, set the new one, get the braille, then reset the code
saved_braille_code: str = libmathcat.GetPreference("BrailleCode")
libmathcat.SetPreference("BrailleCode", "LaTeX" if copy_as == "latex" else "ASCIIMath")
text_to_copy = libmathcat.GetNavigationBraille()
libmathcat.SetPreference("BrailleCode", saved_braille_code)
if copy_as == "asciimath":
copy_as = "ASCIIMath" # speaks better in at least some voices
else:
mathml = libmathcat.GetNavigationMathML()[0]
if not re.match(self._startsWithMath, mathml):
mathml = (
"<math>\n" + mathml + "</math>"
) # copy will fix up name spacing
elif self.init_mathml != "":
mathml = self.init_mathml
text_to_copy = self._wrapMathMLForClipBoard(mathml)
self._copyToClipAsMathML(text_to_copy, copy_as == "mathml")
# Translators: copy to clipboard
ui.message(_("copy as ") + copy_as)
Hopefully this gives an idea of what needs to be done in other AT.