Calendar Year Demo #608
Replies: 2 comments 11 replies
-
Very cool! Even without FX2D I think we can get very high-resolution using an off-screen buffer! import calendar
YEAR = 2025
sf = 4 # scale factor
def setup():
global out
size(1000, 810)
calendar.setfirstweekday(6)
out = create_graphics(width * sf, height * sf)
begin_record(out)
out.scale(sf)
background(255)
fill(0)
mono = create_font("Inconsolata Bold", 18) # downloaded from fonts.google.com
text_font(mono)
text(calendar.calendar(YEAR, w=2, l=1, c=4, m=4), 50, 60 )
end_record()
out.save(f'{YEAR}.png') I have a page on how to export SVG/PDF, but it is in Portuguese :( |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
The following code demonstrates the python 'calendar' library and will display a year calendar. It requires a mono spaced font and will output a higher quality display with the FX2D renderer. The image may be saved to the sketch folder by pressing the 'S' key and printed in landscape orientation.
Output:

Beta Was this translation helpful? Give feedback.
All reactions