Skip to content

Commit 4a717d6

Browse files
committed
Clean up PR by @nvda-india:
* Remove U+F0B7 PUA symbol from symbol dictionary. * Reorder and clean up the mapPUAToUnicode dict. * More consistent code style in _normalizeFormatField(). * Update U+F0E8 to use the same mapping as Word uses when saving to plain text. * Update U+F0FC based on http://www.alanwood.net/demos/wingdings.html. * Update description for U+21E8 to more closely match the Unicode name. * Add U+F0A7, used for bullets on level 3, based on https://en.wikipedia.org/wiki/Symbol_(typeface)#Encoding.
1 parent 592e316 commit 4a717d6

2 files changed

Lines changed: 21 additions & 23 deletions

File tree

‎source/NVDAObjects/window/winword.py‎

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -324,23 +324,21 @@
324324
}
325325
formatConfigFlag_includeLayoutTables=0x20000
326326

327-
328-
##Map some characters from PUA to Unicode. Meant to be used with bullets only.
329-
##Doesn't care about the actual Font, so can give incorrect unicode in rare cases.
330-
## Copy of this is in appModules/powerpnt.py
331-
327+
# Map some characters from PUA to Unicode. Meant to be used with bullets only.
328+
# Doesn't care about the actual font, so can give incorrect Unicode in rare cases.
332329
mapPUAToUnicode = {
333-
u'\uF0B7' : u'\u2022', # star to bullet ( Symbol, 0xB7, U+2022, bullet )
334-
u'\uF06E' : u'\u25A0', # double dash to square box ( Wingdings, 0x6E, U+25A0, black square )
335-
u'\uF0E8' : u'\u2794', # minus greater to arrow( Wingdings, 0xE8, U+2794, right arrow solid)
336-
u'\uF0F0' : u'\u21E8', # equal greater to hollow arrow (Wingdings, 0xF0, U+21E8, right arrow hollow)
337-
u'\uF0D8' : u'\u27A2', # reater to arrow head (Wingdings, 0xD8, U+27A2, right arrowhead)
338-
u'\uF0A8' : u'\u2666', # greater less to diamond ( Symbol, 0xA8, U+25C6, Black diamond )
339-
u'\uF076' : u'\u2756', # Black diamond minus white X (Wingdings, 0x76 , U+2756, black dia...)
340-
u'\uF0FC' : u'\u2713', # Check Mark (Wingdings, 0xFC, U+2713,check mark)
330+
# from : to # fontname
331+
u'\uF06E' : u'\u25A0', # Wingdings
332+
u'\uF076' : u'\u2756', # Wingdings
333+
u'\uF0A7' : u'\u2663', # Symbol
334+
u'\uF0A8' : u'\u2666', # Symbol
335+
u'\uF0B7' : u'\u2022', # Symbol
336+
u'\uF0D8' : u'\u27A2', # Wingdings
337+
u'\uF0E8' : u'\u21D2', # Wingdings
338+
u'\uF0F0' : u'\u21E8', # Wingdings
339+
u'\uF0FC' : u'\u2714', # Wingdings
341340
}
342341

343-
344342
class WordDocumentHeadingQuickNavItem(browseMode.TextInfoQuickNavItem):
345343

346344
def __init__(self,nodeType,document,textInfo,level):
@@ -793,10 +791,10 @@ def _normalizeFormatField(self,field,extraDetail=False):
793791
else:
794792
v=self.obj.getLocalizedMeasurementTextForPointSize(v)
795793
field[x]=v
796-
bullet_string = field.get('line-prefix')
797-
if bullet_string and len(bullet_string) == 1:
798-
global mapPUAToUnicode
799-
field['line-prefix'] = mapPUAToUnicode.get(bullet_string,bullet_string)
794+
bullet=field.get('line-prefix')
795+
if bullet and len(bullet)==1:
796+
global mapPUAToUnicode
797+
field['line-prefix']=mapPUAToUnicode.get(bullet,bullet)
800798
return field
801799

802800
def expand(self,unit):

‎source/locale/en/symbols.dic‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ _ line most
8282
• bullet some
8383
… dot dot dot all always
8484
... dot dot dot all always
85-
 bullet some
8685
“ left quote most
8786
” right quote most
8887
‘ left tick most
@@ -97,10 +96,11 @@ _ line most
9796
▪ black square some
9897
◾ black square some
9998
◦ white bullet some
100-
➔ right arrow some
101-
⇨ right arrow hollow some
102-
➢ right arrow head some
103-
❖ Black diamond minus white X some
99+
⇒ right double arrow some
100+
⇨ right white arrow some
101+
➢ right arrowhead some
102+
❖ black diamond minus white X some
103+
♣ black club some
104104
♦ black diamond some
105105
§ section all
106106
° degrees some

0 commit comments

Comments
 (0)