'Ray Satiro' via wx-users
2014-08-26 18:48:35 UTC
Is there a way to get the font information for a wxHtmlWindow? I'm using wxWidgets built from master branch commit a307120 20140818. I'm adding a font picker to the app I'm working on allow the user to change the font face and size for an wxHtmlWindow. I would like to get whatever font the wxHtmlWindow is set to and then set the font picker to that font face and size so that when the picker is opened it shows the currently applied font. I tried GetFont() but it always returns the same thing and not what is actually set. To workaround what I am going to do is after the first time the user uses the font picker I'll record what they selected and save that information so the next time it is opened I can set it to what they last selected. But I don't have the information for the initial opening.
I set the selected face and size using SetStandardFonts(). Another thing I've noticed is the size I set appears much smaller in the wxHtmlWindow. To workaround that I can add a some points to the point size, but I'm curious why that is or if anyone has encountered something similar. A lot of the html has a relative font tag size -1 but still it seems quite a few points small.
Does anyone have a link to documentation of SetFonts()? I've read wxHtmlDCRenderer::SetFonts() [1] and it says the sizes are set using wxHTML_FONT_SIZE_1, etc. but I can't find those defined anywhere. It also doesn't say whether it needs point size or pixel size. I'm not using SetFonts() yet but I am looking into it to see if something in the array of sizes is why when I set a font size it appears much smaller. I was thinking if someone set a font like 14 for example I could do an array of {12,13,14,15,16,17,18} to represent the HTML relative sizes of {-2,-1,0,1,2,3,4} unless that isn't advised maybe because there is more distance needed between sizes or wxWidgets auto adjusts that array automatically when SetStandardFonts() is called? Can I get the current settings for that array and should I adjust it manually?
Thanks
[1]: http://docs.wxwidgets.org/trunk/classwx_html_d_c_renderer.html#a70cfd1cd9f25f91afe40694466b70f7a
I set the selected face and size using SetStandardFonts(). Another thing I've noticed is the size I set appears much smaller in the wxHtmlWindow. To workaround that I can add a some points to the point size, but I'm curious why that is or if anyone has encountered something similar. A lot of the html has a relative font tag size -1 but still it seems quite a few points small.
Does anyone have a link to documentation of SetFonts()? I've read wxHtmlDCRenderer::SetFonts() [1] and it says the sizes are set using wxHTML_FONT_SIZE_1, etc. but I can't find those defined anywhere. It also doesn't say whether it needs point size or pixel size. I'm not using SetFonts() yet but I am looking into it to see if something in the array of sizes is why when I set a font size it appears much smaller. I was thinking if someone set a font like 14 for example I could do an array of {12,13,14,15,16,17,18} to represent the HTML relative sizes of {-2,-1,0,1,2,3,4} unless that isn't advised maybe because there is more distance needed between sizes or wxWidgets auto adjusts that array automatically when SetStandardFonts() is called? Can I get the current settings for that array and should I adjust it manually?
Thanks
[1]: http://docs.wxwidgets.org/trunk/classwx_html_d_c_renderer.html#a70cfd1cd9f25f91afe40694466b70f7a
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users