Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
96f50205
Commit
96f50205
authored
May 26, 2017
by
Serhiy Storchaka
Committed by
GitHub
May 26, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.7] bpo-30310: tkFont now supports unicode options (e.g. font family). (#1567)
parent
2bb6eb3f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
2 deletions
+16
-2
Lib/lib-tk/test/test_tkinter/test_font.py
Lib/lib-tk/test/test_tkinter/test_font.py
+11
-1
Lib/lib-tk/tkFont.py
Lib/lib-tk/tkFont.py
+3
-1
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/lib-tk/test/test_tkinter/test_font.py
View file @
96f50205
import
unittest
import
Tkinter
as
tkinter
import
tkFont
as
font
from
test.test_support
import
requires
,
run_unittest
from
test.test_support
import
requires
,
run_unittest
,
gc_collect
from
test_ttk.support
import
AbstractTkTest
requires
(
'gui'
)
...
...
@@ -35,6 +35,16 @@ class FontTest(AbstractTkTest, unittest.TestCase):
self
.
assertIsInstance
(
self
.
font
.
cget
(
key
),
sizetype
)
self
.
assertIsInstance
(
self
.
font
[
key
],
sizetype
)
def
test_unicode_family
(
self
):
family
=
u'MS
\
u30b4
\
u30b7
\
u30c3
\
u30af
'
try
:
f
=
font
.
Font
(
root
=
self
.
root
,
family
=
family
,
exists
=
True
)
except
tkinter
.
TclError
:
f
=
font
.
Font
(
root
=
self
.
root
,
family
=
family
,
exists
=
False
)
self
.
assertEqual
(
f
.
cget
(
'family'
),
family
)
del
f
gc_collect
()
def
test_actual
(
self
):
options
=
self
.
font
.
actual
()
self
.
assertGreaterEqual
(
set
(
options
),
...
...
Lib/lib-tk/tkFont.py
View file @
96f50205
...
...
@@ -47,8 +47,10 @@ class Font:
def
_set
(
self
,
kw
):
options
=
[]
for
k
,
v
in
kw
.
items
():
if
not
isinstance
(
v
,
basestring
):
v
=
str
(
v
)
options
.
append
(
"-"
+
k
)
options
.
append
(
str
(
v
)
)
options
.
append
(
v
)
return
tuple
(
options
)
def
_get
(
self
,
args
):
...
...
Misc/NEWS
View file @
96f50205
...
...
@@ -49,6 +49,8 @@ Extension Modules
Library
-------
- bpo-30310: tkFont now supports unicode options (e.g. font family).
- bpo-30414: multiprocessing.Queue._feed background running
thread do not break from main loop on exception.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment