(font :ttLib.TTFont)
| 327 | |
| 328 | |
| 329 | def getUnicodeMap(font :ttLib.TTFont) -> {int:str} : # codepoint=>glyphname |
| 330 | # https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6cmap.html |
| 331 | bestCodeSubTable = None |
| 332 | bestCodeSubTableFormat = 0 |
| 333 | for st in font['cmap'].tables: |
| 334 | if st.platformID == 0: # 0=unicode, 1=mac, 2=(reserved), 3=microsoft |
| 335 | if st.format > bestCodeSubTableFormat: |
| 336 | bestCodeSubTable = st |
| 337 | bestCodeSubTableFormat = st.format |
| 338 | return bestCodeSubTable.cmap |
| 339 | |
| 340 | |
| 341 | def genCompactCodepointRanges(codepoints :[int], groupAllThreshold :int) -> str: |
no outgoing calls
no test coverage detected
searching dependent graphs…