Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update to unicode 12.1#14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Manishearth merged 1 commit intounicode-rs:masterfromchrisduerr:unicode-12
Dec 5, 2019
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletionsscripts/unicode.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
#!/usr/bin/envpython
#!/usr/bin/envpython3
#
# Copyright 2011-2015 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
Expand DownExpand Up@@ -68,28 +68,28 @@ def load_unicode_data(f):
fetch(f)
gencats = {}

udict = {};
range_start = -1;
udict = {}
range_start = -1
for line in fileinput.input(f):
data = line.split(';');
data = line.split(';')
if len(data) != 15:
continue
cp = int(data[0], 16);
cp = int(data[0], 16)
if is_surrogate(cp):
continue
if range_start >= 0:
for i inxrange(range_start, cp):
udict[i] = data;
range_start = -1;
for i inrange(range_start, cp):
udict[i] = data
range_start = -1
if data[1].endswith(", First>"):
range_start = cp;
continue;
udict[cp] = data;
range_start = cp
continue
udict[cp] = data

for code in udict:
[code_org, name, gencat, combine, bidi,
decomp, deci, digit, num, mirror,
old, iso, upcase, lowcase, titlecase ] = udict[code];
old, iso, upcase, lowcase, titlecase ] = udict[code]

# place letter in categories as appropriate
for cat in [gencat, "Assigned"] + expanded_categories.get(gencat, []):
Expand DownExpand Up@@ -300,15 +300,15 @@ def optimize_width_table(wtable):
### character width module
width_table = []
for zwcat in ["Me", "Mn", "Cf"]:
width_table.extend(map(lambda (lo, hi): (lo, hi,0, 0),gencats[zwcat]))
width_table.extend([(lo_hi[0], lo_hi[1],0, 0) for lo_hi ingencats[zwcat]])
width_table.append((4448, 4607, 0, 0))

# get widths, except those that are explicitly marked zero-width above
ea_widths = load_east_asian_width(["W", "F", "A"], ["Me", "Mn", "Cf"])
# these are doublewidth
for dwcat in ["W", "F"]:
width_table.extend(map(lambda (lo, hi): (lo, hi,2, 2),ea_widths[dwcat]))
width_table.extend(map(lambda (lo, hi): (lo, hi,1, 2),ea_widths["A"]))
width_table.extend([(lo_hi1[0], lo_hi1[1],2, 2) for lo_hi1 inea_widths[dwcat]])
width_table.extend([(lo_hi2[0], lo_hi2[1],1, 2) for lo_hi2 inea_widths["A"]])

width_table.sort(key=lambda w: w[0])

Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp