I have the .ttf true-type-font file for rendering braille characters, sort of graphically, and was just wondering, if slapped together a wx-based GUI interface, how easy would it be to get something like a static label to render it’s text output using that font, without having it installed on the target windows machine?
TIA
Jacob Kruger
Blind Biker
Skype: BlindZA
“Roger Wilco wants to welcome you…to the space janitor’s closet…”
Ok, little bit of online research, and seems font would need to be installed on this windows machine, but, how do I then implement a wx.Font object, since seems like needs you to specify something like a font base name at initiation? Just not sure what counts as base name for this file - if use the name windows refers to it as, am not sure it’s really implementing it etc., and when then instantiating an instance of wx.StaticText, would I just pass the wx.Font object to it as an argument?
TIA
Jacob Kruger
Blind Biker
Skype: BlindZA
“Roger Wilco wants to welcome you…to the space janitor’s closet…”
···
----- Original Message -----
From:
Jacob Kruger
To: wxpython-users@googlegroupscom
Sent: Friday, May 08, 2015 11:20 AM
Subject: [wxPython-users] Implementing TTF/true-type-font in a wx control, using the .ttf file?
I have the .ttf true-type-font file for rendering braille characters, sort of graphically, and was just wondering, if slapped together a wx-based GUI interface, how easy would it be to get something like a static label to render it’s text output using that font, without having it installed on the target windows machine?
TIA
Jacob Kruger
Blind Biker
Skype: BlindZA
“Roger Wilco wants to welcome you…to the space janitor’s closet…”
–
You received this message because you are subscribed to the Google Groups “wxPython-users” group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Installing a font is a very operating system-specific task. I’m not
sure there is any abstraction available.
On Windows, you can use the AddFontResource API to add a temporary
font that will last only until the next reboot. To make it
permanent, you need to copy the file into C:\Windows\Fonts.
···
Jacob Kruger wrote:
I have the .ttf true-type-font
file for rendering braille characters, sort of graphically,
and was just wondering, if slapped together a wx-based GUI
interface, how easy would it be to get something like a static
label to render it’s text output using that font, without
having it installed on the target windows machine?
-- Tim Roberts, Providenza & Boekelheide, Inc.
timr@probo.com
installed font, and you can then pass that font to where you want it used.
http://docs.wxwidgets.org/3.0/overview_font.html
You want to set the faceName
The trick may be to figure out what to call it! -- but look on the overview
page under Native Font Information -- it looks like you can us a Font
Dialog to grab the font -- then you should be able to store the native font
info (which I think is a string).
- Good luck.
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov
···
On Fri, May 8, 2015 at 12:15 PM, Jacob Kruger <jacob@blindza.co.za> wrote:
The installation of the font is not really an issue, but, now trying to
figure out how to then make use of that font-face when rendering the
wx.StaticText element?
what have you tried? wx should be able to create a wxFont object from any
Ok, if I invoke wx.GetFontFromUser, I can select it from the list of
fonts, choose font size, colour, effects, etc., and then have the wx.Font
instance returned from the dialogue, and then .GetFaceName() returns "gh
Braille Nemeth One".
However, for example, if I just try implementing a new font using that
string value, it doesn't immediately notify me about any errors/issues, but
I then get all sorts of errors relating to __init__ of parent class not
having been called if I then try doing much with the object/instance
thereafter - the one returned from dialogue works fine/alright.
darn -- you'd think that would work. But maybe this will:
"""
Instead, you should store the value returned by
wxFont::GetNativeFontInfoDesc and pass it to wxFont::SetNativeFontInfo later
to recreate exactly the same font.
"""
I _think_ the NativeFontInfo is a string, so you can save and restore it
easily enough.
-Chris
···
On Sat, May 9, 2015 at 1:00 AM, Jacob Kruger <jacob@blindza.co.za> wrote:
Also tried then pickling the returned .Font object to then reinvoke it
later, but, there, it again just tells me __init__ hasn't been called.
So, for now, think will have to just use the font selection dialogue on
startup, just because - not major, but, still just wondering.
Thanks for pointer
Jacob Kruger
Blind Biker
Skype: BlindZA
"Roger Wilco wants to welcome you...to the space janitor's closet..."
--
You received this message because you are subscribed to the Google Groups
"wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov