Python Forum
Load external font and does not show font in the window
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Load external font and does not show font in the window
#1
Confused the Coding with the font... Huh Doh

I use to download the font at:
https://www.1001freefonts.com/digital-play-st.font

Here code what I am trying:
from tkinter import *
import pyglet

win = Tk()

win.geometry("500x200")
win.title("FONT TEST")

pyglet.font.add_file('/home/pi/.fonts/digital.ttf')

set_font=pyglet.font.load('Digital Play St')

print(set_font)

lab2=Label(win, text="0 1 2 3 4 5 6 7 8 9", font=('set_font',19))
lab2.place(x=10,y=10)

win.mainloop()


I got the result is NOT what I wanted with the font:
[Image: view?usp=sharing]

Supposed be like this:
[Image: ed4c85679cf0100d7b1a62cea923978b.png]

Thanks for help!!! Type

I forgot to add, I renamed Digital Play St.ttf to digital.ttf
Reply


Messages In This Thread
Load external font and does not show font in the window - by ATARI_LIVE - Sep-15-2020, 12:30 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python code for alignment and font size 1418 0 413 Jan-14-2024, 03:56 AM
Last Post: 1418
  Is there a way to call and focus any popup window outside of the main window app? Valjean 6 2,184 Oct-02-2023, 04:11 PM
Last Post: deanhystad
  Change font in a list or tuple apffal 4 2,836 Jun-16-2023, 02:55 AM
Last Post: schriftartenio
  can openpyxl read font colors mperemsky 3 1,949 May-09-2023, 11:18 AM
Last Post: MindKeeper
  Comparing two columns with same value but different font format doug2019 1 800 Jan-08-2023, 02:58 PM
Last Post: Larz60+
  PIL Image im.show() no show! Pedroski55 2 1,071 Sep-12-2022, 10:19 PM
Last Post: Pedroski55
  Pyspark Window: perform sum over a window with specific conditions Shena76 0 1,290 Jun-13-2022, 08:59 AM
Last Post: Shena76
  Folium: Conflict with Font Awesome Kit jgomes_eu 0 1,291 Apr-23-2022, 03:18 PM
Last Post: jgomes_eu
  Print text with big font and style tomtom 5 14,714 Mar-03-2022, 01:29 AM
Last Post: tomtom
  PIL Image im.show() no show! Pedroski55 6 5,381 Feb-08-2022, 06:32 AM
Last Post: Pedroski55

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020