Category : fonts

I’m trying to grab a font from the same folder as the program I’m making and use it as the font for Tkinter stuff. Previously, I’d just use the font I have installed on my computer, but this isn’t an option since this is a program I plan to share. pyglet.font.add_file(‘testingFont.ttf’) myFont = font.Font(family="testingFont",size=24) thisIsALabel ..

Read more

Recently I found out that the italic font is not applied to numbers in my legend. Here is the code: import matplotlib.pyplot as plt a = [1,2,3,4,5] b = [1,3,5,7,9] c = [1,2,4,6,8] x = [1,2,3,4,5] label = [‘ABC123′,r’it_$it{ABC123}$’, r’bf_$bf{ABC123}$’] plt.plot(x,a, label = label[0]) plt.plot(x,b, label = label[1]) plt.plot(x,c,label = label[2]) plt.legend() plt.show() output figure ..

Read more

I have two python files, one is a config file with font information Here is my config file: from tkinter.font import Font HEADER_FONT = Font( family="Futura", size=22, weight="bold", ) Here are the lines I am having trouble within my main file: import app.config.colors as colors import app.config.fonts as fonts root = tk.Tk() headerFrame = tk.LabelFrame(root, ..

Read more

I am generating a pdf file from csv file. While I tried to write BANGLA language it just broke the words. Here is my code: from fpdf import FPDF pdf = FPDF(orientation=’L’, unit=’mm’, format=’A5′) pdf.add_page() pdf.add_font(‘kalpurush’,”,’fileLocation/kalpurush.ttf’, uni=True) pdf.set_font(‘kalpurush’,”,18) pdf.set_xy(10,10) pdf.set_text_color(0, 0, 0) pdf.cell(w = 0,h=0.0, align=’L’, txt=u"শিরোনাম", border=0) pdf.output("test.pdf") The output file for the text ..

Read more