Python wx.Font() Examples
The following are 30
code examples of wx.Font().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
wx
, or try the search function
.
Example #1
Source File: gui.py From superpaper with MIT License | 6 votes |
def draw_monitor_sizes(self): font = wx.Font(24, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_LIGHT) font_clr = wx.Colour(60, 60, 60, alpha=wx.ALPHA_OPAQUE) for st_bmp, img_sz, dsp in zip(self.preview_img_list, self.img_rel_sizes, self.display_sys.disp_list): bmp = st_bmp.GetBitmap() dc = wx.MemoryDC(bmp) text = str(dsp.diagonal_size()[1]) + '"' dc.SetTextForeground(font_clr) dc.SetFont(font) # bmp_w, bmp_h = dc.GetSize() bmp_w, bmp_h = img_sz text_w, text_h = dc.GetTextExtent(text) pos_w = bmp_w - text_w - 5 pos_h = 5 dc.DrawText(text, pos_w, pos_h) del dc st_bmp.SetBitmap(bmp)
Example #2
Source File: gui.py From superpaper with MIT License | 6 votes |
def draw_monitor_numbers(self, use_ppi_px): font = wx.Font(24, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL) font_clr = wx.Colour(60, 60, 60, alpha=wx.ALPHA_OPAQUE) for st_bmp in self.preview_img_list: bmp = st_bmp.GetBitmap() dc = wx.MemoryDC(bmp) text = str(self.preview_img_list.index(st_bmp)) dc.SetTextForeground(font_clr) dc.SetFont(font) dc.DrawText(text, 5, 5) del dc st_bmp.SetBitmap(bmp) if use_ppi_px: self.draw_monitor_sizes()
Example #3
Source File: wm_legend.py From wafer_map with GNU General Public License v3.0 | 6 votes |
def __init__(self, String, xy, Size=24, Color="Black", BackgroundColor=None, Family=wx.MODERN, Style=wx.NORMAL, Weight=wx.NORMAL, Underlined=False, Font=None): FloatCanvas.Text.__init__(self, String, xy, Size=Size, Color=Color, BackgroundColor=BackgroundColor, Family=Family, Style=Style, Weight=Weight, Underlined=Underlined, Font=Font)
Example #4
Source File: FCObjects.py From wafer_map with GNU General Public License v3.0 | 6 votes |
def _Draw(self, dc , WorldToPixel, ScaleWorldToPixel, HTdc=None): XY = WorldToPixel(self.XY) dc.SetFont(self.Font) dc.SetTextForeground(self.Color) if self.BackgroundColor: dc.SetBackgroundMode(wx.SOLID) dc.SetTextBackground(self.BackgroundColor) else: dc.SetBackgroundMode(wx.TRANSPARENT) if self.TextWidth is None or self.TextHeight is None: (self.TextWidth, self.TextHeight) = dc.GetTextExtent(self.String) XY = self.ShiftFun(XY[0], XY[1], self.TextWidth, self.TextHeight) dc.DrawText(self.String, XY) if HTdc and self.HitAble: HTdc.SetPen(self.HitPen) HTdc.SetBrush(self.HitBrush) HTdc.DrawRectangle(XY, (self.TextWidth, self.TextHeight) )
Example #5
Source File: FCObjects.py From wafer_map with GNU General Public License v3.0 | 6 votes |
def ComputeFontScale(): """ Compute the font scale. A global variable to hold the scaling from pixel size to point size. """ global FontScale dc = wx.ScreenDC() dc.SetFont(wx.Font(16, wx.FONTFAMILY_ROMAN, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) E = dc.GetTextExtent("X") FontScale = 16/E[1] del dc # why do we do this here, causes a Sphinx build crash #ComputeFontScale() ## fixme: This should probably be re-factored into a class
Example #6
Source File: PanelClass.py From wxGlade with MIT License | 6 votes |
def __init__(self, *args, **kwds): # begin wxGlade: DebugPanel.__init__ kwds["style"] = kwds.get("style", 0) | wx.TAB_TRAVERSAL wx.Panel.__init__(self, *args, **kwds) self.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, 0, "")) sizer_2 = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, "sizer_2"), wx.VERTICAL) sizer_2.Add((0, 0), 0, 0, 0) self.SetSizer(sizer_2) self.Layout() # end wxGlade # end of class DebugPanel
Example #7
Source File: bug163.py From wxGlade with MIT License | 6 votes |
def __init__(self, *args, **kwds): # begin wxGlade: MyFrame.__init__ kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE wx.Frame.__init__(self, *args, **kwds) self.SetTitle(_("MyFrame")) sizer_1 = wx.BoxSizer(wx.VERTICAL) self.label_1 = wx.StaticText(self, wx.ID_ANY, _("Extraproperty example")) self.label_1.SetFont(wx.Font(40, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) self.label_1.SetFoobar(1) sizer_1.Add(self.label_1, 1, wx.ALL, 5) self.SetSizer(sizer_1) sizer_1.Fit(self) self.Layout() # end wxGlade # end of class MyFrame
Example #8
Source File: About.py From meerk40t with MIT License | 6 votes |
def __do_layout(self): # begin wxGlade: About.__do_layout sizer_1 = wx.BoxSizer(wx.VERTICAL) sizer_2 = wx.BoxSizer(wx.HORIZONTAL) sizer_3 = wx.BoxSizer(wx.VERTICAL) sizer_3.Add(self.bitmap_button_1, 1, 0, 0) self.meerk40t_about_version_text.SetFont(wx.Font(10, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, "Segoe UI")) sizer_3.Add(self.meerk40t_about_version_text, 0, 0, 0) sizer_2.Add(sizer_3, 1, wx.EXPAND, 0) meerk40t_about_text_header = wx.StaticText(self, wx.ID_ANY, "MeerK40t is a free MIT Licensed open source project for lasering on K40 Devices.\n\nParticipation in the project is highly encouraged. Past participation, and continuing participation is graciously thanked. This program is mostly the brainchild of Tatarize, who sincerely hopes his contributions will be but the barest trickle that becomes a raging river.") meerk40t_about_text_header.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, "Segoe UI")) sizer_2.Add(meerk40t_about_text_header, 2, wx.EXPAND, 0) sizer_1.Add(sizer_2, 1, wx.EXPAND, 0) meerk40t_about_text = wx.StaticText(self, wx.ID_ANY, "Thanks.\nLi Huiyu for their controller. \nScorch for lighting our path.\nAlois Zingl for his wonderful Bresenham plotting algorithms.\n@joerlane and all the MeerKittens, past and present, great and small.\n\nIcon8 for their great icons ( https://icons8.com/ ) used throughout the project.\nThe works of countless developers who made everything possible.\nRegebro for his svg.path module.\nThe SVG Working Group.\nHackers (in the general sense).") meerk40t_about_text.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, "Segoe UI")) sizer_1.Add(meerk40t_about_text, 2, wx.EXPAND, 0) self.SetSizer(sizer_1) self.Layout() self.Centre() # end wxGlade
Example #9
Source File: config.py From trelby with GNU General Public License v2.0 | 6 votes |
def save(self): s = self.cvars.save("", self) for t in self.types.itervalues(): s += t.save("Element/") for pf in self.pdfFonts.itervalues(): s += pf.save("Font/") return s # fix up all invalid config values and recalculate all variables # dependent on other variables. # # if doAll is False, enforces restrictions only on a per-variable # basis, e.g. doesn't modify variable v2 based on v1's value. this is # useful when user is interactively modifying v1, and it temporarily # strays out of bounds (e.g. when deleting the old text in an entry # box, thus getting the minimum value), which would then possibly # modify the value of other variables which is not what we want.
Example #10
Source File: AnimatedWindow.py From EventGhost with GNU General Public License v2.0 | 6 votes |
def __init__(self, parent): wx.PyWindow.__init__(self, parent) self.font = wx.Font( 40, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_ITALIC, wx.FONTWEIGHT_BOLD ) self.SetBackgroundColour((255, 255, 255)) self.logo1 = GetInternalBitmap("opensource-55x48") self.logo2 = GetInternalBitmap("python-powered") self.logo3 = GetInternalBitmap("logo2") self.image = GetInternalImage("logo") self.bmpWidth = self.image.GetWidth() self.bmpHeight = self.image.GetHeight() self.time = clock() self.count = 0 self.Bind(wx.EVT_SIZE, self.OnSize) self.Bind(wx.EVT_TIMER, self.UpdateDrawing) self.OnSize(None) self.timer = wx.Timer(self) self.timer.Start(10)
Example #11
Source File: console.py From Gooey with MIT License | 5 votes |
def __init__(self, parent, buildSpec, **kwargs): wx.Panel.__init__(self, parent, **kwargs) self.buildSpec = buildSpec self.text = wx.StaticText(self, label=_("status")) if buildSpec["richtext_controls"]: from .widgets.richtextconsole import RichTextConsole self.textbox = RichTextConsole(self) else: self.textbox = BasicTextConsole(self) self.defaultFont = self.textbox.GetFont() self.textbox.SetFont(wx.Font( self.buildSpec['terminal_font_size'] or self.defaultFont.GetPointSize(), self.getFontStyle(), wx.NORMAL, self.buildSpec['terminal_font_weight'] or wx.NORMAL, False, self.getFontFace(), )) self.textbox.SetForegroundColour(self.buildSpec['terminal_font_color']) self.layoutComponent() self.Layout() self.Bind(wx.EVT_TEXT_URL, self.evtUrl, self.textbox)
Example #12
Source File: bugdialog_ui.py From wxGlade with MIT License | 5 votes |
def __set_properties(self): # begin wxGlade: UIBugDialog.__set_properties self.SetTitle(_("Error Dialog")) self.SetSize((600, 400)) self.SetFocus() self.tc_details.SetFont(wx.Font(10, wx.MODERN, wx.NORMAL, wx.NORMAL, 0, "")) self.tc_howto_report.SetFont(wx.Font(10, wx.MODERN, wx.NORMAL, wx.NORMAL, 0, "")) compat.SetToolTip( self.btn_copy, _("Copy error details to clipboard") ) self.btn_ok.SetDefault() # end wxGlade
Example #13
Source File: backend_wx.py From ImageFusion with MIT License | 5 votes |
def get_wx_font(self, s, prop): """ Return a wx font. Cache instances in a font dictionary for efficiency """ DEBUG_MSG("get_wx_font()", 1, self) key = hash(prop) fontprop = prop fontname = fontprop.get_name() font = self.fontd.get(key) if font is not None: return font # Allow use of platform independent and dependent font names wxFontname = self.fontnames.get(fontname, wx.ROMAN) wxFacename = '' # Empty => wxPython chooses based on wx_fontname # Font colour is determined by the active wx.Pen # TODO: It may be wise to cache font information size = self.points_to_pixels(fontprop.get_size_in_points()) font =wx.Font(int(size+0.5), # Size wxFontname, # 'Generic' name self.fontangles[fontprop.get_style()], # Angle self.fontweights[fontprop.get_weight()], # Weight False, # Underline wxFacename) # Platform font name # cache the font and gc and return it self.fontd[key] = font return font
Example #14
Source File: templates_ui.py From wxGlade with MIT License | 5 votes |
def __do_layout(self): # begin wxGlade: TemplateInfoDialog.__do_layout sizer_1 = wx.BoxSizer(wx.VERTICAL) sizer_6 = wx.BoxSizer(wx.HORIZONTAL) sizer_5 = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, _("Instructions")), wx.HORIZONTAL) sizer_4 = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, _("Description")), wx.HORIZONTAL) sizer_3 = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, _("Author")), wx.HORIZONTAL) sizer_2 = wx.BoxSizer(wx.HORIZONTAL) label_template_name = wx.StaticText(self, wx.ID_ANY, _("wxGlade template: ")) label_template_name.SetFont(wx.Font(-1, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) sizer_2.Add(label_template_name, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALL, 10) sizer_2.Add(self.template_name, 1, wx.ALIGN_CENTER_VERTICAL | wx.ALL, 10) sizer_1.Add(sizer_2, 0, wx.EXPAND, 0) sizer_3.Add(self.author, 1, 0, 0) sizer_1.Add(sizer_3, 0, wx.ALL | wx.EXPAND, 5) sizer_4.Add(self.description, 1, wx.EXPAND, 0) sizer_1.Add(sizer_4, 1, wx.ALL | wx.EXPAND, 5) sizer_5.Add(self.instructions, 1, wx.EXPAND, 0) sizer_1.Add(sizer_5, 1, wx.ALL | wx.EXPAND, 5) sizer_6.Add(self.button_1, 0, 0, 0) sizer_6.Add(self.button_2, 0, wx.LEFT, 10) sizer_1.Add(sizer_6, 0, wx.ALIGN_RIGHT | wx.ALL, 10) self.SetSizer(sizer_1) self.Layout() self.Centre() # end wxGlade # end of class TemplateInfoDialog
Example #15
Source File: simplebook.py From wxGlade with MIT License | 5 votes |
def __init__(self, *args, **kwds): # begin wxGlade: MySimplebook.__init__ kwds["style"] = kwds.get("style", 0) | wx.NB_TOP wx.Simplebook.__init__(self, *args, **kwds) self.notebook_1_pane_1 = wx.Panel(self, wx.ID_ANY) self.AddPage(self.notebook_1_pane_1, "notebook_1_pane_1") sizer_2 = wx.BoxSizer(wx.VERTICAL) label_1 = wx.StaticText(self.notebook_1_pane_1, wx.ID_ANY, "Page 1 of Simplebook") label_1.SetFont(wx.Font(20, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, "")) sizer_2.Add(label_1, 0, wx.ALIGN_CENTER | wx.ALL, 20) self.button_1 = wx.Button(self.notebook_1_pane_1, wx.ID_ANY, "Show page 2") self.button_1.SetFont(wx.Font(16, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, "")) sizer_2.Add(self.button_1, 1, wx.ALL | wx.EXPAND, 20) self.notebook_1_notebook_1_pane_2 = wx.Panel(self, wx.ID_ANY) self.AddPage(self.notebook_1_notebook_1_pane_2, "notebook_1_pane_2") sizer_3 = wx.BoxSizer(wx.VERTICAL) label_2 = wx.StaticText(self.notebook_1_notebook_1_pane_2, wx.ID_ANY, "Page 2 of Simplebook") label_2.SetFont(wx.Font(20, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, "")) sizer_3.Add(label_2, 0, wx.ALIGN_CENTER | wx.ALL, 20) self.button_2 = wx.Button(self.notebook_1_notebook_1_pane_2, wx.ID_ANY, "Show page 1") self.button_2.SetFont(wx.Font(16, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, "")) sizer_3.Add(self.button_2, 1, wx.ALL | wx.EXPAND, 20) self.notebook_1_notebook_1_pane_2.SetSizer(sizer_3) self.notebook_1_pane_1.SetSizer(sizer_2) self.Bind(wx.EVT_BUTTON, lambda event: self.ChangeSelection(1), self.button_1) self.Bind(wx.EVT_BUTTON, lambda event: self.ChangeSelection(0), self.button_2) # end wxGlade # end of class MySimplebook
Example #16
Source File: msgdialog.py From wxGlade with MIT License | 5 votes |
def __init__(self, *args, **kwds): # begin wxGlade: MessageDialog.__init__ kwds["style"] = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER wx.Dialog.__init__(self, *args, **kwds) bmp = compat.wx_ArtProvider_GetBitmap(wx.ART_TIP, wx.ART_MESSAGE_BOX, (48, 48)) self.msg_image = wx.StaticBitmap(self, wx.ID_ANY, bmp) self.msg_list = wx.ListCtrl(self, wx.ID_ANY, style=wx.BORDER_SUNKEN | wx.LC_NO_HEADER | wx.LC_REPORT | wx.LC_SINGLE_SEL) self.OK = wx.Button(self, wx.ID_OK, "") # properties self.SetTitle(_("wxGlade Message")) self.msg_image.SetMinSize((48, 48)) self.OK.SetFocus() self.OK.SetDefault() # layout sizer_1 = wx.BoxSizer(wx.VERTICAL) sizer_2 = wx.BoxSizer(wx.HORIZONTAL) msg_title = wx.StaticText(self, wx.ID_ANY, _("wxGlade Message")) msg_title.SetFont(wx.Font(-1, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) sizer_1.Add(msg_title, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 5) sizer_2.Add(self.msg_image, 0, 0, 0) sizer_2.Add(self.msg_list, 1, wx.EXPAND | wx.LEFT, 10) sizer_1.Add(sizer_2, 1, wx.EXPAND | wx.LEFT | wx.RIGHT, 5) sizer_1.Add(self.OK, 0, wx.ALIGN_RIGHT | wx.ALL, 10) self.SetSizer(sizer_1) self.Layout() self.Centre()
Example #17
Source File: misc.py From wxGlade with MIT License | 5 votes |
def __init__(self, title): wx.Menu.__init__(self) self.TITLE_ID = wx.NewId() item = self.Append(self.TITLE_ID, title) self.AppendSeparator() font = item.GetFont() font.SetWeight(wx.BOLD) item.SetFont( wx.Font(font.GetPointSize(), font.GetFamily(), font.GetStyle(), wx.BOLD) )
Example #18
Source File: edit_windows.py From wxGlade with MIT License | 5 votes |
def _set_font(self): if not self.widget: return font_p = self.properties["font"] if not font_p.is_active(): font = self._original["font"] else: font = font_p.value families = np.FontProperty.font_families_to styles = np.FontProperty.font_styles_to weights = np.FontProperty.font_weights_to font = wx.Font( font[0], families[font[1]], styles[font[2]], weights[font[3]], font[4], font[5]) self.widget.SetFont(font) if hasattr(self.parent, "set_item_best_size") and not self.check_prop("size"): self.parent.set_item_best_size(self)
Example #19
Source File: templates_ui.py From wxGlade with MIT License | 5 votes |
def __set_properties(self): # begin wxGlade: TemplateListDialog.__set_properties self.SetTitle(_("wxGlade template list")) self.SetSize( (600, 400) ) self.template_name.SetFont(wx.Font(-1, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) # end wxGlade
Example #20
Source File: wx_util.py From Gooey with MIT License | 5 votes |
def _header(parent, label, styles): text = wx.StaticText(parent, label=label) font_size = text.GetFont().GetPointSize() font = wx.Font(font_size * 1.2, *styles) text.SetFont(font) return text
Example #21
Source File: wx_util.py From Gooey with MIT License | 5 votes |
def h0(parent, label): text = wx.StaticText(parent, label=label) font_size = text.GetFont().GetPointSize() font = wx.Font(font_size * 1.4, *styles['h0']) text.SetFont(font) return text
Example #22
Source File: wx_util.py From Gooey with MIT License | 5 votes |
def make_bold(statictext): pointsize = statictext.GetFont().GetPointSize() font = wx.Font(pointsize, *styles['bold']) statictext.SetFont(font)
Example #23
Source File: elecsus_gui.py From ElecSus with Apache License 2.0 | 5 votes |
def __init__(self, parent, mainwin, ID): """ mainwin is the main panel so we can bind buttons to actions in the main frame """ scrolled.ScrolledPanel.__init__(self, parent) statusTitle = wx.StaticText(self, wx.ID_ANY, ID) font = wx.Font(12,wx.DEFAULT, wx.NORMAL,wx.NORMAL) statusTitle.SetFont(font) self.StatusTextBox = wx.TextCtrl(self,wx.ID_ANY,"",style=wx.TE_READONLY|wx.TE_MULTILINE) #self.StatusTextBox.Size.SetHeight(500) self.SaveBtn = wx.Button(self,wx.ID_ANY,"Save Text to file",size=(100,-1)) self.Bind(wx.EVT_BUTTON,self.OnSave,self.SaveBtn) panel_sizer = wx.BoxSizer(wx.VERTICAL) panel_sizer.Add((-1,10),0,wx.EXPAND) panel_sizer.Add(statusTitle,0,wx.EXPAND|wx.LEFT,border=20) panel_sizer.Add((-1,10),0,wx.EXPAND) panel_sizer.Add(self.StatusTextBox,1,wx.EXPAND|wx.LEFT|wx.RIGHT,border=40) panel_sizer.Add((-1,10),0,wx.EXPAND) panel_sizer.Add(self.SaveBtn,0,wx.EXPAND|wx.LEFT|wx.RIGHT,border=40) panel_sizer.Add((-1,20),0,wx.EXPAND) self.SetSizer(panel_sizer) self.SetupScrolling() self.Layout()
Example #24
Source File: wx_util.py From pyFileFixity with MIT License | 5 votes |
def _header(parent, label, styles): text = wx.StaticText(parent, label=label) font_size = text.GetFont().GetPointSize() font = wx.Font(font_size * 1.2, *styles) text.SetFont(font) return text
Example #25
Source File: runtime_display_panel.py From me-ica with GNU Lesser General Public License v2.1 | 5 votes |
def set_font_style(self, style): pointsize = self.cmd_textbox.GetFont().GetPointSize() font = wx.Font(pointsize, style, wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_BOLD, False) self.cmd_textbox.SetFont(font)
Example #26
Source File: styling.py From pyFileFixity with MIT License | 5 votes |
def H1(parent, label): text = wx.StaticText(parent, label=label) font_size = text.GetFont().GetPointSize() font = wx.Font(font_size * 1.2, wx.FONTFAMILY_DEFAULT, wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_BOLD, False) text.SetFont(font) return text
Example #27
Source File: wx_util.py From pyFileFixity with MIT License | 5 votes |
def h0(parent, label): text = wx.StaticText(parent, label=label) font_size = text.GetFont().GetPointSize() font = wx.Font(font_size * 1.4, *(wx.FONTFAMILY_DEFAULT, wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_BOLD, False)) text.SetFont(font) return text
Example #28
Source File: styling.py From pyFileFixity with MIT License | 5 votes |
def _bold_static_text(parent, text_label): text = wx.StaticText(parent, label=text_label) font_size = text.GetFont().GetPointSize() bold = wx.Font(font_size, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD) text.SetFont(bold) return text
Example #29
Source File: styling.py From pyFileFixity with MIT License | 5 votes |
def MakeBold(statictext): pointsize = statictext.GetFont().GetPointSize() font = wx.Font(pointsize, wx.FONTFAMILY_DEFAULT, wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_BOLD, False) statictext.SetFont(font)
Example #30
Source File: tydesk.py From tydesk with GNU General Public License v3.0 | 5 votes |
def __init__(self, *args, **kw): super(Link, self).__init__(*args, **kw) self.font1 = wx.Font(11, wx.SWISS, wx.NORMAL, wx.NORMAL, True, u'微软雅黑') self.font2 = wx.Font(11, wx.SWISS, wx.NORMAL, wx.NORMAL, False, u'微软雅黑') self.SetFont(self.font2) self.SetForegroundColour('#0000ff') self.Bind(wx.EVT_MOUSE_EVENTS, self.OnMouseEvent) self.Bind(wx.EVT_MOTION, self.OnMouseEvent)