Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rework to accept as many legends as user wants, a list of dictionarie… #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alinelena
Copy link

…s. each legend can be displaced with respect to the centre on both x and y

…s. each legend can be displaced with respect to the centre on both x and y
@alinelena
Copy link
Author

an example of how it looks

legends

legends are provided as a list of dictionaries

rows = [
    {'angle': 13, 'height': 16},      # row 0, function row
    {'angle': 9,  'height': 14},      # row 1, numbers row
    {'angle': 8,  'height': 12},      # row 2, QWERT
    {'angle': -6, 'height': 11.5},      # row 3, ASDFG
    {'angle': -8, 'height': 13},      # row 4, ZXCVB
    {'angle': 0,  'height': 12.5},      # row 5, bottom row
]

legend = [
        {'t':'⎋','ox':-9.0,'oy':2.5,'fs':12,'f':"DejaVu Sans Mono"},
        {'t':'α','ox':8.8,'oy':3.0,'fs':2,'f':"DejaVu Sans Mono"},
        {'t':'ă','ox':-5.8,'oy':-3.0,'fs':8,'f':"DejaVu Sans Mono"},
        {'t':'x','ox':7.8,'oy':-3.0,'fs':5,'f':"DejaVu Sans Mono"},
        {'t':'o','fs':10}
          ]

cap = keycap(angle=rows[5]['angle'], height=rows[5]['height'],
             unitX=2, unitY=1,
             convex=False, depth=2.8,
             legend=legend)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant