Skip to content

Commit

Permalink
Add support to some ranges. #114
Browse files Browse the repository at this point in the history
This adds quick camelcasing names for issue  #114
* U+2900-U+297F	Supplemental Arrows-B
* U+2980-U+29FF	Miscellaneous Mathematical Symbols-B
* U+2A00-U+2AFF	Supplemental Mathematical Operators
* U+2B00-U+2BFF	Miscellaneous Symbols and Arrows

This also removes 2 gremlin characters from the "Supplementary" word in the unicodePlaneNames. I can't see if they caused any harm, but they should not be there.

This also adds "Combining Diacritical Marks for Symbols", as the module was there but not committed. Basic camelcase names seem best. But noted that the "Combining Diacritical Marks Supplement" does everything lowercase and consistency is hard.
  • Loading branch information
LettError committed Oct 1, 2024
1 parent fcc4eb0 commit 35779b5
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Combining Diacritical Marks for Symbols
#combining_diacritical_marks_for_symbols

# camelcase looks good for the longer names
# but the range Combining Diacritical Marks Supplement
# does everything lowercase.

def process(self):
self.setExperimental()

self.edit("COMBINING")
self.edit("OPEN")
self.edit("ACCENT")
self.edit("FLATTENED", "flat")

self.processAs("Helper Diacritics")
self.handleCase()

self.camelCase()
self.compress()
self.scriptPrefix()


if __name__ == "__main__":
from glyphNameFormatter.exporters import printRange
printRange("Combining Diacritical Marks for Symbols")
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ def process(self):
self.edit("GRAVE-ACUTE-GRAVE", "graveacutegrave")
self.edit("ACUTE-GRAVE-ACUTE", "acutegraveacute")

#self.editToFinal("COMBINING", "cmb")
self.edit("COMBINING")
self.edit("OPEN")
self.edit("ACCENT")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

def process(self):
self.setExperimental()
self.edit("-", " ")
self.camelCase()


if __name__ == "__main__":
from glyphNameFormatter.exporters import printRange
printRange("Miscellaneous Mathematical Symbols-B")
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

def process(self):
self.setExperimental()
self.edit("-", " ")
self.camelCase()


if __name__ == "__main__":
from glyphNameFormatter.exporters import printRange
printRange("Miscellaneous Symbols and Arrows")
19 changes: 19 additions & 0 deletions Lib/glyphNameFormatter/rangeProcessors/supplemental_arrows_b.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@


# The names in this range are quite long, but not really
# any redundancy in the words. It is all relevant and
# even contractions from rightward to right already cause
# duplicates. So, camelCase seems like a reasonable approach.
# Names are still very long though. What is the preference?
# arrowPointingRightwardsThenCurvingDownwards - 2967 ⥧ LEFTWARDS HARPOON WITH BARB DOWN ABOVE RIGHTWARDS HARPOON WITH BARB DOWN


def process(self):
self.setExperimental()
self.edit("-", " ")
self.camelCase()


if __name__ == "__main__":
from glyphNameFormatter.exporters import printRange
printRange("Supplemental Arrows-B")
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

def process(self):
self.setExperimental()
self.edit("-", " ")
self.camelCase()


if __name__ == "__main__":
from glyphNameFormatter.exporters import printRange
printRange("Supplemental Mathematical Operators")
13 changes: 9 additions & 4 deletions Lib/glyphNameFormatter/unicodeRangeNames.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
(0x10000, 0x1FFFF): (u"Supplementary Multilingual Plane", ),
(0x20000, 0x2FFFF): (u"Supplementary Ideographic Plane"),
(0x30000, 0xDFFFF): (u"Plane 3 - 13, unassigned", ),
(0xE0000, 0xEFFFF): (u"Supplement­ary Special-purpose Plane", ),
(0xF0000, 0x10FFFF): (u"Supplement­ary Private Use Area", ),
(0xE0000, 0xEFFFF): (u"Supplementary Special-purpose Plane", ),
(0xF0000, 0x10FFFF): (u"Supplementary Private Use Area", ),
}


Expand All @@ -22,7 +22,6 @@ def getRangeName(value):
return unicodeRangeNames[(a, b)]
return None


def getRangeAndName(value):
for a, b in unicodeRangeNames.keys():
if a <= value <= b:
Expand Down Expand Up @@ -107,4 +106,10 @@ def getSupportedRangeNames():
if __name__ == "__main__":
names = getSupportedRangeNames()
names.sort()
print("\n".join(names))
print("\n".join(names))

#print(rangeNameToModuleName("Supplemental Arrows-B"))
#print(rangeNameToModuleName("Miscellaneous Mathematical Symbols-B"))
#print(rangeNameToModuleName("Supplemental Mathematical Operators"))
#print(rangeNameToModuleName("Miscellaneous Symbols and Arrows"))

0 comments on commit 35779b5

Please sign in to comment.