Skip to content

Commit

Permalink
Improve fonts_demo_kw
Browse files Browse the repository at this point in the history
  • Loading branch information
jenshnielsen committed Nov 16, 2014
1 parent 38fbda6 commit c48f88d
Showing 1 changed file with 18 additions and 22 deletions.
40 changes: 18 additions & 22 deletions examples/pylab_examples/fonts_demo_kw.py
Expand Up @@ -12,61 +12,57 @@

# Show family options

family = ['serif', 'sans-serif', 'cursive', 'fantasy', 'monospace']
families = ['serif', 'sans-serif', 'cursive', 'fantasy', 'monospace']

t = text(-0.8, 0.9, 'family', size='large', **alignment)

yp = [0.7, 0.5, 0.3, 0.1, -0.1, -0.3, -0.5]
yp = [0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2]

for k in range(5):
if k == 2:
t = text(-0.8, yp[k], family[k], family=family[k],
name='Script MT', **alignment)
else:
t = text(-0.8, yp[k], family[k], family=family[k], **alignment)
for k, family in enumerate(families):
t = text(-0.8, yp[k], family, family=family, **alignment)

# Show style options

style = ['normal', 'italic', 'oblique']
styles = ['normal', 'italic', 'oblique']

t = text(-0.4, 0.9, 'style', **alignment)

for k in range(3):
t = text(-0.4, yp[k], style[k], family='sans-serif', style=style[k],
for k, style in enumerate(styles):
t = text(-0.4, yp[k], style, family='sans-serif', style=style,
**alignment)

# Show variant options

variant = ['normal', 'small-caps']
variants = ['normal', 'small-caps']

t = text(0.0, 0.9, 'variant', **alignment)

for k in range(2):
t = text(0.0, yp[k], variant[k], family='serif', variant=variant[k],
for k, variant in enumerate(variants):
t = text(0.0, yp[k], variant, family='serif', variant=variant,
**alignment)

# Show weight options

weight = ['light', 'normal', 'medium', 'semibold', 'bold', 'heavy', 'black']
weights = ['light', 'normal', 'medium', 'semibold', 'bold', 'heavy', 'black']

t = text(0.4, 0.9, 'weight', **alignment)

for k in range(7):
t = text(0.4, yp[k], weight[k], weight=weight[k],
for k, weight in enumerate(weights):
t = text(0.4, yp[k], weight, weight=weight,
**alignment)

# Show size options

size = ['xx-small', 'x-small', 'small', 'medium', 'large',
'x-large', 'xx-large']
sizes = ['xx-small', 'x-small', 'small', 'medium', 'large',
'x-large', 'xx-large']

t = text(0.8, 0.9, 'size', **alignment)

for k in range(7):
t = text(0.8, yp[k], size[k], size=size[k],
for k, size in enumerate(sizes):
t = text(0.8, yp[k], size, size=size,
**alignment)

x = 0
x = -0.4
# Show bold italic
t = text(x, 0.1, 'bold italic', style='italic',
weight='bold', size='x-small',
Expand Down

0 comments on commit c48f88d

Please sign in to comment.