Sep-16-2020, 10:30 AM
(This post was last modified: Sep-16-2020, 10:53 AM by ATARI_LIVE.)
Ah it's success!
Thanks!
Code here:
But the pyglet seem more complex than the tkinter. I like tkinter than pyglet more headache for me. I am gonna keep to trying with tkinter because wanted use button and many sizes of fonts each other texts on same the clock screen.
Buran or anyone, if you have time, would you find what's wrong with my original coding with the Tkinter as unable to load the font?
My original code does not load the font from the raspberry pi 4B but WORKS on my Python for windows (include exactly copied all modules from raspberry pi to windows)
Thank You So Much a Million!

Code here:
import pyglet import time i = 2 time_print="%H:%M %P" pyglet.font.add_file('/home/pi/.fonts/Digital-7.ttf') window = pyglet.window.Window() window.set_fullscreen(True) label = pyglet.text.Label('', font_name='Digital-7', font_size=400, x=window.width//2, y=window.height//2, anchor_x='center', anchor_y='center') def update_clock(dt): global i global time_print label.text = time.strftime(time_print) if i == 2: time_print="%H,%M %P" i=1 elif i == 1: time_print="%H:%M %P" i = 2 return pyglet.clock.schedule_interval(update_clock, 1) @window.event def on_draw(): window.clear() label.draw() pyglet.app.run()Also I edited the Digital-7.ttf due to keep center and width to stay with : and ; and 1. (; is blank better than the space).
But the pyglet seem more complex than the tkinter. I like tkinter than pyglet more headache for me. I am gonna keep to trying with tkinter because wanted use button and many sizes of fonts each other texts on same the clock screen.

Buran or anyone, if you have time, would you find what's wrong with my original coding with the Tkinter as unable to load the font?
My original code does not load the font from the raspberry pi 4B but WORKS on my Python for windows (include exactly copied all modules from raspberry pi to windows)
Thank You So Much a Million!