# 需要导入模块: from tkinter import font [as 别名]# 或者: from tkinter.font importnames[as 别名]def_init_scaling(self)->None:self._default_scaling_factor = self.tk.call("tk","scaling")ifself._default_scaling_factor >10:# it may be infinity in eg. Fedoraself._default_scaling_factor ...
tkinter.font.families(root=None, displayof=None) 返回不同的字体系列。tkinter.font.names(root=None) 返回定义字体的名字。tkinter.font.nametofont(name, root=None) 返回一个 Font 类,代表一个 tk 命名的字体。 在3.10 版更改: 增加了 root 形参。
开发者ID:jordanaycamara,项目名称:Tale,代码行数:32,代码来源:tkinter_textarea.py 示例8: fontsize ▲点赞 1▼ deffontsize(self, sz_diff):""" Change font sizes by sz_diff. """forfnameinfont.names(): f = font.nametofont(fname) sz = f.configure()["size"]ifsz <0:# use negative ...
tkinter.font.ITALIC tkinter.font.ROMANclass tkinter.font.Font(root=None, font=None, name=None, exists=False, **options) The Font class represents a named font. Font instances are given unique names and can be specified by their family, size, and style configuration. Named fonts are Tk's ...
importtkinter as tk importtkinter.font as tkFont root=tk.Tk() print(tkFont.names()) ('fixed', 'oemfixed', 'TkDefaultFont', 'TkMenuFont', 'ansifixed', 'systemfixed', 'TkHeadingFont', 'device', 'TkTooltipFont', 'defaultgui', 'TkTextFont', 'ansi', 'TkCaptionFont', 'system', ...
Next, in the PHP script, we dynamically assign these class names to HTML paragraph elements using theprintfunction. By changing the value of the$classNamevariable, we control which CSS class is applied to each paragraph. This approach demonstrates how we can effectively combine PHP and CSS to ...
defSyntexHighlight(self, event=None):fromtkinter.fontimportFontfortaginself.tag_names(): self.tag_delete(tag) self.mark_set("range_start","1.0") data = self._get_value() self.tag_configure("Token.Comment", foreground="#F00")
font_names = ('TkDefaultFont','TkMenuFont','TkTextFont')forfont_nameinfont_names: tk_font =nametofont(font_name) tk_font.config(size=font_size) 开发者ID:PacktPublishing,项目名称:Python-GUI-Programming-with-Tkinter,代码行数:8,代码来源:application.py ...
index =0self.font_indexes = {}fornameinfont_names: self.listbox.insert(index, name) self.font_indexes[index] = name index +=1self.listbox.bind("<<ListboxSelect>>", self._on_click) 开发者ID:TkinterEP,项目名称:ttkwidgets,代码行数:22,代码来源:familylistbox.py ...
开发者ID:zaazbb,项目名称:tkinterdemo,代码行数:9,代码来源:LogicalFont.py 示例7: __init__ ▲点赞 1▼ # 需要导入模块: import Pmw [as 别名]# 或者: from Pmw importlogicalfont[as 别名]def__init__(self, master, icondict, directory=None):self.master = master ...