From 6428c7a584f32008366537240b7e2afe146791d7 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Fri, 1 Sep 2023 14:19:20 +0200 Subject: [PATCH] Backport PR #26193: Sort tex2uni data in mathtext --- lib/matplotlib/_mathtext_data.py | 1277 +++++++++++++++--------------- 1 file changed, 644 insertions(+), 633 deletions(-) diff --git a/lib/matplotlib/_mathtext_data.py b/lib/matplotlib/_mathtext_data.py index 8f413b2a1673..baaee1b876da 100644 --- a/lib/matplotlib/_mathtext_data.py +++ b/lib/matplotlib/_mathtext_data.py @@ -463,640 +463,651 @@ uni2type1 = {v: k for k, v in type12uni.items()} +# The script below is to sort and format the tex2uni dict + +## For decimal values: int(hex(v), 16) +# newtex = {k: hex(v) for k, v in tex2uni.items()} +# sd = dict(sorted(newtex.items(), key=lambda item: item[0])) +# +## For formatting the sorted dictionary with proper spacing +## the value '24' comes from finding the longest string in +## the newtex keys with len(max(newtex, key=len)) +# for key in sd: +# print("{0:24} : {1: